[FFmpeg-user] h264 mkvs fail on TV/gigablue after conversion

Frank Steiner fsteiner-mail1 at bio.ifi.lmu.de
Mon Jul 24 11:29:18 EEST 2017


Hi,

I just realized that all movies that I converted down to 720p using h264 codec don't play neither on my TV nor my Gigablue Quad box, but work fine with mplayer/mpv/xine on my Linux system. On the TV/gigablue the video stream freezes after 2-3 seconds while the audio continues to play. It doesn't matter what kind of input codec I have.

I could track the problem down to a small test video. The input file is in h264 format already, and after converting the "ffmpeg -i" output looks absolutely the same, apart from the bitrate. So the TV/Gigablue are able to play h264 streams, but when I convert it with ffmpeg sth. must be changed that I can't figure out (and so don't know how to avoid it).

Below is the output of the conversion command. The two files can be downloaded from https://www.bio.ifi.lmu.de/~steiner/test_works.mkv (18 MB) and https://www.bio.ifi.lmu.de/~steiner/test_fails.mkv (8.9MB) in case you want to take a look at them.

Do you have any idea what could go wrong here? What I could change in converting to avoid that little "whatever" that disturbs the (obviously older) codecs on my TV and the Gigablye box? What kind of problem could cause the video stream to freeze?

cu,
Frank


ffmpeg -i test_works.mkv -c:v libx264 -preset veryslow -crf 20 -tune filme -c:a copy -c:s copy test_fails.mkv
ffmpeg version 3.2.6 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8 (SUSE Linux)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -g' --optflags='-fmessage-length=0 -grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl --enable-avresample --enable-libcdio --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libfreetype --enable-libgsm --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-netcdf --enable-vaapi --enable-vdpau --enable-libfdk_aac --enable-nonfree --enable-libmp3lame 
--enable-libtwolame --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, matroska,webm, from 'test_works.mkv':
  Metadata:
    ENCODER         : Lavf57.56.101
  Duration: 00:00:15.19, start: 0.000000, bitrate: 9400 kb/s
    Chapter #0:0: start 0.000000, end 123.540000
    Metadata:
      title           : 00:00:00.000
    Chapter #0:1: start 123.540000, end 264.139000
    Metadata:
      title           : 00:02:03.540
    Chapter #0:2: start 264.139000, end 437.312000
    Metadata:
      title           : 00:04:24.139
    Chapter #0:3: start 437.312000, end 650.984000
    Metadata:
      title           : 00:07:17.312
    Chapter #0:4: start 650.984000, end 814.397000
    Metadata:
      title           : 00:10:50.984
    Chapter #0:5: start 814.397000, end 952.827000
    Metadata:
      title           : 00:13:34.397
    Chapter #0:6: start 952.827000, end 1144.894000
    Metadata:
      title           : 00:15:52.827
    Chapter #0:7: start 1144.894000, end 1362.611000
    Metadata:
      title           : 00:19:04.894
    Chapter #0:8: start 1362.611000, end 1484.191000
    Metadata:
      title           : 00:22:42.611
    Chapter #0:9: start 1484.191000, end 1604.394000
    Metadata:
      title           : 00:24:44.191
    Chapter #0:10: start 1604.394000, end 1764.513000
    Metadata:
      title           : 00:26:44.394
    Chapter #0:11: start 1764.513000, end 1983.773000
    Metadata:
      title           : 00:29:24.513
    Chapter #0:12: start 1983.773000, end 2098.346000
    Metadata:
      title           : 00:33:03.773
    Chapter #0:13: start 2098.346000, end 2196.444000
    Metadata:
      title           : 00:34:58.346
    Chapter #0:14: start 2196.444000, end 2463.336000
    Metadata:
      title           : 00:36:36.444
    Chapter #0:15: start 2463.336000, end 2755.044000
    Metadata:
      title           : 00:41:03.336
    Chapter #0:16: start 2755.044000, end 2993.199000
    Metadata:
      title           : 00:45:55.044
    Chapter #0:17: start 2993.199000, end 3222.344000
    Metadata:
      title           : 00:49:53.199
    Chapter #0:18: start 3222.344000, end 3549.004000
    Metadata:
      title           : 00:53:42.344
    Chapter #0:19: start 3549.004000, end 3662.993000
    Metadata:
      title           : 00:59:09.004
    Chapter #0:20: start 3662.993000, end 3879.876000
    Metadata:
      title           : 01:01:02.993
    Chapter #0:21: start 3879.876000, end 4014.761000
    Metadata:
      title           : 01:04:39.876
    Chapter #0:22: start 4014.761000, end 4344.632000
    Metadata:
      title           : 01:06:54.761
    Chapter #0:23: start 4344.632000, end 4572.902000
    Metadata:
      title           : 01:12:24.632
    Chapter #0:24: start 4572.902000, end 4740.235000
    Metadata:
      title           : 01:16:12.902
    Chapter #0:25: start 4740.235000, end 4884.213000
    Metadata:
      title           : 01:19:00.235
    Chapter #0:26: start 4884.213000, end 5019.765000
    Metadata:
      title           : 01:21:24.213
    Chapter #0:27: start 5019.765000, end 5387.691000
    Metadata:
      title           : 01:23:39.765
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1044, SAR 1:1 DAR 160:87, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Metadata:
      DURATION        : 00:00:15.186000000
    Stream #0:1(ger): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      title           : german dts
      ENCODER         : Lavc57.64.101 ac3
      DURATION        : 00:00:15.004000000
    Stream #0:2(ger): Subtitle: subrip (default)
    Metadata:
      title           : german forced
      DURATION        : 00:00:00.000000000
