[FFmpeg-user] strange pts in v4l2 capture

Casey Connor ffmpeg at caseyconnor.org
Tue Nov 19 06:38:32 EET 2024


(I don't know how to ensure this will thread properly with my previous 
message, but perhaps the subject line will suffice).

I made some progress re: the strange pts... to recap, this capture command:

ffmpeg -f alsa -ac 2 -i hw:CARD=Cx231xxAudio,DEV=0 -f v4l2 -i 
/dev/video2 -c:a copy -c:v rawvideo test.avi

...generates broken .avi files with stuttering audio and audio pts's 
that increase at a rate of 4x the nb_samples. Remuxing like this:

ffmpeg -i test.avi -c:a copy -c:v copy test-remuxed.avi

...fixes the file.

I have learned that if I specify the sample type and rate, the generated 
file works:

ffmpeg -f alsa -ac 2 -i hw:CARD=Cx231xxAudio,DEV=0 -f v4l2 -i 
/dev/video2 -c:a pcm_s16le -ar 48000 -c:v rawvideo test.avi

...I am specifying s16le and 48kHz, even though those are the values 
ffmpeg has detected itself.

Not sure if this is a bug, or PEBCAK?

-c




More information about the ffmpeg-user mailing list