Hardware decode not working from HDHomerun

I'm using docker and it works for most streams, but sometimes I get these errors:

2025/03/19 15:05:03.772386 [HLS] Starting live stream for channel 28.1 from 172.30.0.22 (bitrate=11846kbps)
2025/03/19 15:05:04.392987 [HLS] Probed live stream in 620.54129ms: mpeg2video 1280x720 progressive 8656763bps
2025/03/19 15:05:05.747606 [HLS] Session ch28.1-dANY-1033c586e61f started in 1.975105815s
2025/03/19 15:05:05.753310 [ENC] Starting encoder for ch28.1 in /shares/DVR/Streaming/ch28.1-dANY-1033c586e61f-2789480807/encoder-1-124602694 at 1 (0.791878) (encoder=h264_nvenc, codec=h264, acodec=aac, resolution=720, deinterlacer=hardware, bitrate=9488, segment_size=0.01)
2025/03/19 15:05:06.087059 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: [mpeg2video @ 0x7745b40] No decoder surfaces left
2025/03/19 15:05:06.087088 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Error while decoding stream #0:0: Cannot allocate memory
2025/03/19 15:05:06.089131 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: [mpeg2video @ 0x7745b40] No decoder surfaces left
2025/03/19 15:05:06.089144 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Error while decoding stream #0:0: Cannot allocate memory
2025/03/19 15:05:06.092997 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: [mpeg2video @ 0x7745b40] No decoder surfaces left
2025/03/19 15:05:06.093010 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Error while decoding stream #0:0: Cannot allocate memory
2025/03/19 15:05:06.094213 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Failed to negotiate pixel format between 'Parsed_scale_cuda_1' and 'auto_scale_0':
2025/03/19 15:05:06.094225 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↑ cuda
2025/03/19 15:05:06.094228 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Parsed_scale_cuda_1 (scale_cuda) [requires cuda]
2025/03/19 15:05:06.094232 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↓ cuda
2025/03/19 15:05:06.094235 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: :warning: hwdownload needed :warning:
2025/03/19 15:05:06.094238 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↑ yuv420p, yuyv422, rgb24 (+179 more)
2025/03/19 15:05:06.094241 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: auto_scale_0 (scale)
2025/03/19 15:05:06.094244 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↓ yuv420p, yuyv422, rgb24 (+168 more)
2025/03/19 15:05:06.094264 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↑ yuv420p, yuyv422, rgb24 (+179 more)
2025/03/19 15:05:06.094266 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: scaler_out_0_0 (scale)
2025/03/19 15:05:06.094268 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↓ yuv420p, yuyv422, rgb24 (+168 more)
2025/03/19 15:05:06.094270 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: :warning: hwupload needed :warning:
2025/03/19 15:05:06.094272 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↑ cuda
2025/03/19 15:05:06.094274 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: format
2025/03/19 15:05:06.094276 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↓ cuda
2025/03/19 15:05:06.094278 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↑ cuda
2025/03/19 15:05:06.094280 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: out_0_0 (buffersink)
2025/03/19 15:05:06.094284 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Impossible to convert between the formats supported by the filter 'Parsed_scale_cuda_1' and the filter 'auto_scale_0'
2025/03/19 15:05:06.094388 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Error reinitializing filters!
2025/03/19 15:05:06.094402 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Failed to inject frame into filter network: Function not implemented
2025/03/19 15:05:06.094403 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Error while processing the decoded data for stream #0:0
2025/03/19 15:05:06.179146 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: [aac @ 0x77484c0] 2 frames left in the queue on closing
2025/03/19 15:05:06.179248 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: [aac @ 0x7743f80] 2 frames left in the queue on closing
2025/03/19 15:05:06.372480 [ENC] Encoder stopped for ch28.1 in /shares/DVR/Streaming/ch28.1-dANY-1033c586e61f-2789480807/encoder-1-124602694 after starting from 1 without encoding any segments
2025/03/19 15:05:06.373932 [ENC] Starting encoder for ch28.1 in /shares/DVR/Streaming/ch28.1-dANY-1033c586e61f-2789480807/encoder-1-1434813583 at 1 (0.791878) (encoder=h264_nvenc, codec=h264, acodec=aac, resolution=720, deinterlacer=hardware, bitrate=9488, segment_size=0.01)
2025/03/19 15:05:06.652160 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: [mpeg2video @ 0x5a93b40] No decoder surfaces left
2025/03/19 15:05:06.652184 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Error while decoding stream #0:0: Cannot allocate memory
2025/03/19 15:05:06.655911 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: [mpeg2video @ 0x5a93b40] No decoder surfaces left
2025/03/19 15:05:06.655920 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Error while decoding stream #0:0: Cannot allocate memory
2025/03/19 15:05:06.660044 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: [mpeg2video @ 0x5a93b40] No decoder surfaces left
2025/03/19 15:05:06.660060 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Error while decoding stream #0:0: Cannot allocate memory
2025/03/19 15:05:06.661595 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Failed to negotiate pixel format between 'Parsed_scale_cuda_1' and 'auto_scale_0':
2025/03/19 15:05:06.661608 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↑ cuda
2025/03/19 15:05:06.661610 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Parsed_scale_cuda_1 (scale_cuda) [requires cuda]
2025/03/19 15:05:06.661611 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↓ cuda
2025/03/19 15:05:06.661613 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: :warning: hwdownload needed :warning:
2025/03/19 15:05:06.661614 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↑ yuv420p, yuyv422, rgb24 (+179 more)
2025/03/19 15:05:06.661616 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: auto_scale_0 (scale)
2025/03/19 15:05:06.661617 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↓ yuv420p, yuyv422, rgb24 (+168 more)
2025/03/19 15:05:06.661618 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↑ yuv420p, yuyv422, rgb24 (+179 more)
2025/03/19 15:05:06.661619 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: scaler_out_0_0 (scale)
2025/03/19 15:05:06.661620 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↓ yuv420p, yuyv422, rgb24 (+168 more)
2025/03/19 15:05:06.661621 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: :warning: hwupload needed :warning:
2025/03/19 15:05:06.661622 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↑ cuda
2025/03/19 15:05:06.661624 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: format
2025/03/19 15:05:06.661625 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↓ cuda
2025/03/19 15:05:06.661626 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: ↑ cuda
2025/03/19 15:05:06.661627 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: out_0_0 (buffersink)
2025/03/19 15:05:06.661630 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Impossible to convert between the formats supported by the filter 'Parsed_scale_cuda_1' and the filter 'auto_scale_0'
2025/03/19 15:05:06.661788 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Error reinitializing filters!
2025/03/19 15:05:06.661791 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Failed to inject frame into filter network: Function not implemented
2025/03/19 15:05:06.661799 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: Error while processing the decoded data for stream #0:0
2025/03/19 15:05:06.750772 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: [aac @ 0x5a964c0] 2 frames left in the queue on closing
2025/03/19 15:05:06.750906 [HLS] ffmpeg: ch28.1-dANY-1033c586e61f-1-h264-aac---9488-256-720-6-0--hardware-false-false-0.01-0: [aac @ 0x5a91f80] 2 frames left in the queue on closing
2025/03/19 15:05:06.972774 [ENC] Encoder stopped for ch28.1 in /shares/DVR/Streaming/ch28.1-dANY-1033c586e61f-2789480807/encoder-1-1434813583 after starting from 1 without encoding any segments. Marked segment as failed.

This obviously doesn't fix the transcoder issue, but have you thought about just running with original quality so that the stream is unmodified?

Checking this out. Please submit diagnostics from the DVR if you have a chance.

Logs have been submitted as 8dc64f71-5751-4110-9a21-bd24844e7692 .

Thanks for the diagnostics. Checking it out.

@ehosch could you update to the latest DVR pre-release and see if it's any better?

2 Likes

That worked! Do I have to do that every time my docker container restarts?

1 Like

NO The container is automatically updated when you update to pre-release.