[FFmpeg-trac] #2474(FFmpeg:new): MKV transcoded to MKV with copied attachments is unplayable if output is stdout

FFmpeg trac at avcodec.org
Tue Apr 16 18:38:34 CEST 2013


#2474: MKV transcoded to MKV with copied attachments is unplayable if output is
stdout
-------------------------------------+----------------------------------
             Reporter:  bubbleguuum  |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  FFmpeg       |                  Version:  1.2
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+----------------------------------
 Summary of the bug:

 A MKV that contains attachments (for example additional fonts for subs)
 that is transcoded to another MKV, copying the attachements, results in an
 unplayable file ([02189f60] mkv demux error: cannot find any cluster,
 damaged file ?) if the output specified to ffmpeg is stdout (-) instead of
 a regular file.

 If the attachements streams are omitted in the transcoded output file, the
 file is playable in both cases.

 So there seems to be a specific problem with transcoding to stdout and MKV
 attachments.


 How to reproduce:

 First, donwload this MKV containing attachments:
 http://www.auby.no/files/video_tests/h264_720p_hp_5.1_6mbps_ac3_unstyled_subs_planet.mkv



 Let's transcode it to MKV, copying the attachement streams, to a regular
 file named file1.mkv. This file is playabale.



 {{{

 $ ffmpeg -async 1 -i h264_720p_hp_5.1_6mbps_ac3_unstyled_subs_planet.mkv
 -map 0 -vf scale="trunc(oh*a/2)*2:240" -vcodec libx264 -preset medium
 -acodec libmp3lame -ac 2 -ab 128000 -f matroska file1.mkv
 ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
   built on Mar 28 2013 00:28:48 with gcc 4.8.0 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
 --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca
 --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame
 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
 --enable-libopus --enable-librtmp --enable-libschroedinger --enable-
 libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-
 libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
 --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
   libavutil      52. 18.100 / 52. 18.100
   libavcodec     54. 92.100 / 54. 92.100
   libavformat    54. 63.104 / 54. 63.104
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 42.103 /  3. 42.103
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 Input #0, matroska,webm, from
 'h264_720p_hp_5.1_6mbps_ac3_unstyled_subs_planet.mkv':
   Metadata:
     title           :
 Planet.Earth.EP01.From.Pole.to.Pole.2006.720p.HDDVD.x264-ESiR
     creation_time   : 2011-03-01 00:35:17
   Duration: 00:01:52.83, start: 0.000000, bitrate: 7066 kb/s
     Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x720, SAR 1:1 DAR
 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
     Metadata:
       title           : Planet Earth - EP01 - From Pole to Pole
     Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
 (default)
     Metadata:
       title           : AC3 5.1
     Stream #0:2(eng): Subtitle: ssa (default)
     Stream #0:3(rum): Subtitle: ssa
 Codec 0x18000 is not in the full list.
     Stream #0:4: Attachment: unknown_codec
     Metadata:
       filename        : exprswy_free.ttf
       mimetype        : application/x-truetype-font
 Codec 0x18000 is not in the full list.
     Stream #0:5: Attachment: unknown_codec
     Metadata:
       filename        : Framd.TTF
       mimetype        : application/x-truetype-font
 -async is forwarded to lavfi similarly to -af
 aresample=async=1:min_hard_comp=0.100000:first_pts=0.
 [libx264 @ 0422f380] using SAR=640/639
 [libx264 @ 0422f380] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
 [libx264 @ 0422f380] profile High, level 2.1
 [libx264 @ 0422f380] 264 - core 130 r2274 c832fe9 - H.264/MPEG-4 AVC codec
 - Copyleft 2003-2013 - 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=12
 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=23
 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, matroska, to 'file1.mkv':
   Metadata:
     title           :
 Planet.Earth.EP01.From.Pole.to.Pole.2006.720p.HDDVD.x264-ESiR
     encoder         : Lavf54.63.104
     Stream #0:0(eng): Video: h264 (H264 / 0x34363248), yuv420p, 426x240
 [SAR 640:639 DAR 16:9], q=-1--1, 1k tbn, 23.98 tbc (default)
     Metadata:
       title           : Planet Earth - EP01 - From Pole to Pole
     Stream #0:1(eng): Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo,
 fltp, 128 kb/s (default)
     Metadata:
       title           : AC3 5.1
     Stream #0:2(eng): Subtitle: ssa (default)
     Stream #0:3(rum): Subtitle: ssa
 Codec 0x18000 is not in the full list.
     Stream #0:4: Attachment: unknown_codec
     Metadata:
       filename        : exprswy_free.ttf
       mimetype        : application/x-truetype-font
 Codec 0x18000 is not in the full list.
     Stream #0:5: Attachment: unknown_codec
     Metadata:
       filename        : Framd.TTF
       mimetype        : application/x-truetype-font
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 -> libx264)
   Stream #0:1 -> #0:1 (ac3 -> libmp3lame)
   Stream #0:2 -> #0:2 (ass -> ass)
   Stream #0:3 -> #0:3 (ass -> ass)
   Stream #0:4 -> #0:4 (copy)
   Stream #0:5 -> #0:5 (copy)
 Press [q] to stop, [?] for help
 frame= 2705 fps=155 q=2686567.0 Lsize=   11312kB time=00:01:52.84 bitrate=
 821.2kbits/s
 video:9298kB audio:1764kB subtitle:2 global headers:2kB muxing overhead
 2.238986%
 [libx264 @ 0422f380] frame I:20    Avg QP:19.09  size: 15456
 [libx264 @ 0422f380] frame P:1418  Avg QP:23.83  size:  5843
 [libx264 @ 0422f380] frame B:1267  Avg QP:25.03  size:   730
 [libx264 @ 0422f380] consecutive B-frames: 29.4% 21.1% 10.3% 39.2%
 [libx264 @ 0422f380] mb I  I16..4: 39.5% 30.6% 30.0%
 [libx264 @ 0422f380] mb P  I16..4:  0.4%  0.4%  0.8%  P16..4: 26.9% 16.7%
 13.4%  0.0%  0.0%    skip:41.4%
 [libx264 @ 0422f380] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 29.4%  2.7%
 1.3%  direct: 3.2%  skip:63.4%  L0:32.1% L1:49.9% BI:18.0%
 [libx264 @ 0422f380] 8x8 transform intra:27.2% inter:46.1%
 [libx264 @ 0422f380] coded y,uvDC,uvAC intra: 64.7% 65.6% 50.9% inter:
 23.3% 12.8% 1.7%
 [libx264 @ 0422f380] i16 v,h,dc,p: 70% 10%  9% 11%
 [libx264 @ 0422f380] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 18% 19%  8%  8%
 7%  8%  8% 13%
 [libx264 @ 0422f380] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 18% 15%  9%  9%
 8% 10%  7% 13%
 [libx264 @ 0422f380] i8c dc,h,v,p: 65% 18% 11%  6%
 [libx264 @ 0422f380] Weighted P-Frames: Y:11.3% UV:0.9%
 [libx264 @ 0422f380] ref P L0: 70.0% 20.6%  5.8%  3.4%  0.2%
 [libx264 @ 0422f380] ref B L0: 87.3%  9.6%  3.1%
 [libx264 @ 0422f380] ref B L1: 87.6% 12.4%
 [libx264 @ 0422f380] kb/s:675.06
 }}}

 Now let's transcode it but specifying stdout (-) as the output and
 redirecting stdout to file2.mkv. file2.mkv is not playabale and VLC gives
 error "mkv demux error: cannot find any cluster, damaged file ?".
 Discarding the attachement streams in the resulting file would render the
 file playable.

 {{{
 $ ffmpeg -async 1 -i h264_720p_hp_5.1_6mbps_ac3_unstyled_subs_planet.mkv
 -map 0 -vf scale="trunc(oh*a/2)*2:240" -vcodec libx264 -preset medium
 -acodec libmp3lame -ac 2 -ab 128000 -f matroska - > file2.mkv
 ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
   built on Mar 28 2013 00:28:48 with gcc 4.8.0 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
 --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca
 --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame
 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
 --enable-libopus --enable-librtmp --enable-libschroedinger --enable-
 libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-
 libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
 --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
   libavutil      52. 18.100 / 52. 18.100
   libavcodec     54. 92.100 / 54. 92.100
   libavformat    54. 63.104 / 54. 63.104
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 42.103 /  3. 42.103
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 Input #0, matroska,webm, from
 'h264_720p_hp_5.1_6mbps_ac3_unstyled_subs_planet.mkv':
   Metadata:
     title           :
 Planet.Earth.EP01.From.Pole.to.Pole.2006.720p.HDDVD.x264-ESiR
     creation_time   : 2011-03-01 00:35:17
   Duration: 00:01:52.83, start: 0.000000, bitrate: 7066 kb/s
     Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x720, SAR 1:1 DAR
 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
     Metadata:
       title           : Planet Earth - EP01 - From Pole to Pole
     Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
 (default)
     Metadata:
       title           : AC3 5.1
     Stream #0:2(eng): Subtitle: ssa (default)
     Stream #0:3(rum): Subtitle: ssa
 Codec 0x18000 is not in the full list.
     Stream #0:4: Attachment: unknown_codec
     Metadata:
       filename        : exprswy_free.ttf
       mimetype        : application/x-truetype-font
 Codec 0x18000 is not in the full list.
     Stream #0:5: Attachment: unknown_codec
     Metadata:
       filename        : Framd.TTF
       mimetype        : application/x-truetype-font
 -async is forwarded to lavfi similarly to -af
 aresample=async=1:min_hard_comp=0.100000:first_pts=0.
 [libx264 @ 0433cba0] using SAR=640/639
 [libx264 @ 0433cba0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
 [libx264 @ 0433cba0] profile High, level 2.1
 [libx264 @ 0433cba0] 264 - core 130 r2274 c832fe9 - H.264/MPEG-4 AVC codec
 - Copyleft 2003-2013 - 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=12
 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=23
 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, matroska, to 'pipe:':
   Metadata:
     title           :
 Planet.Earth.EP01.From.Pole.to.Pole.2006.720p.HDDVD.x264-ESiR
     encoder         : Lavf54.63.104
     Stream #0:0(eng): Video: h264 (H264 / 0x34363248), yuv420p, 426x240
 [SAR 640:639 DAR 16:9], q=-1--1, 1k tbn, 23.98 tbc (default)
     Metadata:
       title           : Planet Earth - EP01 - From Pole to Pole
     Stream #0:1(eng): Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo,
 fltp, 128 kb/s (default)
     Metadata:
       title           : AC3 5.1
     Stream #0:2(eng): Subtitle: ssa (default)
     Stream #0:3(rum): Subtitle: ssa
 Codec 0x18000 is not in the full list.
     Stream #0:4: Attachment: unknown_codec
     Metadata:
       filename        : exprswy_free.ttf
       mimetype        : application/x-truetype-font
 Codec 0x18000 is not in the full list.
     Stream #0:5: Attachment: unknown_codec
     Metadata:
       filename        : Framd.TTF
       mimetype        : application/x-truetype-font
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 -> libx264)
   Stream #0:1 -> #0:1 (ac3 -> libmp3lame)
   Stream #0:2 -> #0:2 (ass -> ass)
   Stream #0:3 -> #0:3 (ass -> ass)
   Stream #0:4 -> #0:4 (copy)
   Stream #0:5 -> #0:5 (copy)
 Press [q] to stop, [?] for help
 frame= 2705 fps=160 q=2686567.0 Lsize=   11316kB time=00:01:52.84 bitrate=
 821.5kbits/s
 video:9298kB audio:1764kB subtitle:2 global headers:2kB muxing overhead
 2.277988%
 [libx264 @ 0433cba0] frame I:20    Avg QP:19.09  size: 15456
 [libx264 @ 0433cba0] frame P:1418  Avg QP:23.83  size:  5843
 [libx264 @ 0433cba0] frame B:1267  Avg QP:25.03  size:   730
 [libx264 @ 0433cba0] consecutive B-frames: 29.4% 21.1% 10.3% 39.2%
 [libx264 @ 0433cba0] mb I  I16..4: 39.5% 30.6% 30.0%
 [libx264 @ 0433cba0] mb P  I16..4:  0.4%  0.4%  0.8%  P16..4: 26.9% 16.7%
 13.4%  0.0%  0.0%    skip:41.4%
 [libx264 @ 0433cba0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 29.4%  2.7%
 1.3%  direct: 3.2%  skip:63.4%  L0:32.1% L1:49.9% BI:18.0%
 [libx264 @ 0433cba0] 8x8 transform intra:27.2% inter:46.1%
 [libx264 @ 0433cba0] coded y,uvDC,uvAC intra: 64.7% 65.6% 50.9% inter:
 23.3% 12.8% 1.7%
 [libx264 @ 0433cba0] i16 v,h,dc,p: 70% 10%  9% 11%
 [libx264 @ 0433cba0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 18% 19%  8%  8%
 7%  8%  8% 13%
 [libx264 @ 0433cba0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 18% 15%  9%  9%
 8% 10%  7% 13%
 [libx264 @ 0433cba0] i8c dc,h,v,p: 65% 18% 11%  6%
 [libx264 @ 0433cba0] Weighted P-Frames: Y:11.3% UV:0.9%
 [libx264 @ 0433cba0] ref P L0: 70.0% 20.6%  5.8%  3.4%  0.2%
 [libx264 @ 0433cba0] ref B L0: 87.3%  9.6%  3.1%
 [libx264 @ 0433cba0] ref B L1: 87.6% 12.4%
 [libx264 @ 0433cba0] kb/s:675.06

 }}}

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


More information about the FFmpeg-trac mailing list