Zend certified PHP/Magento developer

“Non-monotonous DTS in output stream” when capturing video with ffmpeg

I’m trying to capture VHS video on Linux using a new USB capture device and FFMPEG. 

I’m able to successfully capture either only audio (using Alsa), or only video (using v4l2) but when I try to do both with the same command I get errors and the video comes out with really screwed up video and sound:

This is the command I’m using:

ffmpeg -report -thread_queue_size 512 -f v4l2 -framerate 30 -video_size 720x480 -i /dev/video0 -thread_queue_size 3584 -f alsa -ac 2 -i hw:1,0 -vcodec h264_omx -zerocopy 1 -b:v 1750k -pix_fmt yuv420p -acodec aac -b:a 96k -strict -2 test-combine.m4v

This ffmpeg command works perfectly well using a different USB device very similar to this one and the exact same PC/VCR setup (I’m using a raspberry pi, h264_omx is the hardware encoder). So I’m surprised this isn’t working. The main error messages see to be these, repeated:

[aac @ 0x1017ba0] Queue input is backward in time
[ipod @ 0x1015490] Non-monotonous DTS in output stream 0:1; previous: 307984, current: 307814; changing to 307985. This may result in incorrect timestamps in the output file.

Does anyone know what could be happening here and how to get the command to work? A few things I have tried with no improvement so far:

  • switching the order of the Alsa and the v4l2 parameters in the command
  • Haphazardly adding a few ffmpeg arguments that I found from google searches, namely use_wallclock_as_timestamps 1 -fflags +genpts  -correct_ts_overflow 0 (included all together at the front of the command – no luck)
  • replacing the device itself in case it’s defective (same result with the second one)

Thanks!