How to programmatically check audio sync

I have a multimedia application that converts videos using FFMpeg among other things. Video conversion, oddly enough, in my test fits some tests that test our ability to convert various video formats, with a focus on video examples that are not known to work.

A common problem we've noticed from users is that some videos end up desynchronizing the audio after processing, and I'm looking for a way to test this in my tests.

Extracting the audio portion of the resulting video is not a problem.

My best idea at the moment is to check the offset of the first silence at the beginning and at the end and compare each of the two videos, but I hope someone smart has a better idea.

The application language / environment is Java, but since it is for testing, I can freely use any set of tools.

+2


source to share


1 answer


The main problem is probably that video and audio differ in length. Extract audio and check its length versus video length. If they differ significantly (more than 0.50 s, I'm not entirely sure what shows up as "off") then there is a problem.



To fix this, re-encode the audio to match the video length and then revert the audio and video to container format.

+3


source







All Articles