[libx264 @ 0x12cdca0] using SAR=1/1
[libx264 @ 0x12cdca0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x12cdca0] profile High, level 5.1
[libx264 @ 0x12cdca0] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=16 deblock=1:-1:-1 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.15 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-3 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=8 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'test_fails.mkv':
  Metadata:
    encoder         : Lavf57.56.101
    Chapter #0:0: start 0.000000, end 123.540000
    Metadata:
      title           : 00:00:00.000
    Chapter #0:1: start 123.540000, end 264.139000
    Metadata:
      title           : 00:02:03.540
    Chapter #0:2: start 264.139000, end 437.312000
    Metadata:
      title           : 00:04:24.139
    Chapter #0:3: start 437.312000, end 650.984000
    Metadata:
      title           : 00:07:17.312
    Chapter #0:4: start 650.984000, end 814.397000
    Metadata:
      title           : 00:10:50.984
    Chapter #0:5: start 814.397000, end 952.827000
    Metadata:
      title           : 00:13:34.397
    Chapter #0:6: start 952.827000, end 1144.894000
    Metadata:
      title           : 00:15:52.827
    Chapter #0:7: start 1144.894000, end 1362.611000
    Metadata:
      title           : 00:19:04.894
    Chapter #0:8: start 1362.611000, end 1484.191000
    Metadata:
      title           : 00:22:42.611
    Chapter #0:9: start 1484.191000, end 1604.394000
    Metadata:
      title           : 00:24:44.191
    Chapter #0:10: start 1604.394000, end 1764.513000
    Metadata:
      title           : 00:26:44.394
    Chapter #0:11: start 1764.513000, end 1983.773000
    Metadata:
      title           : 00:29:24.513
    Chapter #0:12: start 1983.773000, end 2098.346000
    Metadata:
      title           : 00:33:03.773
    Chapter #0:13: start 2098.346000, end 2196.444000
    Metadata:
      title           : 00:34:58.346
    Chapter #0:14: start 2196.444000, end 2463.336000
    Metadata:
      title           : 00:36:36.444
    Chapter #0:15: start 2463.336000, end 2755.044000
    Metadata:
      title           : 00:41:03.336
    Chapter #0:16: start 2755.044000, end 2993.199000
    Metadata:
      title           : 00:45:55.044
    Chapter #0:17: start 2993.199000, end 3222.344000
    Metadata:
      title           : 00:49:53.199
    Chapter #0:18: start 3222.344000, end 3549.004000
    Metadata:
      title           : 00:53:42.344
    Chapter #0:19: start 3549.004000, end 3662.993000
    Metadata:
      title           : 00:59:09.004
    Chapter #0:20: start 3662.993000, end 3879.876000
    Metadata:
      title           : 01:01:02.993
    Chapter #0:21: start 3879.876000, end 4014.761000
    Metadata:
      title           : 01:04:39.876
    Chapter #0:22: start 4014.761000, end 4344.632000
    Metadata:
      title           : 01:06:54.761
    Chapter #0:23: start 4344.632000, end 4572.902000
    Metadata:
      title           : 01:12:24.632
    Chapter #0:24: start 4572.902000, end 4740.235000
    Metadata:
      title           : 01:16:12.902
    Chapter #0:25: start 4740.235000, end 4884.213000
    Metadata:
      title           : 01:19:00.235
    Chapter #0:26: start 4884.213000, end 5019.765000
    Metadata:
      title           : 01:21:24.213
    Chapter #0:27: start 5019.765000, end 5387.691000
    Metadata:
      title           : 01:23:39.765
    Stream #0:0(eng): Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 1920x1044 [SAR 1:1 DAR 160:87], q=-1--1, 23.98 fps, 1k tbn, 23.98 tbc
    Metadata:
      DURATION        : 00:00:15.186000000
      encoder         : Lavc57.64.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(ger): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), 448 kb/s (default)
    Metadata:
      title           : german dts
      ENCODER         : Lavc57.64.101 ac3
      DURATION        : 00:00:15.004000000
    Stream #0:2(ger): Subtitle: subrip (default)
    Metadata:
      title           : german forced
      DURATION        : 00:00:00.000000000
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame=  362 fps=5.5 q=-1.0 Lsize=    9089kB time=00:00:14.97 bitrate=4972.7kbits/s speed=0.229x    
video:8260kB audio:821kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.097370%
[libx264 @ 0x12cdca0] frame I:2     Avg QP:12.62  size:130658
[libx264 @ 0x12cdca0] frame P:100   Avg QP:19.30  size: 49601
[libx264 @ 0x12cdca0] frame B:260   Avg QP:22.38  size: 12446
[libx264 @ 0x12cdca0] consecutive B-frames:  5.0%  8.8% 25.7%  9.9%  2.8% 33.1%  0.0%  2.2% 12.4%
[libx264 @ 0x12cdca0] mb I  I16..4: 56.5% 28.0% 15.5%
[libx264 @ 0x12cdca0] mb P  I16..4:  7.5% 18.6%  1.7%  P16..4: 37.7% 12.7%  6.7%  0.4%  0.1%    skip:14.6%
[libx264 @ 0x12cdca0] mb B  I16..4:  0.9%  1.2%  0.1%  B16..8: 39.1%  4.6%  1.0%  direct: 2.4%  skip:50.6%  L0:39.2% L1:51.0% BI: 9.8%
[libx264 @ 0x12cdca0] 8x8 transform intra:62.6% inter:54.7%
[libx264 @ 0x12cdca0] direct mvs  spatial:96.9% temporal:3.1%
[libx264 @ 0x12cdca0] coded y,uvDC,uvAC intra: 33.5% 56.2% 25.1% inter: 8.7% 14.5% 2.0%
[libx264 @ 0x12cdca0] i16 v,h,dc,p: 27% 16% 10% 47%
[libx264 @ 0x12cdca0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 10% 28%  7%  7%  5%  8%  6%  9%
[libx264 @ 0x12cdca0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 17% 13%  9% 10%  7% 10%  7% 12%
[libx264 @ 0x12cdca0] i8c dc,h,v,p: 50% 29% 14%  7%
[libx264 @ 0x12cdca0] Weighted P-Frames: Y:2.0% UV:2.0%
[libx264 @ 0x12cdca0] ref P L0: 62.3% 16.9% 11.0%  3.4%  1.9%  1.3%  1.0%  0.5%  0.4%  0.3%  0.2%  0.2%  0.2%  0.2%  0.2%  0.1%
[libx264 @ 0x12cdca0] ref B L0: 88.0%  7.8%  1.9%  0.7%  0.4%  0.3%  0.2%  0.2%  0.1%  0.1%  0.1%  0.1%  0.1%  0.1%  0.0%
[libx264 @ 0x12cdca0] ref B L1: 98.3%  1.7%
[libx264 @ 0x12cdca0] kb/s:4432.25



-- 
Dipl.-Inform. Frank Steiner   Web:  http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik    Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17           Phone: +49 89 2180-4049
80333 Muenchen, Germany       Fax:   +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *


More information about the ffmpeg-user mailing list