Transcoding not working on some OTA tv channels

Hello,

I'm running channels DVR on a Raspberry pi 4 with 8gb of ram. I installed the 64-bit raspberry pi os. Index of /raspios_lite_arm64/images/raspios_lite_arm64-2021-05-28

It looks like when it tries to transcode some OTA TV channels, the streaming doesn't work. This isn't every channel, but it is some very "useful" ones.

I get messages like this in the log. Any idea how to fix this?

2021/11/02 14:46:30.125509 [ENC] Encoder stopped for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-5-2603625768 after starting from 5 without encoding any segments
2021/11/02 14:46:30.129459 [ENC] Starting encoder for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-5-1436625818 at 5 (3.470467) (encoder=h264_v4l2m2m, resolution=720, deinterlacer=blend, bitrate=4300 segment_size=0.01)
2021/11/02 14:46:30.365496 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-4-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  output VIDIOC_REQBUFS failed: Invalid argument
2021/11/02 14:46:30.366068 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-4-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  no v4l2 output context's buffers
2021/11/02 14:46:30.366110 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-4-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [Parsed_scale_v4l2m2m_1 @ 0x338367e0] can't configure encoder
2021/11/02 14:46:30.366298 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-4-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [Parsed_scale_v4l2m2m_1 @ 0x338367e0] Failed to configure output pad on Parsed_scale_v4l2m2m_1
2021/11/02 14:46:30.367591 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-4-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Error reinitializing filters!
2021/11/02 14:46:30.367669 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-4-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Failed to inject frame into filter network: Inappropriate ioctl for device
2021/11/02 14:46:30.367686 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-4-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Error while processing the decoded data for stream #0:0
2021/11/02 14:46:30.369506 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-4-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [aac @ 0x33835da0] 2 frames left in the queue on closing
2021/11/02 14:46:30.369677 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-4-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [aac @ 0x33772cd0] 2 frames left in the queue on closing
2021/11/02 14:46:30.535432 [ENC] Encoder stopped for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-5-1436625818 after starting from 5 without encoding any segments. Marked segment as failed.
2021/11/02 14:46:30.701952 [HLS] ffmpeg: ch2.1-dANY-2f450bb9f55b-1-----4300-0--0-0---false-false-0.01:  [hls @ 0x248b2960] Non-monotonous DTS in output stream 0:0; previous: 937794, current: 0; changing to 937795. This may result in incorrect timestamps in the output file.
2021/11/02 14:46:31.217564 [ENC] Starting encoder for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-6-3534554302 at 6 (4.171167) (encoder=h264_v4l2m2m, resolution=720, deinterlacer=blend, bitrate=4300 segment_size=0.01)
2021/11/02 14:46:31.364663 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  output VIDIOC_REQBUFS failed: Invalid argument
2021/11/02 14:46:31.364785 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  no v4l2 output context's buffers
2021/11/02 14:46:31.364945 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [Parsed_scale_v4l2m2m_1 @ 0xa083500] can't configure encoder
2021/11/02 14:46:31.364973 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [Parsed_scale_v4l2m2m_1 @ 0xa083500] Failed to configure output pad on Parsed_scale_v4l2m2m_1
2021/11/02 14:46:31.367113 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Error reinitializing filters!
2021/11/02 14:46:31.367202 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Failed to inject frame into filter network: Inappropriate ioctl for device
2021/11/02 14:46:31.367222 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Error while processing the decoded data for stream #0:0
2021/11/02 14:46:31.392816 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [aac @ 0x9fa0e00] 2 frames left in the queue on closing
2021/11/02 14:46:31.392909 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [aac @ 0x9fa23f0] 2 frames left in the queue on closing
2021/11/02 14:46:31.532338 [ENC] Encoder stopped for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-6-3534554302 after starting from 6 without encoding any segments
2021/11/02 14:46:31.538499 [ENC] Starting encoder for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-6-4286164771 at 6 (4.171167) (encoder=h264_v4l2m2m, resolution=720, deinterlacer=blend, bitrate=4300 segment_size=0.01)
2021/11/02 14:46:31.681135 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  output VIDIOC_REQBUFS failed: Invalid argument
2021/11/02 14:46:31.681210 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  no v4l2 output context's buffers
2021/11/02 14:46:31.681245 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [Parsed_scale_v4l2m2m_1 @ 0xaffa500] can't configure encoder
2021/11/02 14:46:31.681263 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [Parsed_scale_v4l2m2m_1 @ 0xaffa500] Failed to configure output pad on Parsed_scale_v4l2m2m_1
2021/11/02 14:46:31.681588 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Error reinitializing filters!
2021/11/02 14:46:31.681629 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Failed to inject frame into filter network: Inappropriate ioctl for device
2021/11/02 14:46:31.681655 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Error while processing the decoded data for stream #0:0
2021/11/02 14:46:31.683408 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [aac @ 0xaf17e00] 2 frames left in the queue on closing
2021/11/02 14:46:31.684111 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-5-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [aac @ 0xaf193f0] 2 frames left in the queue on closing
2021/11/02 14:46:31.714155 [HLS] ffmpeg: ch2.1-dANY-2f450bb9f55b-1-----4300-0--0-0---false-false-0.01:  [hls @ 0x248b2960] Non-monotonous DTS in output stream 0:0; previous: 1027884, current: 0; changing to 1027885. This may result in incorrect timestamps in the output file.
2021/11/02 14:46:31.723338 [ENC] Encoder stopped for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-6-4286164771 after starting from 6 without encoding any segments. Marked segment as failed.
2021/11/02 14:46:32.380034 [ENC] Starting encoder for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-7-4280604282 at 7 (5.072067) (encoder=h264_v4l2m2m, resolution=720, deinterlacer=blend, bitrate=4300 segment_size=0.01)
2021/11/02 14:46:32.564182 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  output VIDIOC_REQBUFS failed: Invalid argument
2021/11/02 14:46:32.564256 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  no v4l2 output context's buffers
2021/11/02 14:46:32.564295 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [Parsed_scale_v4l2m2m_1 @ 0x3e67ed50] can't configure encoder
2021/11/02 14:46:32.564312 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [Parsed_scale_v4l2m2m_1 @ 0x3e67ed50] Failed to configure output pad on Parsed_scale_v4l2m2m_1
2021/11/02 14:46:32.566029 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Error reinitializing filters!
2021/11/02 14:46:32.566146 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Failed to inject frame into filter network: Inappropriate ioctl for device
2021/11/02 14:46:32.566213 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Error while processing the decoded data for stream #0:0
2021/11/02 14:46:32.570175 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [aac @ 0x3e5e93e0] 2 frames left in the queue on closing
2021/11/02 14:46:32.571864 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [aac @ 0x3e716350] 2 frames left in the queue on closing
2021/11/02 14:46:32.636193 [HLS] ffmpeg: ch2.1-dANY-2f450bb9f55b-1-----4300-0--0-0---false-false-0.01:  [hls @ 0x248b2960] Non-monotonous DTS in output stream 0:0; previous: 1117974, current: 0; changing to 1117975. This may result in incorrect timestamps in the output file.
2021/11/02 14:46:32.722934 [ENC] Encoder stopped for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-7-4280604282 after starting from 7 without encoding any segments
2021/11/02 14:46:32.727882 [ENC] Starting encoder for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-7-3537798348 at 7 (5.072067) (encoder=h264_v4l2m2m, resolution=720, deinterlacer=blend, bitrate=4300 segment_size=0.01)
2021/11/02 14:46:32.921160 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  output VIDIOC_REQBUFS failed: Invalid argument
2021/11/02 14:46:32.921535 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  no v4l2 output context's buffers
2021/11/02 14:46:32.923695 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [Parsed_scale_v4l2m2m_1 @ 0x25b5cd50] can't configure encoder
2021/11/02 14:46:32.923788 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [Parsed_scale_v4l2m2m_1 @ 0x25b5cd50] Failed to configure output pad on Parsed_scale_v4l2m2m_1
2021/11/02 14:46:32.924449 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Error reinitializing filters!
2021/11/02 14:46:32.924542 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Failed to inject frame into filter network: Inappropriate ioctl for device
2021/11/02 14:46:32.924563 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  Error while processing the decoded data for stream #0:0
2021/11/02 14:46:32.926136 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [aac @ 0x25ac73e0] 2 frames left in the queue on closing
2021/11/02 14:46:32.927002 [HLS] ffmpeg: ch3.1-dANY-2f450bb9f55b-6-h264-aac-copy--4300-192-720-0-0---false-false-0.01:  [aac @ 0x25bf4350] 2 frames left in the queue on closing
2021/11/02 14:46:33.124265 [ENC] Encoder stopped for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-7-3537798348 after starting from 7 without encoding any segments. Marked segment as failed.
2021/11/02 14:46:33.246040 [ENC] Starting encoder for ch3.1 in /home/pi/DVR/Streaming/ch3.1-dANY-2f450bb9f55b-3398963027/encoder-8-554639859 at 8 (6.973967) (encoder=h264_v4l2m2m, resolution=720, deinterlacer=blend, bitrate=4300 segment_size=0.01)

