Hello to all,
I’m trying to grab live channels from some source. Everything works great, deconding / encoding / deinterlacing / resizing great work NVIDIA!
I have a problem with some channels that changes the DAR/SAR during the streaming session and this causes the decoding error that kills ffmpeg. With SW transcoding this does not happen.
A work around is to put a separate ffmpeg transcoder that fixes the DAR / SAR, then sends the stream to nvdec/nvenc and then everything works, but then I have to use my CPU and limit the number of streams on my machine.
Could someone please explain to me how can I use nvenc / nvenc without these problems?
Here are the details:
1.Source stream
$ ffprobe -hide_banner -i http://1.1.1.1:8082/bysid/14003
Input #0, mpegts, from ‘http://1.1.1.1:8082/bysid/14003’:
Duration: N/A, start: 9981.400478, bitrate: 4006 kb/s
Program 14003
Stream #0:0[0xfbf]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 16:15 DAR 4:3], 3750 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:10xfc0: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 256 kb/s (clean effects)
Stream #0:20xfc1: Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
2.encoding
$ ffmpeg -threads 0 -ignore_unknown -hwaccel cuvid -c:v mpeg2_cuvid -deint 2 -drop_second_field 1 -y -nostats -nostdin -hide_banner -loglevel warning -fflags +genpts -i http://1.1.1.1:8082/bysid/14003 -metadata title=LiveChannel -sn -dn -vcodec hevc_nvenc -b:v 1M -bufsize 2M -maxrate 3M -acodec aac -preset slow -hls_flags delete_segments -hls_time 10 -hls_list_size 4 /home/streams/ LiveChannel _.m3u8
3.hvenc is working until the DAR/SAR changes on the souce channel
- souce stream - changed
$ ffprobe -hide_banner -i http://1.1.1.1:8082/bysid/14003
Input #0, mpegts, from ‘http://1.1.1.1:8082/bysid/14003’:
Duration: N/A, start: 10532.320478, bitrate: 4006 kb/s
Program 14003
Stream #0:0[0xfbf]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], 3750 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:10xfc0: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 256 kb/s (clean effects)
Stream #0:20xfc1: Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
5.decoding / encoding error
Error while decoding stream #0:1: Invalid data found when processing input
Impossible to convert between the formats supported by the filter ‘Parsed_null_0’ and the filter ‘auto_scaler_0’
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
[aac @ 0x3e63ba0] 2 frames left in the queue on closing