Opened 8 years ago

Last modified 4 years ago

#5227 open defect

H265 nvenc HLS stream

Reported by: Milan Cizek Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: nvenc bounty
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Ffmpeg version: N-78351-ga25c5db (the same issue with all versions since 06/2015)
Driver version: 352.63-0ubuntu0.14.04.1 (the same issue with all versions since 06/2015)
NVAPI version: 6.0 (the same issue with 5.1)
CUDA version: 7.5-18 (the same with previous CUDA version)
GPU1: http://www.techpowerup.com/gpudb/b3164/zotac-gtx-960-amp-edition.html
GPU2: http://www.techpowerup.com/gpudb/b3346/msi-gtx-980-ti-gaming.html

Hi,

I have TV box RK3128 with Android 4.4.4, ExoPlayer 1.5.2 and I have problem with HLS (H265) playback with ExoPlayer.
My stream is played, I see/hear video and audio content.
But one of the colors in video has small offset.
Color offset is depended on video resolution.

http://download.mazana.tv/windows/h265test/01.jpg
http://download.mazana.tv/windows/h265test/02.jpg

Other H265 demos (HLS or static from internet) play correctly without described problem. Therefore I think, this it is not a hardware specific issue.

My H265 stream is created by ffmpeg and CUDA/nvenc_h265 codec. Other players (VLC, MXPlayer...) work without this problem (or does not play due H265 is not supported).
http://download.mazana.tv/windows/h265test/vlc.jpg (compare previous image with this)

When I use libx265 codec (CPU) for H265 encoding, my RK3128 box plays stream correctly.

I reproduced this issue on second GPU card, this is not GPU depended issue.

I don't know where is the problem. I understand that problem cann't be in ffmpeg but in next susspect parts (CUDA, NVAPI, drivers...). Therefore, I would be willing to give something around the $150 for a fully working solution tested with my example live streams which I can provide.

I can provide my stream URL by private. I can also provide SSH access to my dedicated streaming server with DVB-T card for any tries.

ffmpeg version N-78351-ga25c5db Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
  configuration: --prefix=/FFMPEG --pkg-config-flags=--static --bindir=/root/bin --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nvenc --enable-version3 --enable-pthreads --enable-bzlib --enable-zlib --enable-runtime-cpudetect --enable-libmfx

Change History (13)

comment:1 by Milan Cizek, 8 years ago

Keywords: hevc added

comment:2 by Milan Cizek, 8 years ago

Small inaccuracy
My H265 stream is created by ffmpeg and CUDA/nvenc_hevc codec.

comment:3 by Milan Cizek, 8 years ago

Keywords: bounty added

comment:4 by Carl Eugen Hoyos, 8 years ago

Component: ffmpegundetermined
Keywords: cuda nvapi h265 hevc bounty removed
Priority: importantnormal

Why do you think there is an issue that can be fixed within FFmpeg?

Please provide the command line that allows to reproduce the issue together with the complete, uncut console output to make this a valid ticket.

comment:5 by Carl Eugen Hoyos, 8 years ago

Keywords: bounty added

in reply to:  4 comment:6 by Milan Cizek, 8 years ago

Replying to cehoyos:

Why do you think there is an issue that can be fixed within FFmpeg?

It was written, I'm not sure where is problem (ffmpeg/CUDA/SDK/driver...). But CUDA, SDK, driver and VGA where several times changed with the same result.

Please provide the command line that allows to reproduce the issue together with the complete, uncut console output to make this a valid ticket.

# ffmpeg -i udp://@10.0.30.12:1234 -c:a copy -flags -global_header -map v:0 -c:v nvenc_hevc -b:v 4500k -vf scale=360:270 \
  -hls_time 5 -hls_list_size 6 -hls_base_url http://10.0.30.12/HLS/ -hls_flags delete_segments -hls_segment_filename '/HLS/mystream-%08d.ts' /HLS/mystream.m3u8

