I tried the program on a few videos with a variable frame rate and the output audio and video are out of sync. I think it's better to determine the average frame rate. And for video detection, use ffprobe if you are inserting a batch function. Currently we are limited to only a few supported extensions, and although ffmpeg can process avi, 3gp when we rename them to, for example, mp4, the program detects them correctly. Look at the average frame rate logic and ffprobe for detection from these two scripts.
I tried the program on a few videos with a variable frame rate and the output audio and video are out of sync. I think it's better to determine the average frame rate. And for video detection, use ffprobe if you are inserting a batch function. Currently we are limited to only a few supported extensions, and although ffmpeg can process avi, 3gp when we rename them to, for example, mp4, the program detects them correctly. Look at the average frame rate logic and ffprobe for detection from these two scripts.
https://pastebin.com/bT4x9sGx https://pastebin.com/XdNZAKr3