Opened 5 years ago

Closed 5 years ago

#7984 closed defect (invalid)

4.1.2 creates unreadable videos in Samsung TV

Reported by: mucikiki Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: libx264
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: version 4.1.2 introduces some changes, now Samsung TVs cannot play video. Appears error "Video data not supported"

How to reproduce:

% ffmpeg  -i input -c:v libx264 -profile:v main -level:v 3.1 -crf 24 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -y output
ffmpeg version 4.1.2
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)

I tried with Mac version, but also Linux version. 4.1.1 works fine, but 4.1.2 change something (maybe some deprecated command, or a difference). FFPROBE shows no differences, and I have no error in log.

Change History (11)

comment:1 by Carl Eugen Hoyos, 5 years ago

Component: ffmpegundetermined
Keywords: 4.1.2 video data not supported in Samsung TVs removed
Version: 4.1unspecified

Please test current FFmpeg git head and provide the command line you tested together with the complete, uncut console output to make this a valid ticket.

comment:2 by mucikiki, 5 years ago

Ok, I tested the current snapshot build (ffmpeg-94144-g034b72fc0b), the problem is the same.

My commando is:

ffmpeg -i input -c:v libx264 -profile:v main -level:v 3.1 -crf 24 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -y output

console output:

ffmpeg version N-94144-g034b72fc0b-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      56. 30.100 / 56. 30.100
  libavcodec     58. 53.100 / 58. 53.100
  libavformat    58. 28.101 / 58. 28.101
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 55.100 /  7. 55.100
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/macbook/Dropbox/FFMPEG FUNZIONANTE - 23 luglio 2018 - N-46494/video di esempio SVIZZERA/xxx.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2019-06-26T18:14:05.000000Z
  Duration: 00:01:36.15, start: 0.000000, bitrate: 2677 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 2479 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 60k tbc (default)
    Metadata:
      creation_time   : 2019-06-26T18:14:06.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      creation_time   : 2019-06-26T18:14:06.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x7fcd41800000] using SAR=1/1
[libx264 @ 0x7fcd41800000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fcd41800000] profile Main, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x7fcd41800000] 264 - core 157 r2969 d4099dd - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 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=24.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/Users/macbook/Dropbox/FFMPEG FUNZIONANTE - 23 luglio 2018 - N-46494/video di esempio SVIZZERA/xxx-COMPRESSA.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    encoder         : Lavf58.28.101
    Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)
    Metadata:
      creation_time   : 2019-06-26T18:14:06.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      encoder         : Lavc58.53.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2019-06-26T18:14:06.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
      encoder         : Lavc58.53.100 aac
