1

I am using raspberry pi-4 8GB to take input from a video device /dev/video0 and output it over a network rtp://192.168.10.10:6001 I am using following ffmpeg command ffmpeg -f v4l2 -i /dev/video0 -c:v h264 -f rtp "rtp://192.168.10.10:6001" but the issue is it uses 252% of the cpu and raspberry pi get is getting on fire. How can I solve it

7
  • It's not using more CPU than you have, so don't worry, that's 252*"%"* of a possible 400*"%"* - the heat is probably because you don't have good cooling on the pi Commented Feb 26 at 9:31
  • Ok, I want to drop down the CPU consumption how can I?
    – Mubashir
    Commented Feb 26 at 14:45
  • @Mubahsir please do not add questions in comments ... edit your question instead
    – jsotola
    Commented Feb 26 at 16:59
  • Check the actual temperature w/ vcgencmd measure_temp. Throttling of the CPU to prevent overheat starts at 85° C, it will not destroy itself.
    – goldilocks
    Commented Feb 26 at 17:20
  • 1
    Why do you want to reduce CPU usage - is there something that doesn't work?
    – Milliways
    Commented Feb 27 at 2:49

1 Answer 1

0

Try using a hardware video encoder to lessen the load on the CPU. You can get a list of h264 encoders like this:

ffmpeg -v warning -encoders | grep 264

 V....D libx264              libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
 V....D libx264rgb           libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
 V....D h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V..... h264_omx             OpenMAX IL H.264 video encoder (codec h264)
 V..... h264_v4l2m2m         V4L2 mem2mem H.264 encoder wrapper (codec h264)
 V....D h264_vaapi           H.264/AVC (VAAPI) (codec h264)

I believe the h264_omx is the one implemented in hardware, so your command would look like:

ffmpeg ... -i /dev/video0 -c:v h264_omx ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.