Is there a way to use FFMPEG to decompose a video into individual image files, and then reassemble those image files into a video with the audio from the original video in sync with the new video track?
I believe that one of the key elements may be setting the frame rates properly, but all the combinations I've tried haven't worked.
The combinations I've tried are as follows:
ffmpeg -i "/InputVideoFilePath" "/OutputImageFilePath"
(This command returns the same number of output image files regardless of whether a frame rate specification is placed on the input file, output file, or both.)
I then pull the audio into a separate file as well by following with this command:
ffmpeg -i "/InputVideoFilePath" "/OutputAudioFilePath"
I then reassemble the images into another video file by typing one of the following:
ffmpeg -i "/OutputImageFilePath" "/OutputVideoFilePath"
ffmpeg -i "/OutputImageFilePath" -r 23.98 "/OutputVideoFilePath"
ffmpeg -r 23.98 -i "/OutputImageFilePath" -r 23.98 "/OutputVideoFilePath"
(23.98 was the original video framerate)
So far, both 1 and 2 create a video that is shorter than the original video, while 3 creates a video that is of the same length. I don't understand how setting the frame rate for the input can make any difference, since the input is simply a series of images (i.e., how can a series of images have a framerate?). The FFmpeg documentation states that setting frame rate on input causes timestamps to be ignored, but how can images have timestamps if they're not a part of a video?
After using method 3, I then overlay the mp3 audio over the newly created video file with the command:
ffmpeg -i "/PathToVideoFile" -i "/PathToAudioFile" "/PathOfFinalVideoOutput"
The final product is only slightly out of sync, but still noticeably so. I can show the FFmpeg output for each of these steps if necessary (it's a lot of output though of course).