I've also tried DVR'ing in the channel and then playing the recording. A similar error occurs.

Any clues?

Update to prerelease

Yep… that was it.

My only complaint now is that the transcoder is just slightly slower than real-time. My video stops every 15 seconds or so for a second to catch up.

Is the “official” raspberry pi image a little faster? It’s good, but on the border of being annoying enough to be annoying.

Hmm, I tested the official image earlier this week and was seeing realtime speeds. But my test Pi wasn't doing anything, and I only clicked into a couple channels.

It's possible the latest kernel/firmware (sudo rpi-update) will help.

If you can narrow down which channels/sources are causing problems, that may help. For instance NBC and CBS are generally 1080i and the deinterlacing step can be slow. There is actually a new hardware deinterlacer on the Pi 4 that we can integrate if that's the bottleneck.

Hello, I checked and have the same results with the Raspbian 32bit image. I'm on 2021.10.25.1801 but will update to the pre-release later tonight and recheck. I don't use transcode so never checked until now.

SD channels seem to play fine, but some get a green lines across the screen. same Win10 PC, HDHR App no issues playing.
720p channels play but have the pausing as @pquack stated
1080i channels don't play back for me.
TVE channels seem to play fine.

SD Channel with green lines:

The 32-bit OS uses a different transcoder. I'm not working on improvements to that anymore. You will need a 64-bit OS for updates.

Thanks. Don't use the transcode, but will be moving back to the official image eventually.