Trying to get usb webcam stream on website

December 7, 2022, 22:28

vortexen

Hi, im trying to make a small LAN website that i can easily modify, ive already gotten a small webpage up using ssh, apache, and filezilla which makes everything run smooth rn. I want to add a livestream of a usb webcam that shows a 720p ~30fps vid of my 3d printer. Ive researched a lot and found no results that allow me to do the same where i can edit server files using filezilla or smth similar to that (if someone could find me a solution like that, i would appreciate it. Anyways another solution i thought of is streaming my usb webcam to yt and embedding it on the site, so far i watched this tutorial: https://youtu.be/cRycXUIK07g and its exactly what i need BUT i dont have a raspberry pi cam. how could i get it to work for a usb webcam?
raspivid -o - -t 0 -vf -hf -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/(stream key)
Im using a rpi 1 but have multiple rpi 1s if running both tasks is to much for the rpi 1. i unfortunately though dont have anything more recent or better. any help is appreciated, ty! ^^

eternalliving

I had done this with a usb camera, I used uv4l but i'm not sure if a rpi 1 would be capable.. I'm almost certain it won't be capable of anything close to 720p 30fps!! I don't even think I can get that on my rpi4... although my webcam was pulled out of an old laptop and isn't that good.

vortexen

uv4l seems like a heavy process, i feel like smthn small would be all i need. im considering just getting a rpi webcam because of more tutorials using rpi

miabl0

why not try to just use ffmpeg?