How to record from webcam, with ffmpeg?
#7
So, for what it's worth, I've so far gotten decent audio/video synchronization with the following ffmpeg invocation:
Code:
#!/usr/bin/env bash

echo "enter title"
read TITLE

v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=YUYV -d /dev/video3

ffmpeg -f v4l2 -framerate 20 -thread_queue_size 1024 -use_wallclock_as_timestamps 1 -i /dev/video3 \
       -f alsa -thread_queue_size 1024 -use_wallclock_as_timestamps 1 -i default \
       -c:v libx264 -preset ultrafast \
       -c:a aac -copyts \
       ~/$TITLE.mp4
The key ingredient for achieving decent synchronization seems to be -use_wallclock_as_timestamps on  both alsa and v4l2, and -copyts at the end.


Messages In This Thread
RE: How to record from webcam, with ffmpeg? - by gleachkr - 09-15-2020, 09:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Webcam not working in Manjaro with Cheese, but works in Armbian petaramesh 1 1,099 09-30-2022, 10:09 AM
Last Post: crazyquark
  WORKING Moonlight with FFMpeg on 5.10.11 ShootTheMoon2 2 3,254 11-12-2021, 09:42 PM
Last Post: tblindba
  webcam framerate bottleneck on linux? gleachkr 0 1,837 10-04-2020, 12:55 PM
Last Post: gleachkr

Forum Jump:


Users browsing this thread: 1 Guest(s)