[FFmpeg-user] NVENC HEVC Stuttering / macroblock display issue on LG TV

Pierre-Yves Hocquellet zheer34 at gmail.com
Thu Feb 4 20:28:02 CET 2016


Hi, 

I've compiled ffmpeg with nvenc (with sdk 6.0.1) and encoded a sample movie with nvenc_hevc in .TS container (my TV only supports hevc in a TS container...). Plays fine on VLC / PC, but very poorly on that LG TV- the picture is messed up with macroblock issues all over the place and stutters. Tried with X265 with perfect output so not an issue of the TV not really supporting HEVC.

The same sample encoded with nvenc_h264 plays smoothly, no problem. although I've noticed that if I attempt to change the frame rate - r from the original, I get some of the same issues. 

Spent weeks trying to resolve / haven't found anything like this on forum and am desperate for any help ...

Things I've already tried:
- resize from 1080p to various lower sizes
- frame rate from 20 fps to 30 fps
- HEVC levels 4.1 to 5.0
- preset ultrafast
- no audio
- lower and higher bitrates 1500k to 16000k
- constant quantizer with -aq
- CRF 10 to 25 (btw that parameter doesn't seem to work)
- set GOP to 250 and tried -bf 0 to 4 (only works with 0..)
- streaming from NAS and USB key ...

I have also tried to compare the samples encoded with nvenc_hevc, nvenc_h264 and x265 using a demo version of Elecard StreamEye - there's a lot in there I'm not familiar with but one big difference between the file not working and the other two : the stream structure for the file encoded with nvenc_hevc does not contain access unit delimiters while the others have plenty (one in between each frame). I wonder if it could be a reason for my problem ... but then again maybe not. looks like the only ffmpeg option to set those applies only to libx264 (-aud)...

NVENC_HEVC stream structure:
video_parameters_set ()
seq_parameter_set()
pic_parameter_set()
slice_segment_layer() 
slice_segment_layer_rbsp() { TRAIL_R}
....
slice_segment_layer_rbsp() { TRAIL_R}

x265 stream structure: 
video_parameters_set ()
seq_parameter_set()
sei_prefix()
pic_parameter_set()
slice_segment_layer() 
access_unit_delimiter()
slice_segment_layer_rbsp() { TRAIL_R}
access_unit_delimiter()
....
access_unit_delimiter()
slice_segment_layer_rbsp() { TRAIL_R}


command line / console output:

"G:\Ubuntu\ffmpeg" -i "sample.mp4" -y -b:v 9500k -c:v nvenc_hevc -preset slow  -level 4.1 -r 24000/1001 -c:a aac -aq 128k -c:s copy   "sample.ts"
ffmpeg version N-78227-gae5b2c5 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --arch=x86_64 --target-os=mingw32 --cross-prefix=/home/zheer/Desktop/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --pkg-config=pkg-config --disable-w32threads --enable-gpl --enable-libsoxr --enable-fontconfig --enable-libass --enable-libutvideo --enable-libbluray --enable-iconv --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --enable-libvidstab --enable-libx265 --enable-decklink --extra-libs=-loleaut32 --enable-libx264 --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --enable-frei0r --enable-filter=frei0r --enable-bzlib --enable-libxavs --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-libwavpack --enable-libwebp --enable-libgme --enable-dxva2 --enable-libdcadec --enable-avisynth --enable-gray --enable-libopenh264 --extra-libs=-lpsapi --extra-cflags= --enable-static --disable-shared --prefix=/home/zheer/Desktop/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32 --enable-nonfree --enable-libfdk-aac --disable-libfaac --enable-nvenc --enable-runtime-cpudetect
  libavutil      55. 16.101 / 55. 16.101
  libavcodec     57. 24.101 / 57. 24.101
  libavformat    57. 23.101 / 57. 23.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 27.100 /  6. 27.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[h264 @ 000001aa97e504c0] sps_id 1 out of range
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : BLU-RAY 3D
    encoder         : Lavf57.20.100
  Duration: 00:01:00.00, start: 0.010000, bitrate: 43891 kb/s
    Chapter #0:0: start 0.000000, end 60.000000
    Metadata:
      title           : Chapter 02
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 39990 kb/s, 23.98 fps, 23.98 tbr, 16k tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(fra): Audio: dts (DTS-HD MA) (mp4a / 0x6134706D), 48000 Hz, 5.1(side), s32p (24 bit), max. 4486 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574), 0 kb/s
    Metadata:
      handler_name    : SubtitleHandler
Output #0, mpegts, to 'sample.ts':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : BLU-RAY 3D
    encoder         : Lavf57.23.101
    Chapter #0:0: start 0.000000, end 59.990000
    Metadata:
      title           : Chapter 02
    Stream #0:0(eng): Video: hevc (nvenc_hevc) (Main), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 9500 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.24.101 nvenc_hevc
    Side data:
      unknown side data type 10 (24 bytes)
    Stream #0:1(fra): Audio: aac (LC), 48000 Hz, 5.1(side), fltp (24 bit), 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc57.24.101 aac
    Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574), 0 kb/s
    Metadata:
      handler_name    : SubtitleHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (nvenc_hevc))
  Stream #0:1 -> #0:1 (dts (dca) -> aac (native))
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
[h264 @ 000001aa97f128e0] sps_id 1 out of range
[h264 @ 000001aa985ca860] sps_id 1 out of range
[h264 @ 000001aa97f1c700] sps_id 1 out of range00:00:02.15 bitrate=   0.0kbits/s speed=4.28x
....
[h264 @ 000001aa97f128e0] sps_id 1 out of range=00:00:57.32 bitrate=8609.9kbits/s speed=2.99x
[h264 @ 000001aa985ca860] sps_id 1 out of range=00:00:58.83 bitrate=8654.5kbits/s speed=2.99x
[h264 @ 000001aa97f1c700] sps_id 1 out of range
frame= 1417 fps= 70 q=-0.0 Lsize=   76596kB time=00:01:00.01 bitrate=10454.7kbits/s speed=2.97x
video:68842kB audio:1970kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.168465%
[aac @ 000001aa97e54ba0] Qavg: 15104392.000



More information about the ffmpeg-user mailing list