Open arkanoid87 opened 1 year ago
Forum thread too - https://forums.raspberrypi.com/viewtopic.php?t=347942. Being able to reproduce with videotestsrc is going to be of more use than libcamerasrc.
Could you enable the firmware side asserts using start_debug=1
in config.txt, and reading out the log after the lockup with https://github.com/raspberrypi/utils/tree/master/vclog and sudo vclog --assert
? (vclog replaces vcdbg and can work on 64bit userland). Also worth checking sudo vclog --msg
.
There is a known issue with the H264 encoder that if rate control overshoots and ends up dropping the last frame of the encode, then it doesn't clean up properly. Only 2Mbit/s for a 1080p30 encode is pretty optimistic.
CABAC is incompatible with CBR because of the way the encoder is pipelined. Drop to the baseline profile and it works.
I'll have a look at why this isn't validated when the encoder starts, as that can through an error to make the pipeline fail cleanly.
I used this pipeline (1080p / main / CBR):
gst-launch-1.0 -vvvv videotestsrc pattern=ball ! video/x-raw,width=1920,height=1080,framerate=25/1 ! v4l2convert ! v4l2h264enc extra-controls="controls,repeat_sequence_header=1,video_bitrate_mode=1,h264_profile=2,video_bitrate=5000000" ! 'video/x-h264,profile=main,level=(string)4' ! fakesink
Could you enable the firmware side asserts using start_debug=1 in config.txt, and reading out the log after the lockup with https://github.com/raspberrypi/utils/tree/master/vclog and sudo vclog --assert? (vclog replaces vcdbg and can work on 64bit userland). Also worth checking sudo vclog --msg.
Both sudo vclog --assert
and sudo vclog --msg
show no output after running the above pipeline.
However, using raspinfo
, in the "demsg log" section was the following snippet:
[ 94.631011] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 94.631039] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Failed disabling i/p port, ret -62
[ 96.710986] bcm2835-codec bcm2835-codec: bcm2835_codec_flush_buffers: Timeout waiting for buffers to be returned - 2 outstanding
[ 96.711025] ------------[ cut here ]------------
[ 96.711038] WARNING: CPU: 2 PID: 964 at drivers/media/common/videobuf2/videobuf2-core.c:1995 __vb2_queue_cancel+0x1e0/0x258 [videobuf2_common]
[ 96.711137] Modules linked in: xt_MASQUERADE xt_mark nft_compat nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_counter nf_tables cmac algif_hash aes_arm_bs crypto_simd cryptd algif_skcipher af_alg bnep hci_uart btbcm bluetooth ecdh_generic ecc nfnetlink tun imx219 8021q garp stp llc brcmfmac brcmutil sha256_generic cfg80211 i2c_mux_pinctrl i2c_mux raspberrypi_hwmon rfkill bcm2835_isp(C) snd_bcm2835(C) bcm2835_unicam v4l2_dv_timings bcm2835_codec(C) v4l2_fwnode snd_pcm bcm2835_v4l2(C) v4l2_async v4l2_mem2mem videobuf2_vmalloc bcm2835_mmal_vchiq(C) videobuf2_dma_contig videobuf2_memops snd_timer videobuf2_v4l2 videobuf2_common snd videodev vc_sm_cma(C) i2c_bcm2835 mc uio_pdrv_genirq fixed uio drm fuse drm_panel_orientation_quirks backlight ip_tables x_tables ipv6
[ 96.711931] CPU: 2 PID: 964 Comm: gst-launch-1.0 Tainted: G C 5.15.84-v7+ #1613
[ 96.711948] Hardware name: BCM2835
[ 96.711957] Backtrace:
[ 96.711970] [<80a47ec8>] (dump_backtrace) from [<80a48110>] (show_stack+0x20/0x24)
[ 96.712009] r7:000007cb r6:80d19fc0 r5:00000000 r4:60000013
[ 96.712017] [<80a480f0>] (show_stack) from [<80a4c6dc>] (dump_stack_lvl+0x70/0x94)
[ 96.712048] [<80a4c66c>] (dump_stack_lvl) from [<80a4c718>] (dump_stack+0x18/0x1c)
[ 96.712084] r7:000007cb r6:00000009 r5:7f20268c r4:7f208064
[ 96.712091] [<80a4c700>] (dump_stack) from [<80120b30>] (__warn+0xfc/0x114)
[ 96.712121] [<80120a34>] (__warn) from [<80a486c8>] (warn_slowpath_fmt+0x70/0xd8)
[ 96.712152] r7:000007cb r6:7f208064 r5:81005008 r4:00000000
[ 96.712160] [<80a4865c>] (warn_slowpath_fmt) from [<7f20268c>] (__vb2_queue_cancel+0x1e0/0x258 [videobuf2_common])
[ 96.712255] r9:81415bd0 r8:00000001 r7:7f1b0140 r6:8bc29978 r5:8bc29978 r4:8bc29978
[ 96.712264] [<7f2024ac>] (__vb2_queue_cancel [videobuf2_common]) from [<7f203668>] (vb2_core_streamoff+0x28/0xbc [videobuf2_common])
[ 96.712411] r10:7f22d90c r9:81415bd0 r8:00000001 r7:7f1b0140 r6:0000000a r5:8bc29978
[ 96.712422] r4:8bc29978 r3:0000000a
[ 96.712429] [<7f203640>] (vb2_core_streamoff [videobuf2_common]) from [<7f0980f0>] (vb2_streamoff+0x24/0x64 [videobuf2_v4l2])
[ 96.712549] r5:8bc29978 r4:8bc29800
[ 96.712557] [<7f0980cc>] (vb2_streamoff [videobuf2_v4l2]) from [<7f260c3c>] (v4l2_m2m_streamoff+0x40/0x10c [v4l2_mem2mem])
[ 96.712659] [<7f260bfc>] (v4l2_m2m_streamoff [v4l2_mem2mem]) from [<7f260d28>] (v4l2_m2m_ioctl_streamoff+0x20/0x24 [v4l2_mem2mem])
[ 96.712770] r10:7f22d90c r9:81415bd0 r8:00000001 r7:7f1b0140 r6:81005008 r5:40045613
[ 96.712780] r4:7f260d08
[ 96.712787] [<7f260d08>] (v4l2_m2m_ioctl_streamoff [v4l2_mem2mem]) from [<7f1b016c>] (v4l_streamoff+0x2c/0x30 [videodev])
[ 96.713072] [<7f1b0140>] (v4l_streamoff [videodev]) from [<7f1b5470>] (__video_do_ioctl+0x234/0x460 [videodev])
[ 96.713508] r5:40045613 r4:814158a0
[ 96.713516] [<7f1b523c>] (__video_do_ioctl [videodev]) from [<7f1b5c30>] (video_usercopy+0x140/0x630 [videodev])
[ 96.713955] r10:00000000 r9:00000000 r8:87c09e34 r7:00000000 r6:81005008 r5:40045613
[ 96.713965] r4:40045613
[ 96.713973] [<7f1b5af0>] (video_usercopy [videodev]) from [<7f1b6140>] (video_ioctl2+0x20/0x24 [videodev])
[ 96.714413] r10:0000001a r9:0212ec08 r8:83c7eb40 r7:00000000 r6:76543844 r5:81005008
[ 96.714423] r4:7f1b6120
[ 96.714430] [<7f1b6120>] (video_ioctl2 [videodev]) from [<7f1ae1f4>] (v4l2_ioctl+0x4c/0x60 [videodev])
[ 96.714860] [<7f1ae1a8>] (v4l2_ioctl [videodev]) from [<80366908>] (sys_ioctl+0x12c/0xa20)
[ 96.715095] r5:81005008 r4:40045613
[ 96.715103] [<803667dc>] (sys_ioctl) from [<80100040>] (ret_fast_syscall+0x0/0x1c)
[ 96.715131] Exception stack(0x87c09fa8 to 0x87c09ff0)
[ 96.715149] 9fa0: 0215b0e0 76543000 0000001a 40045613 0212ec08 76b3ed40
[ 96.715167] 9fc0: 0215b0e0 76543000 76543844 00000036 75a0ff30 766fba30 01f6df18 0215625c
[ 96.715181] 9fe0: 76d68c88 7e94ecb4 76508264 76b3ed4c
[ 96.715198] r10:00000036 r9:87c08000 r8:80100244 r7:00000036 r6:76543844 r5:76543000
[ 96.715207] r4:0215b0e0
[ 96.715215] ---[ end trace 0b47d1b1d2e2b573 ]---
[ 96.715232] videobuf2_common: driver bug: stop_streaming operation is leaving buf 9ebdb769 in active state
[ 96.715257] videobuf2_common: driver bug: stop_streaming operation is leaving buf 147080e6 in active state
[ 99.750959] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 99.750989] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Failed disabling o/p port, ret -62
[ 101.830940] bcm2835-codec bcm2835-codec: bcm2835_codec_flush_buffers: Timeout waiting for buffers to be returned - 4 outstanding
[ 104.871087] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 104.871114] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Failed enabling component, ret -62
[ 104.871136] ------------[ cut here ]------------
[ 104.871149] WARNING: CPU: 2 PID: 964 at drivers/media/common/videobuf2/videobuf2-core.c:1995 __vb2_queue_cancel+0x1e0/0x258 [videobuf2_common]
[ 104.871248] Modules linked in: xt_MASQUERADE xt_mark nft_compat nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_counter nf_tables cmac algif_hash aes_arm_bs crypto_simd cryptd algif_skcipher af_alg bnep hci_uart btbcm bluetooth ecdh_generic ecc nfnetlink tun imx219 8021q garp stp llc brcmfmac brcmutil sha256_generic cfg80211 i2c_mux_pinctrl i2c_mux raspberrypi_hwmon rfkill bcm2835_isp(C) snd_bcm2835(C) bcm2835_unicam v4l2_dv_timings bcm2835_codec(C) v4l2_fwnode snd_pcm bcm2835_v4l2(C) v4l2_async v4l2_mem2mem videobuf2_vmalloc bcm2835_mmal_vchiq(C) videobuf2_dma_contig videobuf2_memops snd_timer videobuf2_v4l2 videobuf2_common snd videodev vc_sm_cma(C) i2c_bcm2835 mc uio_pdrv_genirq fixed uio drm fuse drm_panel_orientation_quirks backlight ip_tables x_tables ipv6
[ 104.872038] CPU: 2 PID: 964 Comm: gst-launch-1.0 Tainted: G WC 5.15.84-v7+ #1613
[ 104.872055] Hardware name: BCM2835
[ 104.872064] Backtrace:
[ 104.872077] [<80a47ec8>] (dump_backtrace) from [<80a48110>] (show_stack+0x20/0x24)
[ 104.872117] r7:000007cb r6:80d19fc0 r5:00000000 r4:60000013
[ 104.872125] [<80a480f0>] (show_stack) from [<80a4c6dc>] (dump_stack_lvl+0x70/0x94)
[ 104.872155] [<80a4c66c>] (dump_stack_lvl) from [<80a4c718>] (dump_stack+0x18/0x1c)
[ 104.872191] r7:000007cb r6:00000009 r5:7f20268c r4:7f208064
[ 104.872198] [<80a4c700>] (dump_stack) from [<80120b30>] (__warn+0xfc/0x114)
[ 104.872228] [<80120a34>] (__warn) from [<80a486c8>] (warn_slowpath_fmt+0x70/0xd8)
[ 104.872259] r7:000007cb r6:7f208064 r5:81005008 r4:00000000
[ 104.872266] [<80a4865c>] (warn_slowpath_fmt) from [<7f20268c>] (__vb2_queue_cancel+0x1e0/0x258 [videobuf2_common])
[ 104.872361] r9:81415bd0 r8:00000001 r7:7f1b0140 r6:8bc29814 r5:8bc29814 r4:8bc29814
[ 104.872369] [<7f2024ac>] (__vb2_queue_cancel [videobuf2_common]) from [<7f203668>] (vb2_core_streamoff+0x28/0xbc [videobuf2_common])
[ 104.872516] r10:7f22d90c r9:81415bd0 r8:00000001 r7:7f1b0140 r6:00000009 r5:8bc29814
[ 104.872527] r4:8bc29814 r3:00000009
[ 104.872534] [<7f203640>] (vb2_core_streamoff [videobuf2_common]) from [<7f0980f0>] (vb2_streamoff+0x24/0x64 [videobuf2_v4l2])
[ 104.872656] r5:8bc29814 r4:8bc29800
[ 104.872664] [<7f0980cc>] (vb2_streamoff [videobuf2_v4l2]) from [<7f260c3c>] (v4l2_m2m_streamoff+0x40/0x10c [v4l2_mem2mem])
[ 104.872765] [<7f260bfc>] (v4l2_m2m_streamoff [v4l2_mem2mem]) from [<7f260d28>] (v4l2_m2m_ioctl_streamoff+0x20/0x24 [v4l2_mem2mem])
[ 104.872876] r10:7f22d90c r9:81415bd0 r8:00000001 r7:7f1b0140 r6:81005008 r5:40045613
[ 104.872886] r4:7f260d08
[ 104.872893] [<7f260d08>] (v4l2_m2m_ioctl_streamoff [v4l2_mem2mem]) from [<7f1b016c>] (v4l_streamoff+0x2c/0x30 [videodev])
[ 104.873175] [<7f1b0140>] (v4l_streamoff [videodev]) from [<7f1b5470>] (__video_do_ioctl+0x234/0x460 [videodev])
[ 104.873609] r5:40045613 r4:814158a0
[ 104.873617] [<7f1b523c>] (__video_do_ioctl [videodev]) from [<7f1b5c30>] (video_usercopy+0x140/0x630 [videodev])
[ 104.874058] r10:00000000 r9:00000000 r8:87c09e34 r7:00000000 r6:81005008 r5:40045613
[ 104.874067] r4:40045613
[ 104.874074] [<7f1b5af0>] (video_usercopy [videodev]) from [<7f1b6140>] (video_ioctl2+0x20/0x24 [videodev])
[ 104.874511] r10:00000015 r9:0212df08 r8:83c7eb40 r7:00000000 r6:76543844 r5:81005008
[ 104.874521] r4:7f1b6120
[ 104.874528] [<7f1b6120>] (video_ioctl2 [videodev]) from [<7f1ae1f4>] (v4l2_ioctl+0x4c/0x60 [videodev])
[ 104.874961] [<7f1ae1a8>] (v4l2_ioctl [videodev]) from [<80366908>] (sys_ioctl+0x12c/0xa20)
[ 104.875198] r5:81005008 r4:40045613
[ 104.875206] [<803667dc>] (sys_ioctl) from [<80100040>] (ret_fast_syscall+0x0/0x1c)
[ 104.875234] Exception stack(0x87c09fa8 to 0x87c09ff0)
[ 104.875252] 9fa0: 0215aeb0 76543000 00000015 40045613 0212df08 76b3ed40
[ 104.875270] 9fc0: 0215aeb0 76543000 76543844 00000036 75a0ff30 766fba30 01f6df18 0215625c
[ 104.875284] 9fe0: 76c45c58 7e94ecb4 76508264 76b3ed4c
[ 104.875301] r10:00000036 r9:87c08000 r8:80100244 r7:00000036 r6:76543844 r5:76543000
[ 104.875311] r4:0215aeb0
[ 104.875320] ---[ end trace 0b47d1b1d2e2b574 ]---
[ 104.875335] videobuf2_common: driver bug: stop_streaming operation is leaving buf 7d41fbf6 in active state
[ 104.875358] videobuf2_common: driver bug: stop_streaming operation is leaving buf d6b5e2dc in active state
[ 104.875378] videobuf2_common: driver bug: stop_streaming operation is leaving buf 1dae005b in active state
[ 104.875396] videobuf2_common: driver bug: stop_streaming operation is leaving buf c55b39dc in active state
[ 107.910903] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 110.950920] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 113.990894] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 113.990925] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Failed disabling o/p port, ret -62
[ 116.070871] bcm2835-codec bcm2835-codec: bcm2835_codec_flush_buffers: Timeout waiting for buffers to be returned - 2 outstanding
[ 116.070905] ------------[ cut here ]------------
[ 116.070918] WARNING: CPU: 2 PID: 964 at drivers/media/common/videobuf2/videobuf2-core.c:1995 __vb2_queue_cancel+0x1e0/0x258 [videobuf2_common]
[ 116.071019] Modules linked in: xt_MASQUERADE xt_mark nft_compat nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_counter nf_tables cmac algif_hash aes_arm_bs crypto_simd cryptd algif_skcipher af_alg bnep hci_uart btbcm bluetooth ecdh_generic ecc nfnetlink tun imx219 8021q garp stp llc brcmfmac brcmutil sha256_generic cfg80211 i2c_mux_pinctrl i2c_mux raspberrypi_hwmon rfkill bcm2835_isp(C) snd_bcm2835(C) bcm2835_unicam v4l2_dv_timings bcm2835_codec(C) v4l2_fwnode snd_pcm bcm2835_v4l2(C) v4l2_async v4l2_mem2mem videobuf2_vmalloc bcm2835_mmal_vchiq(C) videobuf2_dma_contig videobuf2_memops snd_timer videobuf2_v4l2 videobuf2_common snd videodev vc_sm_cma(C) i2c_bcm2835 mc uio_pdrv_genirq fixed uio drm fuse drm_panel_orientation_quirks backlight ip_tables x_tables ipv6
[ 116.071812] CPU: 2 PID: 964 Comm: gst-launch-1.0 Tainted: G WC 5.15.84-v7+ #1613
[ 116.071829] Hardware name: BCM2835
[ 116.071840] Backtrace:
[ 116.071853] [<80a47ec8>] (dump_backtrace) from [<80a48110>] (show_stack+0x20/0x24)
[ 116.071894] r7:000007cb r6:80d19fc0 r5:00000000 r4:60000013
[ 116.071902] [<80a480f0>] (show_stack) from [<80a4c6dc>] (dump_stack_lvl+0x70/0x94)
[ 116.071932] [<80a4c66c>] (dump_stack_lvl) from [<80a4c718>] (dump_stack+0x18/0x1c)
[ 116.071967] r7:000007cb r6:00000009 r5:7f20268c r4:7f208064
[ 116.071975] [<80a4c700>] (dump_stack) from [<80120b30>] (__warn+0xfc/0x114)
[ 116.072004] [<80120a34>] (__warn) from [<80a486c8>] (warn_slowpath_fmt+0x70/0xd8)
[ 116.072034] r7:000007cb r6:7f208064 r5:81005008 r4:00000000
[ 116.072042] [<80a4865c>] (warn_slowpath_fmt) from [<7f20268c>] (__vb2_queue_cancel+0x1e0/0x258 [videobuf2_common])
[ 116.072137] r9:00000000 r8:823d8aa0 r7:824c50d0 r6:8bc28014 r5:8bc28074 r4:8bc28014
[ 116.072146] [<7f2024ac>] (__vb2_queue_cancel [videobuf2_common]) from [<7f204cf0>] (vb2_core_queue_release+0x28/0x48 [videobuf2_common])
[ 116.072293] r10:85e81500 r9:00000000 r8:823d8aa0 r7:824c50d0 r6:814163d0 r5:8bc28074
[ 116.072304] r4:8bc28014 r3:977f7b4c
[ 116.072311] [<7f204cc8>] (vb2_core_queue_release [videobuf2_common]) from [<7f09662c>] (vb2_queue_release+0x18/0x1c [videobuf2_v4l2])
[ 116.072433] r5:86b16000 r4:8bc28000
[ 116.072440] [<7f096614>] (vb2_queue_release [videobuf2_v4l2]) from [<7f261314>] (v4l2_m2m_ctx_release+0x24/0x38 [v4l2_mem2mem])
[ 116.072542] [<7f2612f0>] (v4l2_m2m_ctx_release [v4l2_mem2mem]) from [<7f228e24>] (bcm2835_codec_release+0x7c/0xc8 [bcm2835_codec])
[ 116.072640] r5:86b16000 r4:81416040
[ 116.072648] [<7f228da8>] (bcm2835_codec_release [bcm2835_codec]) from [<7f1ae6f0>] (v4l2_release+0xd8/0xe4 [videodev])
[ 116.072925] r7:824c50d0 r6:83f607d8 r5:83c7e300 r4:814160a0
[ 116.072933] [<7f1ae618>] (v4l2_release [videodev]) from [<80350874>] (__fput+0x8c/0x274)
[ 116.073165] r5:000e001f r4:83c7e300
[ 116.073174] [<803507e8>] (__fput) from [<80350a74>] (____fput+0x18/0x1c)
[ 116.073206] r9:00000000 r8:8114fd00 r7:85e88fc0 r6:85e8952c r5:829970c0 r4:83c7e300
[ 116.073214] [<80350a5c>] (____fput) from [<80143138>] (task_work_run+0xb4/0xe4)
[ 116.073244] [<80143084>] (task_work_run) from [<8012592c>] (do_exit+0x4ac/0xb88)
[ 116.073282] r9:00000000 r8:87c09f44 r7:87c09e9c r6:87c08000 r5:8243dc00 r4:85e88fc0
[ 116.073290] [<80125480>] (do_exit) from [<801260a4>] (do_group_exit+0x50/0xe0)
[ 116.073318] r7:ffffe000
[ 116.073325] [<80126054>] (do_group_exit) from [<801340cc>] (get_signal+0x1e8/0xb38)
[ 116.073360] r7:ffffe000 r6:00000009 r5:00418004 r4:00000008
[ 116.073368] [<80133ee4>] (get_signal) from [<8010b728>] (do_work_pending+0x158/0x5a4)
[ 116.073404] r10:81005008 r9:fffffe30 r8:87c09f44 r7:76b3ed4c r6:76b3ed48 r5:87c09fb0
[ 116.073413] r4:ffffe000
[ 116.073420] [<8010b5d0>] (do_work_pending) from [<80100068>] (slow_work_pending+0xc/0x20)
[ 116.073445] Exception stack(0x87c09fb0 to 0x87c09ff8)
[ 116.073460] 9fa0: 00000000 40045613 0212df08 76b3ed40
[ 116.073478] 9fc0: 0215aeb0 76543000 76543844 00000036 75a0ff30 766fba30 01f6df18 0215625c
[ 116.073494] 9fe0: 76c45c58 7e94ecb4 76508264 76b3ed4c 80000010 00000015
[ 116.073511] r10:00000036 r9:87c08000 r8:80100244 r7:00000036 r6:76543844 r5:76543000
[ 116.073521] r4:0215aeb0
[ 116.073529] ---[ end trace 0b47d1b1d2e2b575 ]---
[ 116.073545] videobuf2_common: driver bug: stop_streaming operation is leaving buf 39c303f8 in active state
[ 116.073569] videobuf2_common: driver bug: stop_streaming operation is leaving buf dfda7380 in active state
[ 119.110863] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 119.110894] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Failed disabling i/p port, ret -62
[ 122.150873] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 122.150902] bcm2835-codec bcm2835-codec: bcm2835_codec_stop_streaming: Failed enabling component, ret -62
[ 125.190876] bcm2835_mmal_vchiq: timed out waiting for sync completion
[ 128.230859] bcm2835_mmal_vchiq: timed out waiting for sync completion
CABAC is incompatible with CBR because of the way the encoder is pipelined. Drop to the baseline profile and it works.
Is CABAC only applicable at higher resolutions (1080p)? I ask because smaller resolutions (720p, for example) worked with no issues with the main profile in CBR mode.
Is CABAC only applicable at higher resolutions (1080p)? I ask because smaller resolutions (720p, for example) worked with no issues with the main profile in CBR mode.
I suspect it is the pipelining that is the issue - CABAC is done after the main encode. Rate control needs to know the size of the final encoded frame, and that includes CABAC. 720p at the same framerate is likely to get the frame through the whole pipeline in less than the frame time, therefore rate control has all the required information. 1080p will overlap the encode and CABAC, so rate control gets confused.
CBR with high profile is blocked in the firmware, but for some reason main profile with CBR isn't even though it also supports CABAC. I have a patch prepared to block this too (stream_on will fail in the encoder), but I would like to understand the limitation before just pushing it.
Describe the bug
Managed to raise error in
bcm2835_mmal_vchiq
andbcm2835-codec
by using v4l2h264enc gstreamer element:here the recipe:
lowering resolution works lowering profile to baseline works changing encoding to VBR works, even with higher profiles
Steps to reproduce the behaviour
Device (s)
Raspberry Pi Zero 2 W
System
Raspberry Pi reference 2022-09-22 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 005a8c73b05a2cab394073150208bf4f069e861a, stage2
Jan 5 2023 10:48:31 Copyright (c) 2012 Broadcom version 8ba17717fbcedd4c3b6d4bce7e50c7af4155cba9 (clean) (release) (start)
Linux raspberrypi 5.15.84-v8+ #1613 SMP PREEMPT Thu Jan 5 12:03:08 GMT 2023 aarch64 GNU/Linux
Logs
Additional context
No response