I'm trying to record lossless videos with ffmpeg
of
- My screen
- My computer audio
- My microphone audio
using this script:
MIC="alsa_input.usb-Logitech_Logitech_USB_Headset-00.mono-fallback"
MONITOR="alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo.monitor"
AUDIO0=$(pactl list short | grep "$MIC" | grep -Po "[0-9]+" | head -1)
AUDIO1=$(pactl list short | grep "$MONITOR" | grep -Po "[0-9]+" | head -1)
ffmpeg \
-video_size 1920x1080 \
-framerate 60 \
-f x11grab -i :0.0 \
-f pulse -i $AUDIO0 \
-f pulse -i $AUDIO1 \
-map 0 -map 1 -map 2 \
-c:a copy \
-c:v libx264rgb \
-crf 0 \
-preset ultrafast \
video.mkv
On my slow computer it only records at about 7 FPS. Is there a way to record at a higher FPS while keeping it lossless and the file size fairly small?
The 3 tracks also appear to be about a second out of sync with each other, with the screen first, the mic second, and the sound output third. I think it's because it recognizes them in that order when the recording is started. I can manually resync them, but it would be easier to fix the problem.