I was able to figure out all of my libcamera stream settings needed to stream video from my Camera Module 3 and audio from a USB microphone in my RPi Zero W 2 straight to YouTube, which is as follows:
libcamera-vid -t 0 -g 10 --bitrate 4500000 --inline --width 1920 --height 1080 --framerate 30 --rotation 180 --codec libav --libav-format flv --libav-audio --audio-bitrate 192000 --av-sync 200000 -n -o tmp://a.rtmp.youtube.com/live2/[STREAM-KEY]
My question is: why do all of the other streaming pipelines I've seen online require the use of FFmpeg? Every single tutorial I have ever seen on streaming video to RTMP with a Raspberry Pi involves piping the feed into FFmpeg first, which seems super complicated and unnecessary.
Is there some benefit to doing that? Is it more efficient somehow? Why can't I just use libcamera-vid and output straight to RTMP as indicated above?
Would appreciate some insight into this, thanks!
Edit: Just to clarify, this is already working perfectly with RTMP. I want to understand why this works, and why I don't have to pipe it into FFmpeg like literally everyone else on Earth who is using libcamera to stream.
straight to RTMP
... RTMP is Real-Time Messaging Protocol - I would posit that libcamera-vid doesn't know that particular protocollibcamera-vid
can? then I must've misunderstood the questionlibcamera-apps-lite
, which does not uselibav