[FFmpeg-trac] #4591(avformat:new): attachments mjpeg are discovered wrongly as video stream and therefore h264 encoding is broken

FFmpeg trac at avcodec.org
Thu Jun 4 06:24:34 CEST 2015


#4591: attachments mjpeg are discovered wrongly as video stream and therefore h264
encoding is broken
-------------------------------------+-------------------------------------
             Reporter:  TheoMeister  |                     Type:  defect
               Status:  new          |                 Priority:  important
            Component:  avformat     |                  Version:
             Keywords:  attachments  |               Blocked By:
  video                              |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug: Encoding with libx264 broken since
 https://github.com/FFmpeg/FFmpeg/commit/511585ce7f7272e5069ef011d6be5f073d268901
 - reverting this patch makes it working again as before as the attachments
 are just copied and not h264 encoded (which is not desired).

 How to reproduce: Take the sample
 https://sourceforge.net/projects/matroska/files/test_files/cover_art.mkv
 and issue the following command:

 {{{
 % ffmpeg -i cover_art.mkv -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4
 -map 0:5 -c:a copy -c:s copy -c:t copy -c:v libx264 -profile:v high -level
 4.1 cover_art.mkv

 ffmpeg version 2.6.3 Copyright (c) 2000-2015 the FFmpeg developers
   built with gcc 4.8 (SUSE Linux)
   configuration: --shlibdir=/usr/lib64 --prefix=/usr
 --mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared --disable-
 static --enable-debug --disable-stripping --extra-cflags='-fmessage-
 length=0 -grecord-gcc-switches -fstack-protector -O2 -Wall
 -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -g'
 --enable-pic --optflags='-fmessage-length=0 -grecord-gcc-switches -fstack-
 protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-
 unwind-tables -g' --enable-gpl --enable-x11grab --enable-version3
 --enable-pthreads --datadir=/usr/share/ffmpeg --enable-avfilter --enable-
 libpulse --enable-libwebp --enable-libvpx --enable-libopus --enable-
 libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex
 --enable-libxvid --enable-libx264 --enable-libx265 --enable-
 libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-
 libopencore-amrwb --enable-postproc --enable-libdc1394 --enable-librtmp
 --enable-libfreetype --enable-avresample --enable-libtwolame --enable-
 libvo-aacenc --enable-gnutls --enable-libass --enable-frei0r --enable-
 libcelt --enable-libcdio --enable-ladspa
   libavutil      54. 20.100 / 54. 20.100
   libavcodec     56. 26.100 / 56. 26.100
   libavformat    56. 25.101 / 56. 25.101
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 11.102 /  5. 11.102
   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, matroska,webm, from 'cover_art.mkv':
   Metadata:
     encoder         : libebml2 v0.12.1 + libmatroska2 v0.11.1
     creation_time   : 2010-09-23 19:01:57
     SAMPLE/TITLE    : Trailer
     COPYRIGHT       : ShowTime
     COPYRIGHT/URL   : http://www.sho.com/
     track           : 5
     DATE_RELEASE    : 2010
     SAMPLE/PART_NUMBER: 0
     TITLE           : Dexter Season 5 trailer
     ORIGINAL/URL    : http://www.youtube.com/watch?v=CUbCMbW-BRE
   Duration: 00:02:36.00, start: 0.000000, bitrate: 2024 kb/s
     Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp (default)
     Stream #0:1: Video: h264 (High), yuv420p, 1272x720 [SAR 1:1 DAR
 53:30], 24 fps, 24 tbr, 1k tbn, 48 tbc (default)
     Stream #0:2: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown),
 600x882 [SAR 300:300 DAR 100:147], 90k tbr, 90k tbn, 90k tbc
     Metadata:
       filename        : cover.jpg
       mimetype        : image/jpeg
     Stream #0:3: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown),
 120x176 [SAR 300:300 DAR 15:22], 90k tbr, 90k tbn, 90k tbc
     Metadata:
       filename        : small_cover.jpg
       mimetype        : image/jpeg
     Stream #0:4: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown),
 1067x600 [SAR 96:96 DAR 1067:600], 90k tbr, 90k tbn, 90k tbc
     Metadata:
       filename        : cover_land.jpg
       mimetype        : image/jpeg
     Stream #0:5: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown),
 213x120 [SAR 96:96 DAR 71:40], 90k tbr, 90k tbn, 90k tbc
     Metadata:
       filename        : small_cover_land.jpg
       mimetype        : image/jpeg
 No pixel format specified, yuvj444p for H.264 encoding chosen.
 Use -pix_fmt yuv420p for compatibility with outdated media players.
     Last message repeated 3 times
 [libx264 @ 0x137bbe0] using SAR=1/1
 [libx264 @ 0x137bbe0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
 [libx264 @ 0x137bbe0] profile High, level 4.1
 [libx264 @ 0x137bbe0] 264 - core 142 - 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=24
 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
 x264 [error]: high profile doesn't support 4:4:4
 [libx264 @ 0x1373060] Error setting profile high.
 [libx264 @ 0x1373060] Possible profiles: baseline main high high10 high422
 high444
 Output #0, matroska, to '/tmp/cover_art1.mkv':
   Metadata:
     encoder         : libebml2 v0.12.1 + libmatroska2 v0.11.1
     ORIGINAL/URL    : http://www.youtube.com/watch?v=CUbCMbW-BRE
     SAMPLE/TITLE    : Trailer
     COPYRIGHT       : ShowTime
     COPYRIGHT/URL   : http://www.sho.com/
     track           : 5
     DATE_RELEASE    : 2010
     SAMPLE/PART_NUMBER: 0
     TITLE           : Dexter Season 5 trailer
     Stream #0:0: Audio: aac, 44100 Hz, stereo (default)
     Stream #0:1: Video: h264 (libx264), yuv420p, 1272x720 [SAR 1:1 DAR
 53:30], q=-1--1, 24 fps, 24 tbn, 24 tbc (default)
     Metadata:
       encoder         : Lavc56.26.100 libx264
     Stream #0:2: Video: h264, none, q=2-31, 128 kb/s, SAR 300:300 DAR 0:0,
 90k fps
     Metadata:
       filename        : cover.jpg
       mimetype        : image/jpeg
       encoder         : Lavc56.26.100 libx264
     Stream #0:3: Video: h264, none, q=2-31, 128 kb/s, SAR 300:300 DAR 0:0,
 90k fps
     Metadata:
       filename        : small_cover.jpg
       mimetype        : image/jpeg
       encoder         : Lavc56.26.100 libx264
     Stream #0:4: Video: h264, none, q=2-31, 128 kb/s, SAR 96:96 DAR 0:0,
 90k fps
     Metadata:
       filename        : cover_land.jpg
       mimetype        : image/jpeg
       encoder         : Lavc56.26.100 libx264
     Stream #0:5: Video: h264, none, q=2-31, 128 kb/s, SAR 96:96 DAR 0:0,
 90k fps
     Metadata:
       filename        : small_cover_land.jpg
       mimetype        : image/jpeg
       encoder         : Lavc56.26.100 libx264
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (h264 (native) -> h264 (libx264))
   Stream #0:2 -> #0:2 (mjpeg (native) -> h264 (libx264))
   Stream #0:3 -> #0:3 (mjpeg (native) -> h264 (libx264))
   Stream #0:4 -> #0:4 (mjpeg (native) -> h264 (libx264))
   Stream #0:5 -> #0:5 (mjpeg (native) -> h264 (libx264))
 Error while opening encoder for output stream #0:2 - maybe incorrect
 parameters such as bit_rate, rate, width or height
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4591>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list