I'm trying to record a video using ffmpeg
from two inputs: webcam (v4l2
) and desktop (x11grab
). I checked that both inputs are working fine:
ffmpeg \
-f x11grab -s 1920x1080 -r 25 -i :0.0 \
-vcodec libx264 x11.mkv
ffmpeg \
-f v4l2 -s 960x540 -r 25 -i /dev/video0 \
-vcodec libx264 v4l.mkv
but when I try to use both, only x11grab
goes to output:
ffmpeg \
-f x11grab -s 1920x1080 -r 25 -i :0.0 \
-f v4l2 -s 960x540 -r 25 -i /dev/video0 \
-vcodec libx264 test.mkv
Is it possible to merge these inputs into single output file and specify the position for video from webcam (move it to right bottom)?