I'm trying to create a screencast with 4 inputs. I'd like to do all 4 recordings to 4 different files in one ffmepg command
- Audio Output from Desktop (music files etc)
- Microphone Output
- Webcam Output
- Desktop (X11) Output
I'd like to have 4 files when done recording, allowing me to interact with each part separately in a video editor (or mux with ffmpeg)
These 4 commands do the job - but they're not in sync, it's also difficult to stop them at the same time due to the nature of backgrounding processes.
Code:
# Record x11
ffmpeg -framerate 60 -video_size 1920x1080 -f x11grab -i :0.0 x11.mp4 &
# Record webcam
ffmpeg -framerate 30 -f v4l2 -i /dev/video0 webcam.mp4 &
# Record mic
ffmpeg -f alsa -ac 2 -ar 44100 -i pulse -acodec libfdk_aac mic.aac &
# Record Desktop Audio
ffmpeg -f pulse -ac 2 -i alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor -acodec libfdk_aac desktop_audio.aac &
I attempted them combined like this:
Code:
ffmpeg -framerate 60 -video_size 1920x1080 -f x11grab -i :0.0 x11.mp4 \
-f v4l2 -framerate 30 -i /dev/video0 webcam.mp4 \
-f alsa -ac 2 -ar 44100 -i pulse -acodec libfdk_aac mic.aac \
-f pulse -ac 2 -i alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor -acodec libfdk_aac desktop_audio.aac
But the webcam.mp4 and x11.mp4 are identical and have audio, the desktop_audio.aac and mic.aac are both recordings of the microphone!
Is there something I'm doing wrong? I seem to be getting half of what I want