Recherche avancée

Médias (91)

Autres articles (83)

  • 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) (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (1943)

  • Cutting with ffmpeg a video (recorded with Kodi) gives no image

    1er octobre 2017, par Laure

    I am trying to cut videos I get from a IPTV add-on in Kodi. The original video can be watched with VLC, Mplayer, xine, etc, but after being copied there is no image. According to mediainfo there is a video stream but nothing can be seen. The command I use is :

    ffmpeg -y -i test-1.mpeg  -scodec copy -vcodec copy -c:a copy -map 0 -ss 00:00:10.000 -t 00:00:10.000 test-1-cut.mpeg

    I suppose there is something wrong with the original videos recorded by Kodi, but they give no problem with any player. A short example video is this one :

    https://drive.google.com/open?id=0B0WC80aT-4WrSDNENzhxRUxkOXc

    The output with the -report option is this one :

    ffmpeg started on 2017-09-10 at 02:27:38
    Report written to "ffmpeg-20170910-022738.log"
    Command line:
    ffmpeg -y -report -i test-1.mpeg -scodec copy -vcodec copy -c:a copy -map 0 -ss 00:00:10.000 -t 00:00:10.000 test-1-cut.mpeg
    ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
     configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/i386-linux-gnu --incdir=/usr/include/i386-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enabl  libavutil      54. 31.100 / 54. 31.100
     libavcodec     56. 60.100 / 56. 60.100
     libavformat    56. 40.101 / 56. 40.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 40.101 /  5. 40.101
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  2.101 /  1.  2.101
     libpostproc    53.  3.100 / 53.  3.100
    Splitting the commandline.
    Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
    Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
    Reading option '-i' ... matched as input url with argument 'test-1.mpeg'.
    Reading option '-scodec' ... matched as option 'scodec' (force subtitle codec ('copy' to copy stream)) with argument 'copy'.
    Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'copy'.
    Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'.
    Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0'.
    Reading option '-ss' ... matched as option 'ss' (set the start time offset) with argument '00:00:10.000'.
    Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '00:00:10.000'.
    Reading option 'test-1-cut.mpeg' ... matched as output url.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option y (overwrite output files) with argument 1.
    Applying option report (generate a report) with argument 1.
    Successfully parsed a group of options.
    Parsing a group of options: input url test-1.mpeg.
    Successfully parsed a group of options.
    Opening an input file: test-1.mpeg.
    [mpegts @ 0x8292960] Format mpegts probed with size=2048 and score=100
    [mpegts @ 0x8292960] stream=0 stream_type=1b pid=65 prog_reg_desc=
    [mpegts @ 0x8292960] stream=1 stream_type=3 pid=c9 prog_reg_desc=
    [mpegts @ 0x8292960] stream=2 stream_type=3 pid=ca prog_reg_desc=
    [mpegts @ 0x8292960] stream=3 stream_type=6 pid=191 prog_reg_desc=
    [mpegts @ 0x8292960] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 14
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 14
    [h264 @ 0x8296880] Frame num gap 190 185
    [h264 @ 0x8296880] Frame num gap 190 186
    [h264 @ 0x8296880] Frame num gap 190 187
    [h264 @ 0x8296880] Frame num gap 190 188
    [h264 @ 0x8296880] mmco: unref short failure
    [h264 @ 0x8296880] no picture ooo
    [h264 @ 0x8296880] Increasing reorder buffer to 2
    [h264 @ 0x8296880] no picture ooo
    [h264 @ 0x8296880] Increasing reorder buffer to 3
    [h264 @ 0x8296880] no picture ooo
    [h264 @ 0x8296880] no picture ooo
    [h264 @ 0x8296880] no picture ooo
    [h264 @ 0x8296880] no picture ooo
    [h264 @ 0x8296880] no picture ooo
    [h264 @ 0x8296880] no picture
    [h264 @ 0x8296880] mmco: unref short failure
    [h264 @ 0x8296880] no picture
    [h264 @ 0x8296880] no picture
    [mpegts @ 0x8292960] max_analyze_duration 5000000 reached at 5000000 microseconds st:0
    [NULL @ 0x8298500] start time for stream 3 is not set in estimate_timings_from_pts
    [mpegts @ 0x8292960] PES packet size mismatch
    [mpegts @ 0x8292960] After avformat_find_stream_info() pos: 0 bytes read:4378768 seeks:2 frames:529
    Input #0, mpegts, from 'test-1.mpeg':
     Duration: 00:01:21.19, start: 74380.458944, bitrate: 6510 kb/s
     Program 3102
       Stream #0:0[0x65], 127, 1/90000: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
       Stream #0:1[0xc9](esp), 204, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
       Stream #0:2[0xca](vo), 198, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s (clean effects)
       Stream #0:3[0x191](esp), 0, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Successfully opened the file.
    Parsing a group of options: output url test-1-cut.mpeg.
    Applying option scodec (force subtitle codec ('copy' to copy stream)) with argument copy.
    Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy.
    Applying option c:a (codec name) with argument copy.
    Applying option map (set input stream mapping) with argument 0.
    Applying option ss (set the start time offset) with argument 00:00:10.000.
    Applying option t (record or transcode "duration" seconds of audio/video) with argument 00:00:10.000.
    Successfully parsed a group of options.
    Opening an output file: test-1-cut.mpeg.
    Successfully opened the file.
    [mpeg @ 0x829a0e0] VBV buffer size not set, using default size of 130KB
    If you want the mpeg file to be compliant to some specification
    Like DVD, VCD or others, make sure you set the correct buffer size
    Output #0, mpeg, to 'test-1-cut.mpeg':
     Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0, 0, 1/90000: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
       Stream #0:1(esp), 0, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 192 kb/s (clean effects)
       Stream #0:2(vo), 0, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 128 kb/s (clean effects)
       Stream #0:3(esp), 0, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
     Stream #0:2 -> #0:2 (copy)
     Stream #0:3 -> #0:3 (copy)
    Press [q] to stop, [?] for help
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 14
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 14
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 1 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 1 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 1
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 1
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 5 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 5 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 5
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 5
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 10 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 10 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 10
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 10
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 5 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 5 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 5
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 5
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 1 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 1 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 1
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 1
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 3 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 3 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 3
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 3
    frame=  231 fps=0.0 q=-1.0 size=       0kB time=00:00:10.03 bitrate=   0.0kbits/s    
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 13 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 13 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 13
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 13
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 0 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 0 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 0
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 0
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 10 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 9 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 9
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 10
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 6 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 6 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 6
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 6
    frame=  231 fps=231 q=-1.0 size=       0kB time=00:00:10.03 bitrate=   0.0kbits/s    
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 0 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 0 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 0
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 0
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 2 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 1 got 7
    [mpegts @ 0x8292960] Continuity check failed for pid 100 expected 8 got 1
    [mpegts @ 0x8292960] Continuity check failed for pid 0 expected 8 got 2
    [mpegts @ 0x8292960] PES packet size mismatch
    No more output streams to write to, finishing.
    [mpeg @ 0x829a0e0] First SCR: 0 First DTS: 45000
    frame=  231 fps=149 q=-1.0 Lsize=    7344kB time=00:00:10.03 bitrate=5995.5kbits/s    
    video:6918kB audio:391kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.483494%
    Input file #0 (test-1.mpeg):
     Input stream #0:0 (video): 2016 packets read (60807549 bytes);
     Input stream #0:1 (audio): 3360 packets read (1935360 bytes);
     Input stream #0:2 (audio): 3363 packets read (1291096 bytes);
     Input stream #0:3 (subtitle): 0 packets read (0 bytes);
     Total: 8739 packets (64034005 bytes) demuxed
    Output file #0 (test-1-cut.mpeg):
     Output stream #0:0 (video): 231 packets muxed (7083751 bytes);
     Output stream #0:1 (audio): 417 packets muxed (240192 bytes);
     Output stream #0:2 (audio): 417 packets muxed (160128 bytes);
     Output stream #0:3 (subtitle): 0 packets muxed (0 bytes);
     Total: 1065 packets (7484071 bytes) muxed
    0 frames successfully decoded, 0 decoding errors
    [AVIOContext @ 0x82f9860] Statistics: 0 seeks, 3672 writeouts
    [AVIOContext @ 0x829b1a0] Statistics: 70457008 bytes read, 2 seeks

    Following a suggestion from a comment, I have tried a static build of the last version of ffmpeg. The resulting file again has a video stream but the player cannot play it. The log is the following :

    ffmpeg started on 2017-09-18 at 00:14:22
    Report written to "ffmpeg-20170918-001422.log"
    Command line:
    ./ffmpeg -y -report -i test-1.mpeg -scodec copy -vcodec copy -c:a copy -map 0 -ss 00:00:10.000 -t 00:00:10.000 test-1-cut.mpeg
    ffmpeg version N-87286-g6ce4a635ed-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 6.4.0 (Debian 6.4.0-4) 20170820
     configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
     libavutil      55. 74.100 / 55. 74.100
     libavcodec     57.105.100 / 57.105.100
     libavformat    57. 82.100 / 57. 82.100
     libavdevice    57.  8.100 / 57.  8.100
     libavfilter     6.105.100 /  6.105.100
     libswscale      4.  7.103 /  4.  7.103
     libswresample   2.  8.100 /  2.  8.100
     libpostproc    54.  6.100 / 54.  6.100
    Splitting the commandline.
    Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
    Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
    Reading option '-i' ... matched as input url with argument 'test-1.mpeg'.
    Reading option '-scodec' ... matched as option 'scodec' (force subtitle codec ('copy' to copy stream)) with argument 'copy'.
    Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'copy'.
    Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'.
    Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0'.
    Reading option '-ss' ... matched as option 'ss' (set the start time offset) with argument '00:00:10.000'.
    Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '00:00:10.000'.
    Reading option 'test-1-cut.mpeg' ... matched as output url.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option y (overwrite output files) with argument 1.
    Applying option report (generate a report) with argument 1.
    Successfully parsed a group of options.
    Parsing a group of options: input url test-1.mpeg.
    Successfully parsed a group of options.
    Opening an input file: test-1.mpeg.
    [NULL @ 0x4e6d900] Opening 'test-1.mpeg' for reading
    [file @ 0x4e6e1a0] Setting default whitelist 'file,crypto'
    [mpegts @ 0x4e6d900] Format mpegts probed with size=2048 and score=50
    [mpegts @ 0x4e6d900] stream=0 stream_type=1b pid=65 prog_reg_desc=
    [mpegts @ 0x4e6d900] stream=1 stream_type=3 pid=c9 prog_reg_desc=
    [mpegts @ 0x4e6d900] stream=2 stream_type=3 pid=ca prog_reg_desc=
    [mpegts @ 0x4e6d900] stream=3 stream_type=6 pid=191 prog_reg_desc=
    [mpegts @ 0x4e6d900] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:4
    [mpegts @ 0x4e6d900] Continuity check failed for pid 0 expected 8 got 14
    [mpegts @ 0x4e6d900] Continuity check failed for pid 100 expected 8 got 14
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [AVBSFContext @ 0x4f23c80] nal_unit_type: 9, nal_ref_idc: 0
    [AVBSFContext @ 0x4f23c80] nal_unit_type: 7, nal_ref_idc: 3
    [AVBSFContext @ 0x4f23c80] nal_unit_type: 8, nal_ref_idc: 3
    [AVBSFContext @ 0x4f23c80] nal_unit_type: 6, nal_ref_idc: 0
    [AVBSFContext @ 0x4f23c80] nal_unit_type: 1, nal_ref_idc: 2
    [h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 7, nal_ref_idc: 3
    [h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
    [h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 2
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] Reinit context to 1920x1088, pix_fmt: yuv420p
    [h264 @ 0x4e72500] Frame num gap 190 185
    [h264 @ 0x4e72500] Frame num gap 190 186
    [h264 @ 0x4e72500] Frame num gap 190 187
    [h264 @ 0x4e72500] Frame num gap 190 188
    [h264 @ 0x4e72500] mmco: unref short failure
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 2
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] no picture ooo
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
    [h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 2
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] Increasing reorder buffer to 2
    [h264 @ 0x4e72500] no picture ooo
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
    [h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 0
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] Increasing reorder buffer to 3
    [h264 @ 0x4e72500] no picture ooo
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
    [h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 2
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] no picture ooo
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
    ................. a lot of similar lines .......................
    [h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
    [h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 2
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] nal_unit_type: 9, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
    [h264 @ 0x4e72500] nal_unit_type: 6, nal_ref_idc: 0
    [h264 @ 0x4e72500] nal_unit_type: 1, nal_ref_idc: 0
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    .......... a lot of similar lines...........
    [h264 @ 0x4e72500] ct_type:0 pic_struct:3
    [mpegts @ 0x4e6d900] max_analyze_duration 5000000 reached at 5000000 microseconds st:0
    [mpegts @ 0x4e6d900] start time for stream 3 is not set in estimate_timings_from_pts
    [mpegts @ 0x4e6d900] PES packet size mismatch
    [mpegts @ 0x4e6d900] After avformat_find_stream_info() pos: 0 bytes read:4378768 seeks:2 frames:529
    Input #0, mpegts, from 'test-1.mpeg':
     Duration: 00:01:21.19, start: 74380.458944, bitrate: 6510 kb/s
     Program 3102
       Stream #0:0[0x65], 127, 1/90000: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
       Stream #0:1[0xc9](esp), 204, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
       Stream #0:2[0xca](vo), 198, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s (clean effects)
       Stream #0:3[0x191](esp), 0, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Successfully opened the file.
    Parsing a group of options: output url test-1-cut.mpeg.
    Applying option scodec (force subtitle codec ('copy' to copy stream)) with argument copy.
    Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy.
    Applying option c:a (codec name) with argument copy.
    Applying option map (set input stream mapping) with argument 0.
    Applying option ss (set the start time offset) with argument 00:00:10.000.
    Applying option t (record or transcode "duration" seconds of audio/video) with argument 00:00:10.000.
    Successfully parsed a group of options.
    Opening an output file: test-1-cut.mpeg.
    [file @ 0x4eb6020] Setting default whitelist 'file,crypto'
    Successfully opened the file.
    [mpeg @ 0x4ea6560] VBV buffer size not set, using default size of 130KB
    If you want the mpeg file to be compliant to some specification
    Like DVD, VCD or others, make sure you set the correct buffer size
    Output #0, mpeg, to 'test-1-cut.mpeg':
     Metadata:
       encoder         : Lavf57.82.100
       Stream #0:0, 0, 1/90000: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
       Stream #0:1(esp), 0, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s (clean effects)
       Stream #0:2(vo), 0, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s (clean effects)
       Stream #0:3(esp), 0, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
     Stream #0:2 -> #0:2 (copy)
     Stream #0:3 -> #0:3 (copy)
    Press [q] to stop, [?] for help
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [NULL @ 0x4e72500] nal_unit_type: 7, nal_ref_idc: 3
    [NULL @ 0x4e72500] nal_unit_type: 8, nal_ref_idc: 3
    [mpegts @ 0x4e6d900] Continuity check failed for pid 0 expected 8 got 14
    [mpegts @ 0x4e6d900] Continuity check failed for pid 100 expected 8 got 14
    [NULL @ 0x4e72500] ct_type:0 pic_struct:3
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [NULL @ 0x4e72500] ct_type:0 pic_struct:3
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    ........... a lot of similar lines .............
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [NULL @ 0x4e72500] ct_type:0 pic_struct:3
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [mpegts @ 0x4e6d900] PES packet size mismatch
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [NULL @ 0x4e72500] ct_type:0 pic_struct:3
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    No more output streams to write to, finishing.
    [mpeg @ 0x4ea6560] First SCR: 0 First DTS: 45000
    frame=  231 fps=0.0 q=-1.0 Lsize=    7344kB time=00:00:09.99 bitrate=6019.5kbits/s speed=42.1x    
    video:6918kB audio:391kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.483494%
    Input file #0 (test-1.mpeg):
     Input stream #0:0 (video): 2016 packets read (60807549 bytes);
     Input stream #0:1 (audio): 3360 packets read (1935360 bytes);
     Input stream #0:2 (audio): 3363 packets read (1291096 bytes);
     Input stream #0:3 (subtitle): 0 packets read (0 bytes);
     Total: 8739 packets (64034005 bytes) demuxed
    Output file #0 (test-1-cut.mpeg):
     Output stream #0:0 (video): 231 packets muxed (7083751 bytes);
     Output stream #0:1 (audio): 417 packets muxed (240192 bytes);
     Output stream #0:2 (audio): 417 packets muxed (160128 bytes);
     Output stream #0:3 (subtitle): 0 packets muxed (0 bytes);
     Total: 1065 packets (7484071 bytes) muxed
    0 frames successfully decoded, 0 decoding errors
    [AVIOContext @ 0x4ef6300] Statistics: 0 seeks, 3672 writeouts
    [AVIOContext @ 0x4e6e040] Statistics: 70457008 bytes read, 2 seeks
  • FFMPEG results in a silent video when trying to combine video and audio tracks

    23 septembre 2017, par Stuart Clarke

    I’m using the following command to combine a video and an audio track.

    ffmpeg -y -i /var/www/temp/merged.mp4 -i /var/www/temp/combined.mp3 -strict -2 /var/www/temp/videoExtouiulbjryzxlehjj2.mp4

    Edit :

    Here is the output from the first command

    ffmpeg version 2.5.10-0ubuntu0.15.04.1 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
     configuration: --prefix=/usr --extra-version=0ubuntu0.15.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libwavpack --enable-libwebp --enable-libxvid --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libvpx --enable-libx264 --enable-libsoxr --enable-gnutls --enable-openal --enable-libopencv --enable-librtmp --enable-libx265
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/temp/merged.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.15.102
     Duration: 00:02:31.80, start: 0.000000, bitrate: 2384 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 2381 kb/s, 25.43 fps, 29.97 tbr, 11988 tbn, 59.94 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 0 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Input #1, mp3, from '/var/www/temp/audioTrack.mp3':
     Metadata:
       encoder         : Lavf56.15.102
     Duration: 00:02:08.94, start: 0.011995, bitrate: 128 kb/s
       Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
       Metadata:
         encoder         : Lavf
    [libx264 @ 0x1e903a0] using SAR=1/1
    [libx264 @ 0x1e903a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    [libx264 @ 0x1e903a0] profile High, level 4.0
    [libx264 @ 0x1e903a0] 264 - core 142 r2495 6a301b6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to '/var/www/temp/videoExtvzxvphotsyfpcbkd.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.15.102
       Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)
       Metadata:
         handler_name    : VideoHandler
         encoder         : Lavc56.13.100 libx264
       Stream #0:1(und): Audio: mp3 (libmp3lame) (i[0][0][0] / 0x0069), 48000 Hz, stereo, fltp (default)
       Metadata:
         handler_name    : SoundHandler
         encoder         : Lavc56.13.100 libmp3lame
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
    Press [q] to stop, [?] for help
    frame=   31 fps=0.0 q=0.0 size=       0kB time=00:00:01.05 bitrate=   0.4kbits/s dup=1 drop=0frame=   46 fps= 41 q=0.0 size=       0kB time=00:00:01.56 bitrate=   0.2kbits/s dup=1 drop=0frame=   52 fps= 32 q=29.0 size=     149kB time=00:00:01.75 bitrate= 698.4kbits/s dup=1 drop=frame=   64 fps= 28 q=29.0 size=     258kB time=00:00:02.16 bitrate= 977.2kbits/s dup=1 drop=frame=   74 fps= 26 q=29.0 size=     389kB  
    video:39673kB audio:211kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.143487%
    [libx264 @ 0x1e903a0] frame I:27    Avg QP:18.78  size: 58834
    [libx264 @ 0x1e903a0] frame P:2202  Avg QP:23.67  size: 14187
    [libx264 @ 0x1e903a0] frame B:2323  Avg QP:25.75  size:  3356
    [libx264 @ 0x1e903a0] consecutive B-frames: 24.7% 18.7%  9.0% 47.5%
    [libx264 @ 0x1e903a0] mb I  I16..4: 18.8% 74.7%  6.5%
    [libx264 @ 0x1e903a0] mb P  I16..4:  2.1%  5.0%  0.3%  P16..4: 22.2%  6.0%  1.9%  0.0%  0.0%    skip:62.5%
    [libx264 @ 0x1e903a0] mb B  I16..4:  0.1%  0.3%  0.0%  B16..8: 19.9%  1.0%  0.1%  direct: 0.3%  skip:78.3%  L0:42.3% L1:55.3% BI: 2.4%
    [libx264 @ 0x1e903a0] 8x8 transform intra:68.2% inter:86.5%
    [libx264 @ 0x1e903a0] coded y,uvDC,uvAC intra: 35.8% 52.3% 4.5% inter: 5.2% 7.4% 0.0%
    [libx264 @ 0x1e903a0] i16 v,h,dc,p: 28% 23%  8% 40%
    [libx264 @ 0x1e903a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 20% 22%  3%  6%  6%  7%  5%  4%
    [libx264 @ 0x1e903a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 21% 14%  4%  8%  7%  7%  4%  3%
    [libx264 @ 0x1e903a0] i8c dc,h,v,p: 56% 18% 20%  6%
    [libx264 @ 0x1e903a0] Weighted P-Frames: Y:0.9% UV:0.2%
    [libx264 @ 0x1e903a0] ref P L0: 73.4% 13.0% 10.0%  3.6%  0.0%
    [libx264 @ 0x1e903a0] ref B L0: 92.2%  6.7%  1.1%
    [libx264 @ 0x1e903a0] ref B L1: 96.6%  3.4%
    [libx264 @ 0x1e903a0] kb/s:2139.74

    End Edit

    I know this should work since the exact line does work for other files. But the result with these is a silent video.

    I checked the audio file being used and it seemed fine when played. but I did get a weird warning when creating it. Basically I have 2 audio tracks, one is overlay music and the other is talking. I create the combined audio with this command.

    ffmpeg -y -i /var/www/temp/audioTrack.mp3 -i /var/www/temp/musicTrack.mp3 -filter_complex amerge -c:a libmp3lame -q:a 4 /var/www/temp/combined.mp3

    Here is the output from the second command.

    ffmpeg version 2.5.10-0ubuntu0.15.04.1 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
     configuration: --prefix=/usr --extra-version=0ubuntu0.15.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libwavpack --enable-libwebp --enable-libxvid --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libvpx --enable-libx264 --enable-libsoxr --enable-gnutls --enable-openal --enable-libopencv --enable-librtmp --enable-libx265
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mp3, from '/var/www/temp/audioTrack.mp3':
     Metadata:
       encoder         : Lavf56.15.102
     Duration: 00:02:08.89, start: 0.025057, bitrate: 128 kb/s
       Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
       Metadata:
         encoder         : Lavc56.13
    Input #1, mp3, from '/var/www/temp/musicTrack.mp3':
     Metadata:
       encoder         : Lavf56.15.102
     Duration: 00:02:08.89, start: 0.025057, bitrate: 128 kb/s
       Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
       Metadata:
         encoder         : Lavc56.13
    [Parsed_amerge_0 @ 0x15e3760] No channel layout for input 1
    [Parsed_amerge_0 @ 0x15e3760] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
    Output #0, mp3, to '/var/www/temp/combined.mp3':
     Metadata:
       TSSE            : Lavf56.15.102
       Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, s16p (default)
       Metadata:
         encoder         : Lavc56.13.100 libmp3lame
    Stream mapping:
     Stream #0:0 (mp3) -> amerge:in0
     Stream #1:0 (mp3) -> amerge:in1
     amerge -> Stream #0:0 (libmp3lame)
    Press [q] to stop, [?] for help
    [libmp3lame @ 0x1601000] Trying to remove 1152 samples, but the queue is empty
    size=    2001kB time=00:02:08.88 bitrate= 127.2kbits/s    
    video:0kB audio:2001kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.012350%

    Of note is these sections (I believe).

    [Parsed_amerge_0 @ 0x15e3760] No channel layout for input 1
    [Parsed_amerge_0 @ 0x15e3760] Input channel layouts overlap: output layout will be determined by the number of distinct input channels

    and

    [libmp3lame @ 0x1601000] Trying to remove 1152 samples, but the queue is empty

    As I said the output audio file sounds correct.

    The Music and Audio tracks are created with AudioSegment in python from the pydub library. I’ve used this before with no issues. The code for this is as follows.

    sound = AudioSegment.from_mp3(audio)
    introSilence = AudioSegment.silent(duration=introLength)
    creditsSilence = AudioSegment.silent(duration=creditsLength)
    increasedAudio = sound + 12
    talking = introSilence + increasedAudio + creditsSilence
    talking.export(audioTrack, format="mp3")
    mus = AudioSegment.from_mp3(music)
    introMusic = mus[ : introLength]
    videoMusic = mus[introLength - crossFade : introLength + videoLength + crossFade]
    creditsMusic = mus[totalLength - creditsLength : totalLength]
    lowerMusic = videoMusic - 6
    totalMusic = introMusic.append(lowerMusic, crossfade=crossFade).append(creditsMusic, crossfade=crossFade).fade_out(fadeOut)
    totalMusic.export(musicTrack, format="mp3")

    Here is the output of ffprobe on the 2 audio files.

    for audioTrack

    ffprobe version 2.5.10-0ubuntu0.15.04.1 Copyright (c) 2007-2016 the FFmpeg developers
     built with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
     configuration: --prefix=/usr --extra-version=0ubuntu0.15.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libwavpack --enable-libwebp --enable-libxvid --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libvpx --enable-libx264 --enable-libsoxr --enable-gnutls --enable-openal --enable-libopencv --enable-librtmp --enable-libx265
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mp3, from 'temp/audioTrack.mp3':
     Metadata:
       encoder         : Lavf56.15.102
     Duration: 00:02:08.89, start: 0.025057, bitrate: 128 kb/s
       Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
       Metadata:
         encoder         : Lavc56.13

    and for musicTrack

    ffprobe version 2.5.10-0ubuntu0.15.04.1 Copyright (c) 2007-2016 the FFmpeg developers
     built with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
     configuration: --prefix=/usr --extra-version=0ubuntu0.15.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libwavpack --enable-libwebp --enable-libxvid --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libvpx --enable-libx264 --enable-libsoxr --enable-gnutls --enable-openal --enable-libopencv --enable-librtmp --enable-libx265
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mp3, from 'temp/musicTrack.mp3':
     Metadata:
       encoder         : Lavf56.15.102
     Duration: 00:02:08.89, start: 0.025057, bitrate: 128 kb/s
       Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
       Metadata:
         encoder         : Lavc56.13

    I can’t see any issues with these.

    For completeness here is the ffprobe result for the combined audio track.

    ffprobe version 2.5.10-0ubuntu0.15.04.1 Copyright (c) 2007-2016 the FFmpeg developers
     built with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
     configuration: --prefix=/usr --extra-version=0ubuntu0.15.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libwavpack --enable-libwebp --enable-libxvid --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libvpx --enable-libx264 --enable-libsoxr --enable-gnutls --enable-openal --enable-libopencv --enable-librtmp --enable-libx265
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mp3, from 'temp/combined.mp3':
     Metadata:
       encoder         : Lavf56.15.102
     Duration: 00:02:08.91, start: 0.025057, bitrate: 127 kb/s
       Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 127 kb/s
       Metadata:
         encoder         : Lavc56.13

    Any help would be much appreciated.

    Thanks,

    Stu.

  • FFMPEG RGB Lossless conversion video

    29 août 2017, par DCDCDC

    I have been experiencing difficulty in finding many answers with FFMPEG documentation, forums and here.
    What I am trying to do is a compress a screen capture video but with just RGB data.
    The steps I am currently taking are ;

    ffmpeg -f avfoundation -pix_fmt 0rgb -r "30" -i "1" -vcodec libx264rgb -pix_fmt rgb24 -crf 0 -t 25 -q 0 -y ~/Desktop/RGB.mkv

    south-58-45:~ danielcarter$ ffmpeg -f avfoundation -pix_fmt 0rgb -r "30" -i "1" -vcodec libx264rgb -pix_fmt rgb24 -crf 0 -t 170 -q 0 -y -v info ~/Desktop/output.mkv
    ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers
     built with Apple LLVM version 8.1.0 (clang-802.0.41)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
     libavutil      55. 58.100 / 55. 58.100
     libavcodec     57. 89.100 / 57. 89.100
     libavformat    57. 71.100 / 57. 71.100
     libavdevice    57.  6.100 / 57.  6.100
     libavfilter     6. 82.100 /  6. 82.100
     libavresample   3.  5.  0 /  3.  5.  0
     libswscale      4.  6.100 /  4.  6.100
     libswresample   2.  7.100 /  2.  7.100
     libpostproc    54.  5.100 / 54.  5.100
    [avfoundation @ 0x7fc39d004c00] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, avfoundation, from '1':
     Duration: N/A, start: 175270.249500, bitrate: N/A
       Stream #0:0: Video: rawvideo ([0]RGB / 0x42475200), 0rgb, 1440x900, 1000k tbr, 1000k tbn, 1000k tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264rgb))
    Press [q] to stop, [?] for help
    [libx264rgb @ 0x7fc39d13ea00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264rgb @ 0x7fc39d13ea00] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
    [libx264rgb @ 0x7fc39d13ea00] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=0 mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
    Output #0, matroska, to '/Users/danielcarter/Desktop/output.mkv':
     Metadata:
       encoder         : Lavf57.71.100
       Stream #0:0: Video: h264 (libx264rgb) (H264 / 0x34363248), rgb24, 1440x900, q=-1--1, 30 fps, 1k tbn, 30 tbc
       Metadata:
         encoder         : Lavc57.89.100 libx264rgb
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    frame= 5100 fps= 30 q=-1.0 Lsize=   12167kB time=00:02:49.96 bitrate= 586.4kbits/s speed=0.999x    
    video:12134kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.267659%
    [libx264rgb @ 0x7fc39d13ea00] frame I:21    Avg QP: 0.00  size:430796
    [libx264rgb @ 0x7fc39d13ea00] frame P:5079  Avg QP: 0.00  size:   665
    [libx264rgb @ 0x7fc39d13ea00] mb I  I16..4: 61.3%  0.0% 38.7%
    [libx264rgb @ 0x7fc39d13ea00] mb P  I16..4:  0.1%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:99.9%
    [libx264rgb @ 0x7fc39d13ea00] 8x8 transform intra:0.0% inter:11.2%
    [libx264rgb @ 0x7fc39d13ea00] coded y,u,v intra: 48.0% 31.6% 29.0% inter: 0.0% 0.0% 0.0%
    [libx264rgb @ 0x7fc39d13ea00] i16 v,h,dc,p: 76% 22%  2%  0%
    [libx264rgb @ 0x7fc39d13ea00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 46% 35%  7%  2%  2%  1%  1%  1%  3%
    [libx264rgb @ 0x7fc39d13ea00] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264rgb @ 0x7fc39d13ea00] ref P L0: 83.1%  6.4%  5.3%  5.2%
    [libx264rgb @ 0x7fc39d13ea00] kb/s:584.71

    This captures the screen on my mac. To the best of my knowledge, this creates a lossless file and I have compared screen shots that confirm this.
    The next step is where I think I have an issue.
    Because I want to run the compression on raw RGB data I need to convert the MKV to an RGB file ;

    ffmpeg -i ~/Desktop/RGB.mkv -c:v rawvideo -pix_fmt rgb24 -crf 0 -ss 00:00:03 -to 00:02:01 -q 0 -y ~/Desktop/out.rgb

    south-58-45:~ danielcarter$ ffmpeg -i ~/Desktop/output.mkv -c:v rawvideo -pix_fmt rgb24 -crf 0 -ss 00:00:03 -to 00:02:01 -q 0 -y ~/Desktop/out.rgb
    ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers
     built with Apple LLVM version 8.1.0 (clang-802.0.41)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
     libavutil      55. 58.100 / 55. 58.100
     libavcodec     57. 89.100 / 57. 89.100
     libavformat    57. 71.100 / 57. 71.100
     libavdevice    57.  6.100 / 57.  6.100
     libavfilter     6. 82.100 /  6. 82.100
     libavresample   3.  5.  0 /  3.  5.  0
     libswscale      4.  6.100 /  4.  6.100
     libswresample   2.  7.100 /  2.  7.100
     libpostproc    54.  5.100 / 54.  5.100
    Input #0, matroska,webm, from '/Users/danielcarter/Desktop/output.mkv':
     Metadata:
       ENCODER         : Lavf57.71.100
     Duration: 00:02:50.00, start: 0.000000, bitrate: 586 kb/s
       Stream #0:0: Video: h264 (High 4:4:4 Predictive), gbrp(tv, gbr/unknown/unknown, progressive), 1440x900, 30 fps, 30 tbr, 1k tbn, 60 tbc (default)
       Metadata:
         ENCODER         : Lavc57.89.100 libx264rgb
         DURATION        : 00:02:50.000000000
    Codec AVOption crf (Select the quality for constant quality mode) specified for output file #0 (/Users/danielcarter/Desktop/out.rgb) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
    Press [q] to stop, [?] for help
    Output #0, rawvideo, to '/Users/danielcarter/Desktop/out.rgb':
     Metadata:
       encoder         : Lavf57.71.100
       Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1440x900, q=2-31, 933120 kb/s, 30 fps, 30 tbn, 30 tbc (default)
       Metadata:
         DURATION        : 00:02:50.000000000
         encoder         : Lavc57.89.100 rawvideo
    frame= 3540 fps=111 q=-0.0 Lsize=13440938kB time=00:01:58.00 bitrate=933120.0kbits/s speed=3.68x    
    video:13440938kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

    Once I have this I can then compress and decompress successfully. I then get a working file to play back using ;

    ffmpeg -f rawvideo -vcodec rawvideo -s 1440x900 -r 30 -pix_fmt rgb24 -i ~/Desktop/out.rgb -c:v libx264rgb -pix_fmt rgb24 -x264opts keyint=300:min-keyint=300:no-scenecut -y -crf 0 ~/Desktop/rgbplay.mkv

    south-58-45:~ danielcarter$ ffmpeg -f rawvideo -vcodec rawvideo -s 1440x900 -r 30 -pix_fmt rgb24 -i ~/Desktop/out.rgb -c:v libx264rgb -pix_fmt rgb24 -x264opts keyint=300:min-keyint=300:no-scenecut -y -crf 0 ~/Desktop/rgbplay.mkv
    ffmpeg version 3.3 Copyright (c) 2000-2017 the FFmpeg developers
     built with Apple LLVM version 8.1.0 (clang-802.0.41)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
     libavutil      55. 58.100 / 55. 58.100
     libavcodec     57. 89.100 / 57. 89.100
     libavformat    57. 71.100 / 57. 71.100
     libavdevice    57.  6.100 / 57.  6.100
     libavfilter     6. 82.100 /  6. 82.100
     libavresample   3.  5.  0 /  3.  5.  0
     libswscale      4.  6.100 /  4.  6.100
     libswresample   2.  7.100 /  2.  7.100
     libpostproc    54.  5.100 / 54.  5.100
    [rawvideo @ 0x7fb1f9002600] Estimating duration from bitrate, this may be inaccurate
    Input #0, rawvideo, from '/Users/danielcarter/Desktop/out.rgb':
     Duration: 00:01:58.00, start: 0.000000, bitrate: 933120 kb/s
       Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1440x900, 933120 kb/s, 30 tbr, 30 tbn, 30 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264rgb))
    Press [q] to stop, [?] for help
    [libx264rgb @ 0x7fb1f9010c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264rgb @ 0x7fb1f9010c00] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
    [libx264rgb @ 0x7fb1f9010c00] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=0 mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=300 keyint_min=151 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=0
    Output #0, matroska, to '/Users/danielcarter/Desktop/rgbplay.mkv':
     Metadata:
       encoder         : Lavf57.71.100
       Stream #0:0: Video: h264 (libx264rgb) (H264 / 0x34363248), rgb24, 1440x900, q=-1--1, 30 fps, 1k tbn, 30 tbc
       Metadata:
         encoder         : Lavc57.89.100 libx264rgb
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    frame= 3540 fps= 64 q=-1.0 Lsize=    8319kB time=00:01:57.96 bitrate= 577.7kbits/s speed=2.13x    
    video:8297kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.273154%
    [libx264rgb @ 0x7fb1f9010c00] frame I:12    Avg QP: 0.00  size:437670
    [libx264rgb @ 0x7fb1f9010c00] frame P:3528  Avg QP: 0.00  size:   919
    [libx264rgb @ 0x7fb1f9010c00] mb I  I16..4: 61.9%  0.0% 38.1%
    [libx264rgb @ 0x7fb1f9010c00] mb P  I16..4:  0.1%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:99.8%
    [libx264rgb @ 0x7fb1f9010c00] 8x8 transform intra:0.0% inter:15.1%
    [libx264rgb @ 0x7fb1f9010c00] coded y,u,v intra: 49.7% 36.5% 33.7% inter: 0.0% 0.0% 0.0%
    [libx264rgb @ 0x7fb1f9010c00] i16 v,h,dc,p: 73% 25%  1%  0%
    [libx264rgb @ 0x7fb1f9010c00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 45% 36%  7%  2%  2%  2%  2%  1%  3%
    [libx264rgb @ 0x7fb1f9010c00] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264rgb @ 0x7fb1f9010c00] ref P L0: 81.3%  7.7%  6.7%  4.3%
    [libx264rgb @ 0x7fb1f9010c00] kb/s:575.96

    But here I have pixel variance. My guess is there is a RGB-YUV-RGB conversion happening somewhere but I am not smart enough to work out where.
    If any of you can help I would forever grateful.

    Here is a picture of the two stills side by side that shows the differences ;

    pixel difference

    If you need anything more I can post it also.
    Cheers,
    DC