ffmpeg version N-78351-ga25c5db Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
  configuration: --prefix=/FFMPEG --pkg-config-flags=--static --bindir=/root/bin --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nvenc --enable-version3 --enable-pthreads --enable-bzlib --enable-zlib --enable-runtime-cpudetect --enable-libmfx
  libavutil      55. 17.100 / 55. 17.100
  libavcodec     57. 24.101 / 57. 24.101
  libavformat    57. 24.101 / 57. 24.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 30.100 /  6. 30.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[h264 @ 0x2da8ea0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x2da8ea0] decode_slice_header error
[h264 @ 0x2da8ea0] no frame!
[h264 @ 0x2da8ea0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x2da8ea0] decode_slice_header error
[h264 @ 0x2da8ea0] no frame!
[h264 @ 0x2da8ea0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x2da8ea0] decode_slice_header error
[h264 @ 0x2da8ea0] no frame!
[h264 @ 0x2da8ea0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x2da8ea0] decode_slice_header error
[h264 @ 0x2da8ea0] no frame!
Input #0, mpegts, from 'udp://@10.0.30.12:1234':
  Duration: N/A, start: 76572.946900, bitrate: N/A
  Program 261
    Stream #0:0[0x7d1]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x7d2](cze): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2[0x7d4](cze): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, mono, s16p, 64 kb/s (visual impaired)
    Stream #0:3[0x7d6](cze): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) (hearing impaired)
Output #0, hls, to '/HLS/mystream.m3u8':
  Metadata:
    encoder         : Lavf57.24.101
    Stream #0:0: Video: hevc (nvenc_hevc) (Main), yuv420p, 360x270 [SAR 4:3 DAR 16:9], q=-1--1, 4500 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.24.101 nvenc_hevc
    Side data:
      unknown side data type 10 (24 bytes)
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (nvenc_hevc))
Press [q] to stop, [?] for help
frame=  459 fps= 36 q=-0.0 Lsize=N/A time=00:00:18.36 bitrate=N/A dup=15 drop=0 speed=1.42x
video:1392kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

...no errors...

comment:7 by Carl Eugen Hoyos, 8 years ago

Is hls format needed to reproduce the issue or is also reproducible with mpegts output?

comment:8 by Milan Cizek, 8 years ago

I tried it as mpegts output and the result is also corrupted on RK3128 (as HLS).
But on my phone HTC M9 with Android 5.1 plays without errors. I can provide RK3128 also for debug.

ffmpeg -i udp://@10.0.30.12:1234 -c:a copy -flags -global_header -t 60 -map v:0 -c:v nvenc_hevc -b:v 4500k -vf scale=360:270 -f mpegts /test.mp4

Result is here: ​http://download.mazana.tv/windows/testH265.mp4

comment:9 by Milan Cizek, 8 years ago

I tried it as mpegts output and the result is also corrupted on RK3128 (as HLS).
But on my phone HTC M9 with Android 5.1 plays without errors. I can provide RK3128 also for debug.

ffmpeg -i udp://@10.0.30.12:1234 -c:a copy -flags -global_header -t 60 -map v:0 -c:v nvenc_hevc -b:v 4500k -vf scale=360:270 -f mpegts /test.mp4

Result is here: ​http://download.mazana.tv/windows/testH265.mp4

comment:10 by Facundo, 7 years ago

Hey i have a similar issue. Did you found a solution?
My stream plays on my iphone but on a STB doesn't work.
No clue what to do.

comment:11 by Milan Cizek, 7 years ago

Yes we solved it. It depends on video resolution.
The width of video must be divisible only by 16 (not 32 or 64).
The height of video must be divisible minimal 32 (can be 64 or more).

Example:
1904x1088 is OK, 1888x1056 is OK

Try it. Good luck.

comment:12 by Balling, 4 years ago

Status: newopen

Well, obviously! nvenc has this strange problem while encoding. HW. Not the first time. Though we should always tell about that when we use nvenc, right?

comment:13 by hydra3333, 4 years ago

+1

Note: See TracTickets for help on using tickets.