Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (27)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (6747)

  • ffmpeg installation undefined reference to

    8 février 2017, par user1683302

    I used this official link to download ffmpeg and compile it. I know it creates a static library and I have to reference the library folder. When i try to compile this tutorial . i get this errors

    tutorial01.c: In function ‘main’:
    tutorial01.c:96:5: warning: ‘codec’ is deprecated [-Wdeprecated- declarations]
    if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) {
    ^
    In file included from tutorial01.c:27:0:
    /home/osboxes/ffmpeg_build/include/libavformat/avformat.h:893:21: note:  declared here
    AVCodecContext *codec;
                    ^
    tutorial01.c:104:3: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
    pCodecCtxOrig=pFormatCtx->streams[videoStream]->codec;
    ^
    In file included from tutorial01.c:27:0:
    /home/osboxes/ffmpeg_build/include/libavformat/avformat.h:893:21: note: declared here
    AVCodecContext *codec;
                    ^
    tutorial01.c:113:3: warning: ‘avcodec_copy_context’ is deprecated  [-Wdeprecated-declarations]
    if(avcodec_copy_context(pCodecCtx, pCodecCtxOrig) != 0) {
    ^
    In file included from tutorial01.c:26:0:
    /home/osboxes/ffmpeg_build/include/libavcodec/avcodec.h:4240:5: note: declared here
    int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
    ^
    tutorial01.c:131:3: warning: ‘avpicture_get_size’ is deprecated   [-Wdeprecated-declarations]
    numBytes=avpicture_get_size(AV_PIX_FMT_RGB24, pCodecCtx->width,
    ^
    In file included from tutorial01.c:26:0:
    /home/osboxes/ffmpeg_build/include/libavcodec/avcodec.h:5467:5: note: declared here
    int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
    ^
     tutorial01.c:138:3: warning: ‘avpicture_fill’ is deprecated [-Wdeprecated-declarations]
      avpicture_fill((AVPicture *)pFrameRGB, buffer, AV_PIX_FMT_RGB24,
      ^
     In file included from tutorial01.c:26:0:
     /home/osboxes/ffmpeg_build/include/libavcodec/avcodec.h:5452:5: note: declared here
     int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
    ^
      tutorial01.c:160:7: warning: ‘avcodec_decode_video2’ is deprecated [-Wdeprecated-declarations]
          avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
          ^
    In file included from tutorial01.c:26:0:
     /home/osboxes/ffmpeg_build/include/libavcodec/avcodec.h:4811:5: note: declared here
     int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
    ^
     tutorial01.c:177:5: warning: ‘av_free_packet’ is deprecated [-Wdeprecated-declarations]
     av_free_packet(&packet);
     ^
    In file included from tutorial01.c:26:0:
    /home/osboxes/ffmpeg_build/include/libavcodec/avcodec.h:4472:6: note: declared here
    void av_free_packet(AVPacket *pkt);
     ^
    /tmp/ccHYDd9j.o: In function `main':
    tutorial01.c:(.text+0x178): undefined reference to `av_register_all'
    tutorial01.c:(.text+0x19f): undefined reference to `avformat_open_input'
    tutorial01.c:(.text+0x1c1): undefined reference to `avformat_find_stream_info'
    tutorial01.c:(.text+0x1f6): undefined reference to `av_dump_format'
    tutorial01.c:(.text+0x2ab): undefined reference to `avcodec_find_decoder'
    tutorial01.c:(.text+0x2ea): undefined reference to `avcodec_alloc_context3'
    tutorial01.c:(.text+0x304): undefined reference to `avcodec_copy_context'
    tutorial01.c:(.text+0x348): undefined reference to `avcodec_open2'
    tutorial01.c:(.text+0x35b): undefined reference to `av_frame_alloc'
    tutorial01.c:(.text+0x367): undefined reference to `av_frame_alloc'
    tutorial01.c:(.text+0x3a4): undefined reference to `avpicture_get_size'
    tutorial01.c:(.text+0x3ba): undefined reference to `av_malloc'
    tutorial01.c:(.text+0x3ef): undefined reference to `avpicture_fill'
    tutorial01.c:(.text+0x439): undefined reference to `sws_getContext'
    tutorial01.c:(.text+0x47d): undefined reference to `avcodec_decode_video2'
    tutorial01.c:(.text+0x4de): undefined reference to `sws_scale'
    tutorial01.c:(.text+0x527): undefined reference to `av_free_packet'
    tutorial01.c:(.text+0x53d): undefined reference to `av_read_frame'
    tutorial01.c:(.text+0x551): undefined reference to `av_free'
    tutorial01.c:(.text+0x560): undefined reference to `av_frame_free'
    tutorial01.c:(.text+0x56f): undefined reference to `av_frame_free'
    tutorial01.c:(.text+0x57b): undefined reference to `avcodec_close'
    tutorial01.c:(.text+0x58a): undefined reference to `avcodec_close'
    tutorial01.c:(.text+0x599): undefined reference to `avformat_close_input'
    collect2: error: ld returned 1 exit status

    i used this sudo gcc -I /home/osboxes/ffmpeg_build/include -L /home/osboxes/ffmpeg_build/lib -lavcode -lavformat -lavutil -lswscale -lz -lm tutorial01.c

    my ffmpeg is

    ffmpeg version N-82113-g490c6bd Copyright (c) 2000-2016 the FFmpeg developers
      built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
      configuration: --prefix=/home/osboxes/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/osboxes/ffmpeg_build/include --extra-ldflags=- L/home/osboxes/ffmpeg_build/lib --bindir=/home/osboxes/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libopus --enable-libx264 --enable-nonfree
     libavutil      55. 33.100 / 55. 33.100
     libavcodec     57. 63.103 / 57. 63.103
     libavformat    57. 55.100 / 57. 55.100
     libavdevice    57.  0.103 / 57.  0.103
     libavfilter     6. 64.100 /  6. 64.100
     libswscale      4.  1.100 /  4.  1.100
     libswresample   2.  2.100 /  2.  2.100
     libpostproc    54.  0.100 / 54.  0.100
    Hyper fast Audio and Video encoder
    usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

    the tutorial code was update to work on new ffmpeg versions.I’m using VM Ubuntu 16.0.4 64 bit fresh install on windows 10 host.

    so why I’m having all of these errors ?

    Update :
    I moved to Ubuntu 12.04 VM and ffmpeg 0.11, I instilled it with opencv 2.4.2 here is the link . This should work yet i don’t why I’m having hard time compiling such small program.

    ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
    built on Oct 25 2016 13:39:37 with gcc 4.6.3
     configuration: --enable-gpl --enable-libfaac --enable-libmp3lame    --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-shared --enable-pic
    libavutil      51. 54.100 / 51. 54.100
    libavcodec     54. 23.100 / 54. 23.100
    libavformat    54.  6.100 / 54.  6.100
    libavdevice    54.  0.100 / 54.  0.100
    libavfilter     2. 77.100 /  2. 77.100
    libswscale      2.  1.100 /  2.  1.100
    libswresample   0. 15.100 /  0. 15.100
    libpostproc    52.  0.100 / 52.  0.100
    Hyper fast Audio and Video encoder
    usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

    yet i still have the problem but it is less sever

    gcc -o tutorial01 tutorial01.c -Wl,--start-group -lavcodec -lavformat  -lswscale -lavutil -lz -lm -Wl,--end-group    
     /tmp/ccnFfu84.o: In function `main':
     tutorial01.c:(.text+0x500): undefined reference to `avcodec_free_frame'
     tutorial01.c:(.text+0x511): undefined reference to `avcodec_free_frame'
     collect2: ld returned 1 exit status

    i tried this ldconfig -p | grep av

     libxklavier.so.16 (libc6,x86-64) => /usr/lib/libxklavier.so.16
     libwavpack.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux gnu/libwavpack.so.1
    libjavascriptcoregtk-3.0.so.0 (libc6,x86-64) => /usr/lib/libjavascriptcoregtk-3.0.so.0
    libdvdnavmini.so.4 (libc6,x86-64) => /usr/lib/libdvdnavmini.so.4
    libdvdnav.so.4 (libc6,x86-64) => /usr/lib/libdvdnav.so.4
    libavutil.so.51 (libc6,x86-64) => /usr/local/lib/libavutil.so.51
    libavutil.so.51 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavutil.so.51
    libavutil.so (libc6,x86-64) => /usr/local/lib/libavutil.so
    libavformat.so.54 (libc6,x86-64) => /usr/local/lib/libavformat.so.54
    libavformat.so.53 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavformat.so.53
    libavformat.so (libc6,x86-64) => /usr/local/lib/libavformat.so
    libavfilter.so.2 (libc6,x86-64) => /usr/local/lib/libavfilter.so.2
    libavfilter.so (libc6,x86-64) => /usr/local/lib/libavfilter.so
    libavdevice.so.54 (libc6,x86-64) => /usr/local/lib/libavdevice.so.54
    libavdevice.so (libc6,x86-64) => /usr/local/lib/libavdevice.so
    libavc1394.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavc1394.so.0
    libavcodec.so.54 (libc6,x86-64) => /usr/local/lib/libavcodec.so.54
    libavcodec.so.53 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavcodec.so.53
    libavcodec.so (libc6,x86-64) => /usr/local/lib/libavcodec.so
    libavahi-ui-gtk3.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-ui-gtk3.so.0
    libavahi-gobject.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-gobject.so.0
    libavahi-glib.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-glib.so.1
    libavahi-core.so.7 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-core.so.7
    libavahi-common.so.3 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-common.so.3
    libavahi-common.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-common.so
    libavahi-client.so.3 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-client.so.3
    libavahi-client.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavahi-client.so

    Update2

    I changged avcodec_free_frame to av_free and the file complied

    Dranger code is old

    Update 3
    i downloaded ffmpeg 1.0.10 which has the same library version that is the tutorial tested on. Everything complied without any problem now.

  • Change AVI creation date with ffmpeg ?

    1er novembre 2016, par brock

    As far as I can tell the following ffmpeg command should copy all existing metadata in the input file to the output file and modify the specified field in the output file :

    ffmpeg -i VID_20130502_220104.avi -metadata creation_time="2013-05-02 22:01:04" -codec copy VID_20130502_220104-2.avi

    Instead, it seems to strip all metadata from the output file. Here is the output of a few commands. I am going nuts. I think this should work, but why is it not ?

    Command to edit the creation time :

    ffmpeg -i VID_20130502_220104.avi -metadata creation_time="2013-05-02 22:01:04" -codec copy VID_20130502_220104-2.avi

    ffmpeg version 3.1.5 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 5.4.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
     libavutil      55. 28.100 / 55. 28.100
     libavcodec     57. 48.101 / 57. 48.101
     libavformat    57. 41.100 / 57. 41.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 47.100 /  6. 47.100
     libswscale      4.  1.100 /  4.  1.100
     libswresample   2.  1.100 /  2.  1.100
     libpostproc    54.  0.100 / 54.  0.100
    Guessed Channel Layout for Input Stream #0.1 : mono
    Input #0, avi, from 'VID_20130502_220104.avi':
     Metadata:
       encoder         :
       maker           : NIKON
       model           : COOLPIX S4300
       creation_time   : 2011-01-01 00:00:00
     Duration: 00:01:30.50, start: 0.000000, bitrate: 32135 kb/s
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 31782 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
       Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, s16, 352 kb/s
    [avi @ 000000000032ad40] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
       Last message repeated 1 times
    Output #0, avi, to 'VID_20130502_220104-2.avi':
     Metadata:
       creation_time   : 2013-05-02 22:01:04
       maker           : NIKON
       model           : COOLPIX S4300
       ISFT            : Lavf57.41.100
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, q=2-31, 31782 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
       Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, 352 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame=  891 fps=0.0 q=-1.0 size=  116171kB time=00:00:29.69 bitrate=32043.1kbits/s speed=59.4x    
    frame= 1739 fps=1739 q=-1.0 size=  227191kB time=00:00:57.96 bitrate=32107.5kbits/s speed=  58x    
    frame= 2609 fps=1739 q=-1.0 size=  340940kB time=00:01:26.96 bitrate=32115.9kbits/s speed=  58x    
    frame= 2715 fps=1734 q=-1.0 Lsize=  355018kB time=00:01:30.49 bitrate=32136.3kbits/s speed=57.8x    
    video:350984kB audio:3897kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.038597%

    Command to inspect the output file metadata with ffmpeg :

    ffmpeg -i VID_20130502_220104-2.avi

    ffmpeg version 3.1.5 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 5.4.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
     libavutil      55. 28.100 / 55. 28.100
     libavcodec     57. 48.101 / 57. 48.101
     libavformat    57. 41.100 / 57. 41.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 47.100 /  6. 47.100
     libswscale      4.  1.100 /  4.  1.100
     libswresample   2.  1.100 /  2.  1.100
     libpostproc    54.  0.100 / 54.  0.100
    Guessed Channel Layout for Input Stream #0.1 : mono
    Input #0, avi, from 'VID_20130502_220104-2.avi':
     Metadata:
       encoder         : Lavf57.41.100
     Duration: 00:01:30.50, start: 0.000000, bitrate: 32136 kb/s
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 31782 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
       Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, s16, 352 kb/s
    At least one output file must be specified

    Command to inspect the input file metadata with exiftool :

    exiftool.exe VID_20130502_220104.avi

    ExifTool Version Number         : 10.30
    File Name                       : VID_20130502_220104.avi
    Directory                       : .
    File Size                       : 347 MB
    File Modification Date/Time     : 2013:05:13 16:33:52-04:00
    File Access Date/Time           : 2015:11:10 23:08:25-05:00
    File Creation Date/Time         : 2015:11:10 23:08:25-05:00
    File Permissions                : rw-rw-rw-
    File Type                       : AVI
    File Type Extension             : avi
    MIME Type                       : video/x-msvideo
    Frame Rate                      : 30
    Max Data Rate                   : 488.3 kB/s
    Frame Count                     : 2715
    Stream Count                    : 2
    Stream Type                     : Video
    Video Codec                     : mjpg
    Video Frame Rate                : 30
    Video Frame Count               : 2715
    Quality                         : 10000
    Sample Size                     : Variable
    Image Width                     : 1280
    Image Height                    : 720
    Planes                          : 1
    Bit Depth                       : 24
    Compression                     : MJPG
    Image Length                    : 2764800
    Pixels Per Meter X              : 0
    Pixels Per Meter Y              : 0
    Num Colors                      : Use BitDepth
    Num Important Colors            : All
    Audio Codec                     :
    Audio Sample Rate               : 22050
    Audio Sample Count              : 1995256
    Encoding                        : Microsoft PCM
    Num Channels                    : 1
    Sample Rate                     : 22050
    Avg Bytes Per Sec               : 44100
    Bits Per Sample                 : 16
    Maker Note Type                 : NIKON
    Maker Note Version              : 0.1.0.0
    Make                            : NIKON
    Model                           : COOLPIX S4300
    Software                        : V1.0
    Equipment                       : NIKON DIGITAL CAMERA
    Orientation                     : Horizontal (normal)
    Exposure Time                   : 1/15
    F Number                        : 3.5
    Exposure Compensation           : 0
    Max Aperture Value              : 3.2
    Metering Mode                   : Multi-segment
    Focal Length                    : 4.6 mm
    X Resolution                    : 72
    Y Resolution                    : 72
    Resolution Unit                 : inches
    Date/Time Original              : 2011:01:01 00:00:00
    Create Date                     : 2011:01:01 00:00:00
    Focus Mode                      : AF-S
    Digital Zoom                    : 1
    Color Mode                      : COLOR
    Sharpness                       : AUTO
    White Balance                   : NORMAL
    Noise Reduction                 : OFF
    Thumbnail Image                 : (Binary data 3082 bytes, use -b option to extract)
    Aperture                        : 3.5
    Duration                        : 0:01:30
    Image Size                      : 1280x720
    Megapixels                      : 0.922
    Shutter Speed                   : 1/15
    Focal Length                    : 4.6 mm

    Command to inspect the output file metadata with exiftool :

    exiftool.exe VID_20130502_220104-2.avi

    ExifTool Version Number         : 10.30
    File Name                       : VID_20130502_220104-2.avi
    Directory                       : .
    File Size                       : 347 MB
    File Modification Date/Time     : 2016:11:01 00:17:38-04:00
    File Access Date/Time           : 2016:11:01 00:17:36-04:00
    File Creation Date/Time         : 2016:11:01 00:15:18-04:00
    File Permissions                : rw-rw-rw-
    File Type                       : AVI
    File Type Extension             : avi
    MIME Type                       : video/x-msvideo
    Frame Rate                      : 30
    Max Data Rate                   : 3923 kB/s
    Frame Count                     : 2715
    Stream Count                    : 2
    Stream Type                     : Video
    Video Codec                     : MJPG
    Video Frame Rate                : 30
    Video Frame Count               : 2715
    Quality                         : Default
    Sample Size                     : Variable
    Image Width                     : 1280
    Image Height                    : 720
    Planes                          : 1
    Bit Depth                       : 24
    Compression                     : MJPG
    Image Length                    : 2764800
    Pixels Per Meter X              : 0
    Pixels Per Meter Y              : 0
    Num Colors                      : Use BitDepth
    Num Important Colors            : All
    Audio Codec                     : .
    Audio Sample Rate               : 22050
    Audio Sample Count              : 1995256
    Encoding                        : Microsoft PCM
    Num Channels                    : 1
    Sample Rate                     : 22050
    Avg Bytes Per Sec               : 44100
    Bits Per Sample                 : 16
    Software                        : Lavf57.41.100
    Duration                        : 0:01:30
    Image Size                      : 1280x720
    Megapixels                      : 0.922
  • Problems with FFMPEG concat and/or MP4BOX

    11 novembre 2016, par user3730954

    I’ve been searching for a reliable way to concat a large (>30) number of mp4 files.

    My methods so far have been trying the MP4BOX concat CLI, and FFMPEG’s concat filter (such as ffmpeg -auto_convert 1 -y -f concat -i files.txt -c copy out.mp4).

    Both tools produce the same problem : joining 2 or 3 files seems to work great, but any greater number produces a corrupted mp4 file (such as https://drive.google.com/file/d/0B_mWxBuwYcSgQjQtUnpQeUxVTm8/view). I can create a workaround where I join only 2 videos at a time, until all videos have been joined, but this does not work for an odd number of joins (i.e. 13).

    Why do these methods work on some files, but not others ?

    FFPROBE produces errors as you would expect on these corrupted files :

    error while decoding MB x y, bytestream z
    Reference 2 >= 2
    top block unavailable for requested intra mode

    example FFMPEG output :

    ffmpeg version N-80901-gfebc862 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
     configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab
     libavutil      55. 28.100 / 55. 28.100
     libavcodec     57. 48.101 / 57. 48.101
     libavformat    57. 41.100 / 57. 41.100
     libavdevice    57.  0.102 / 57.  0.102
     libavfilter     6. 47.100 /  6. 47.100
     libavresample   3.  0.  0 /  3.  0.  0
     libswscale      4.  1.100 /  4.  1.100
     libswresample   2.  1.100 /  2.  1.100
     libpostproc    54.  0.100 / 54.  0.100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x36b3a80] Auto-inserting h264_mp4toannexb bitstream filter
    Input #0, concat, from 'twitter-files.txt':
     Duration: N/A, start: 0.000000, bitrate: 415 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 284 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 130 kb/s
       Metadata:
         handler_name    : SoundHandler
    [mp4 @ 0x36b7dc0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
       Last message repeated 1 times
    Output #0, mp4, to 'twitter-tmp.mp4':
     Metadata:
       encoder         : Lavf57.41.100
       Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720, q=2-31, 284 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 130 kb/s
       Metadata:
         handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3733160] Auto-inserting h264_mp4toannexb bitstream filter
       Last message repeated 1 times
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3733140] Auto-inserting h264_mp4toannexb bitstream filter
    [mp4 @ 0x36b7dc0] Packet with invalid duration -512 in stream 1
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3733140] Auto-inserting h264_mp4toannexb bitstream filter
       Last message repeated 2 times
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x36ba960] Auto-inserting h264_mp4toannexb bitstream filter
    [mp4 @ 0x36b7dc0] Packet with invalid duration -512 in stream 1
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x36ba960] Auto-inserting h264_mp4toannexb bitstream filter
       Last message repeated 4 times
    [mp4 @ 0x36b7dc0] Non-monotonous DTS in output stream 0:0; previous: 306957, current: 306445; changing to 306958. This may result in incorrect timestamps in the output file.
    [mp4 @ 0x36b7dc0] Non-monotonous DTS in output stream 0:0; previous: 306958, current: 306957; changing to 306959. This may result in incorrect timestamps in the output file.
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x36ba960] Auto-inserting h264_mp4toannexb bitstream filter
       Last message repeated 1 times
    frame=  750 fps=0.0 q=-1.0 Lsize=    1088kB time=00:00:30.04 bitrate= 296.6kbits/s speed= 366x

    OSX output :

    ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
     built with Apple LLVM version 7.3.0 (clang-703.0.31)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libvpx --enable-vda
     libavutil      55. 17.103 / 55. 17.103
     libavcodec     57. 24.102 / 57. 24.102
     libavformat    57. 25.100 / 57. 25.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 31.100 /  6. 31.100
     libavresample   3.  0.  0 /  3.  0.  0
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c49808c00] Auto-inserting h264_mp4toannexb bitstream filter
    Input #0, concat, from 'twitter-files.txt':
     Duration: N/A, start: 0.000000, bitrate: 415 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 284 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 130 kb/s
       Metadata:
         handler_name    : SoundHandler
    Output #0, mp4, to 'tmp-twitter.mp4':
     Metadata:
       encoder         : Lavf57.25.100
       Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720, q=2-31, 284 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 130 kb/s
       Metadata:
         handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c4a005400] Auto-inserting h264_mp4toannexb bitstream filter
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c4a800000] Auto-inserting h264_mp4toannexb bitstream filter
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c49800000] Auto-inserting h264_mp4toannexb bitstream filter
    [mp4 @ 0x7f9c4a000c00] Packet with invalid duration -512 in stream 1
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c49800000] Auto-inserting h264_mp4toannexb bitstream filter
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c4a800000] Auto-inserting h264_mp4toannexb bitstream filter
       Last message repeated 1 times
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c49800000] Auto-inserting h264_mp4toannexb bitstream filter
    [mp4 @ 0x7f9c4a000c00] Packet with invalid duration -512 in stream 1
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c49800000] Auto-inserting h264_mp4toannexb bitstream filter
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c4a800000] Auto-inserting h264_mp4toannexb bitstream filter
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c4a005400] Auto-inserting h264_mp4toannexb bitstream filter
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c4a800e00] Auto-inserting h264_mp4toannexb bitstream filter
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c49800000] Auto-inserting h264_mp4toannexb bitstream filter
    [mp4 @ 0x7f9c4a000c00] Non-monotonous DTS in output stream 0:0; previous: 306957, current: 306445; changing to 306958. This may result in incorrect timestamps in the output file.
    [mp4 @ 0x7f9c4a000c00] Non-monotonous DTS in output stream 0:0; previous: 306958, current: 306957; changing to 306959. This may result in incorrect timestamps in the output file.
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c49800000] Auto-inserting h264_mp4toannexb bitstream filter
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9c49010e00] Auto-inserting h264_mp4toannexb bitstream filter
    frame=  750 fps=0.0 q=-1.0 Lsize=    1146kB time=00:00:30.04 bitrate= 312.4kbits/s speed= 192x