Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@darmar darmar commented May 10, 2020

cool, is this possible on Windows also?

@CAMOBAP

This comment has been minimized.

Copy link

@CAMOBAP CAMOBAP commented Jul 18, 2020

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

@ashwinkey04

This comment has been minimized.

Copy link

@ashwinkey04 ashwinkey04 commented Aug 4, 2020

I get a syntax error upon trying to use this

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

@HeinrichAD

This comment has been minimized.

Copy link

@HeinrichAD HeinrichAD commented Aug 29, 2020

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

This comment has been minimized.

Copy link

@teunissenstefan teunissenstefan commented Sep 7, 2020

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