frame= 2880 fps=136 q=-1.0 Lsize=   10268kB time=00:01:36.10 bitrate= 875.2kbits/s speed=4.52x    
video:8653kB audio:1510kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.023622%
[libx264 @ 0x7fcd41800000] frame I:15    Avg QP:14.82  size: 41071
[libx264 @ 0x7fcd41800000] frame P:1107  Avg QP:21.23  size:  5989
[libx264 @ 0x7fcd41800000] frame B:1758  Avg QP:22.99  size:   918
[libx264 @ 0x7fcd41800000] consecutive B-frames:  2.5% 46.5%  5.1% 45.8%
[libx264 @ 0x7fcd41800000] mb I  I16..4: 65.9%  0.0% 34.1%
[libx264 @ 0x7fcd41800000] mb P  I16..4:  4.2%  0.0%  1.0%  P16..4: 21.8%  4.7%  3.3%  0.0%  0.0%    skip:65.0%
[libx264 @ 0x7fcd41800000] mb B  I16..4:  0.2%  0.0%  0.1%  B16..8: 16.3%  0.6%  0.1%  direct: 0.5%  skip:82.2%  L0:33.8% L1:63.5% BI: 2.8%
[libx264 @ 0x7fcd41800000] coded y,uvDC,uvAC intra: 19.3% 28.5% 9.3% inter: 2.4% 3.1% 0.2%
[libx264 @ 0x7fcd41800000] i16 v,h,dc,p: 58% 25%  9%  8%
[libx264 @ 0x7fcd41800000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 26% 23%  4%  4%  4%  4%  3%  4%
[libx264 @ 0x7fcd41800000] i8c dc,h,v,p: 67% 19% 12%  2%
[libx264 @ 0x7fcd41800000] Weighted P-Frames: Y:2.3% UV:1.5%
[libx264 @ 0x7fcd41800000] ref P L0: 73.9% 10.1% 11.8%  4.2%  0.1%
[libx264 @ 0x7fcd41800000] ref B L0: 88.6% 10.2%  1.2%
[libx264 @ 0x7fcd41800000] ref B L1: 97.7%  2.3%
[libx264 @ 0x7fcd41800000] kb/s:737.63
[aac @ 0x7fcd41801800] Qavg: 384.685
Last edited 5 years ago by Carl Eugen Hoyos (previous) (diff)

comment:3 by Carl Eugen Hoyos, 5 years ago

Is the issue also reproducible if you use -f lavfi -i testsrc2=s=hd720:d=90 as input?

Last edited 5 years ago by Carl Eugen Hoyos (previous) (diff)

comment:4 by mucikiki, 5 years ago

I tried, but Samsung TV says "Audio codec not supported". Maybe I need to specify some audio options in the ffmpeg command?

comment:5 by Carl Eugen Hoyos, 5 years ago

Try with -f lavfi -i testsrc2=s=hd720:d=90 -f lavfi -i sine=d=90

comment:6 by mucikiki, 5 years ago

Ok, audio error has gone away.

I confirm you that I have the same "Video data not supported" error message.

So, I send you 3 video examples obtained from your command, maybe you cand find the difference between them (I tried with FFPROBE but with no success):

Video created with ffmpeg 4.1.1 (it works):
https://www.dropbox.com/s/04vf10d1u23vdy8/xxx-4.1.1.mp4?dl=1

Video created with ffmpeg 4.1.2 (it DOESN'T works):
https://www.dropbox.com/s/wm16k3sxflr52ow/xxx-4.1.2.mp4?dl=1

Video created with ffmpeg 94144 (it DOESN'T works):
https://www.dropbox.com/s/mzrv7gqwsdptio8/xxx-latest-ffmpeg%2094144.mp4?dl=1

comment:7 by Carl Eugen Hoyos, 5 years ago

Keywords: libx264 added

This looks like an x264 (or Samsung) issue, you will have to compile yourself to verify.

These are the commits in FFmpeg before 4.1.2, none should affect the command line I suggested:
http://git.videolan.org/?p=ffmpeg.git;a=shortlog;h=a7cb7a2e

comment:8 by Carl Eugen Hoyos, 5 years ago

These are the x264 version strings (remaining parts are identical):
x264 - core 157 r2935 545de2f - H.264/MPEG-4 AVC codec - Copyleft 2003-2018
x264 - core 157 r2969 d4099dd - H.264/MPEG-4 AVC codec - Copyleft 2003-2019

comment:9 by mucikiki, 5 years ago

I found the solution:

in ffmpeg 4.1.1, if I use "-profile:v main -level 3.1" everything was ok.

in ffmpeg 4.1.2 (and newer), if I want the same behaviour, I NEED di specify "-profile:v baseline -level 3.1"

It seems that since 4.1.2 something changed in what is MAIN and what is BASELINE. Is it possible in your opinion? Now that I modified my code using BASELINE instead of MAIN, everything is ok. Maybe after x264-r2935-545de2f they used a different version of the H.264/AVC standard? So now there is a "new" baseline, instead of the "old" baseline?

comment:10 by mucikiki, 5 years ago

Typing error:

of course, it's not "-level 3.1", but "-level:v 3.1"

comment:11 by James, 5 years ago

Resolution: invalid
Status: newclosed

This is a known issue introduced to libx264 by https://code.videolan.org/videolan/x264/commit/92d36908cbafd2a6edf7e61d69f341027b57f6f8. It's not a bug in the library but rather a bug in Samsung TVs and other hardware decoders that wrongly bail out when a bitstream value they are supposed to ignore is set to a value other than 0.

It was nonetheless reverted by https://code.videolan.org/videolan/x264/commit/f9af2a0f71d0fca7c1cafa7657f03a302da0ca1c as the amount of faulty devices is considerable, and there's no guarantee they'd get a firmware fix.

Update your libx264 and recompile ffmpeg with it.

Note: See TracTickets for help on using tickets.