Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tuxmartin
Last active April 26, 2022 14:31
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuxmartin/24083cdd2ef83fe26c204420d9b9d02d to your computer and use it in GitHub Desktop.
Save tuxmartin/24083cdd2ef83fe26c204420d9b9d02d to your computer and use it in GitHub Desktop.
Create fake /dev/videoX device from video file
# mozna neni potreba: sudo apt-get install linux-generic
sudo apt-get install v4l2loopback-dkms
sudo modprobe v4l2loopback
modprobe v4l2loopback
ffmpeg -i /home/martin/Downloads/video.mp4 -f v4l2 -vcodec rawvideo /dev/video0
ffmpeg -i rtsp://10.104.103.138/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp -f v4l2 -pix_fmt yuv420p -vcodec rawvideo /dev/video0
ffmpeg -i rtsp://10.104.103.138/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp -f v4l2 -pix_fmt yuv420p -vf scale=320:240 -r 10 -vcodec rawvideo /dev/video0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment