RPi_Cam_Web_Interface icon indicating copy to clipboard operation
RPi_Cam_Web_Interface copied to clipboard

Stream to YouTube

Open davidtraver opened this issue 1 year ago • 2 comments

I use the RPi_Cam_Web_Interface to view a remote bird-box camera over wifi using a version 2 pi camera and a Raspberry Pi Zero W.

I want to capture the stream on my desktop (Linux) and stream it live to my YouTube account or a web page. Is there a way to do this using an encoder or some other method?

davidtraver avatar Apr 07 '23 01:04 davidtraver

I haven't done this myself but my understanding is you need an x264 stream to feed into Youtube live. This software uses a mjpeg stream for its preview and you can access this stream direct via a url (e.g. http://<IP>/cam_pic_new.php?)

You would then need to transcode this to x264 which I think can be done with something like ffmpeg. This is fairly processor intensive so you would need a decent raspberry model if doing this on that platform.

roberttidey avatar Apr 07 '23 16:04 roberttidey

ropberrtttidy

Thank you. I am doing the decoding on my desktop connecting to the pi zero via wifi. Based on your suggestion,

First, I selected MPEG stream under the System menu.

Second, on my desktop I transcoded the MPEG stream as follows:

ffmpeg -i http://192.168.1.229/cam_pic_new.php -crf 27 -preset veryfast -y output.h264

Third, I can view the transcoded stream on my laptop with:

ffplay output.h264

My next question is whether I have the best stream available.

Your response was a big help. Many thanks.

(edited to update code)

davidtraver avatar Apr 08 '23 18:04 davidtraver