3 ms·
CamSimulate: Python app to stream Videos from files to video devices on computer
- izoow 3y agoI don't want to come off as overly harsh, but calling this "Virtual Camera for Linux written in Python" seems a bit too generous considering all this seems to do is ask you for an input file and an output device and then call `ffmpeg -re -i {input_file} -f v4l2 {selected_device}`. Cool idea though, I didn't know you can do this that easily with ffmpeg.
- kuzfren 3y agoYeh it's a neat script but not really much more.
- ghostly_s 3y agoI use a similar trick + gphoto to use my digital camera as a webcam, works great even on my old hardware: gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video10
- izoow 3y agoI'd sometimes use my Android phone as a webcam by running an app like "IP Webcam" that exposes a video stream of the camera feed and then using the video stream as input for ffmpeg.
- deleted 3y ago[deleted]
- cwillu 3y agoffmpeg_command = f"ffmpeg -re -i {input_file} -f v4l2 {selected_device}" stdscr.clear() stdscr.addstr(0, 0, f"Running command: {ffmpeg_command}") stdscr.refresh() subprocess.call(ffmpeg_command.split()) No. Just, no. subprocess.call(["ffmpeg", "-re", "-i", input_file, "-f", "v4l2", selected_device]) Is how you spell that in a way that won't immediately break with a file name with a space in it.
- exe34 3y agoI think it's nice that some kid or novice has figured out how to do something cool and decided to package it in a way that they think others might find useful. For those of us who need it, we can discover the ffmpeg call and use that directly. Others will think this is very trivial and not worth mentioning and yet others will see it as a revelation. That's okay, we're all at different stages.
- deleted 3y ago[deleted]