IoT
May 23, 2020
Note on Raspberry Pi Camera Module bitrate
With this kind of configuration:
[Service] ExecStartPre = v4l2-ctl --set-ctrl video_bitrate_mode=1,video_bitrate=3000000 ExecStart = ffmpeg \ -nostdin \ -f lavfi \ -i anullsrc=channel_layout=mono:sample_rate=44100 \ -f video4linux2 \ -input_format h264 \ -video_size 1280x720 \ -framerate 30 \ -re \ -thread_queue_size 32 \ -use_wallclock_as_timestamps 1 \ -i /dev/video0 \ -vcodec copy \ -acodec aac \ -b:a 128k \ -f flv \ -shortest \ "rtmp://a.rtmp.youtube.com/live2/aaaa-bbbb-cccc-dddd"
CPU load heavily depends on video_bitrate
. With the value of 3000000
the load is around 50-55%, while on 4500000
it's already 60-65%.
With video_bitrate_mode=0
it's truly variable yet unpredictable. Depending on an actual scene I observed values of 0.2-10 Mbit/s, and the highest bitrate caused the load of 100% with unstable communication and freezes on YouTube.