Skip to content

Instantly share code, notes, and snippets.

@zburgermeiszter
Created December 29, 2015 21:48
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save zburgermeiszter/42b651a11f17578d9787 to your computer and use it in GitHub Desktop.
Save zburgermeiszter/42b651a11f17578d9787 to your computer and use it in GitHub Desktop.
Loop video file as fake webcam device with ffmpeg
ffmpeg -re -f concat -i <(for i in {1..9999}; do printf "file '%s'\n" input.mp4; done) -f v4l2 /dev/video1 && !!
@darmar
Copy link

darmar commented May 10, 2020

cool, is this possible on Windows also?

@CAMOBAP
Copy link

CAMOBAP commented Jul 18, 2020

I wondering is it possible to do the same on OSX?

@ashwinkey04
Copy link

I get a syntax error upon trying to use this

./main.sh: 1: Syntax error: "(" unexpected

@HeinrichAD
Copy link

You can also use the stream_loop parameter and set it to -1 for infinity.

ffmpeg -stream_loop -1 -re -i input.mp4 -map 0:v -f v4l2 /dev/video1

@teunissenstefan
Copy link

You can also use the stream_loop parameter and set it to -1 for infinity.

ffmpeg -stream_loop -1 -re -i input.mp4 -map 0:v -f v4l2 /dev/video1

Thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment