So basically I used a frame extractor in a video to get all it's frames, then I used an image enhancer to enhance the images, and then I used ffmpeg to make a video out of them again. However, the problem is that the sound doesn't match up with it anymore. Everytime I try to correct the sound, it slowly diverges over a minute or two and it's back to being not in sync anymore. Is there a way I could capture the variable framerate from the original and put it on the new one? Or perhaps try to sync up the audio by hand without losing quality?
Extract the timecodes (timestamps) from the source, mux timecodes into the new video What tools you might use depends on what type of video and containers you have . eg you might use mkvextract and mkvmerge for mkv , or mp4fpsmod for mp4 etc... If the framecount is the same as the source, you're done. Otherwise you have to edit the timecodes
Ok so I have another problem related to this. I took the video in question and used interpolation algorithms to double it's framerate. It came out well and all, but now the timestaps doesn't work for it, so the audio is out of sync because the timestamp file is for the 24fps version instead of the 48fps version I made. Anyone know how to fix this? I tried doubling all the entries in the timestamp, but that ended up making the video 12fps, I tried halfing all the timestamps, which did it, but then the video cut off half way because I guess the timestamps ran out?
Does the frame rate vary all over the place or is it a combination of film and video, or that sort of thing. If the answer is yes, can you easily tell which section is which? If the answer is yes, you could go through the video and note the start and end frame numbers for each video section, or each film section, then make a timecodes file to match. A basic timecodes file looks like this: # timecode format v1 Assume 59.940060 0, 3539, 23.976024 3540, 3699, 23.976024 5998, 6342, 23.976024 19263, 20258, 23.976024 22887, 23268, 23.976024 x264 still seems to need # timecode format v1 as the first line when being fed a timecodes file for VFR encoding, but for muxing I vaguely remember MKVToolNix switched to # timestamp format v1 Although it might still accept either. By the way. MKVCleaver and gMKVExtractGUI both tend to make extracting stuff from MKVs a fair bit less painful.
I think the framerate varies all over the place. When I used the extractor it gave me timestamp v2. I think I might be able to tell in what section the framerate switches, but that would be too painful, I tried doing it and I think it did it every 1-2 minutes and the video is like 30-35 minutes long, and I have no experience with this timecode stuff, before that video, I didn't even think it was possible to switch framerate in the middle of the video just like that, pretty annoying.
--------------------- Stunna... At the Bar, Stunnin'!!! 98 M3/4 ***Car is going thru a restoration/modding phaze***
Somehow you need to double the number of frames in the timecodes file while halving their duration. You can extract the timecodes file from your encode, which we know are wrong, but would at least have the correct number of frames. Then taking the timecodes from the source file you'd have to use each frame's duration for two frames in the new timecodes. Code:
Alright so... it doesn't work. I used a different converter and it removed the negative stuff, works fine with original. If I try to double all the numbers, it becomes very off-sync with the audio. If I try to double just the framerate, gets pretty close, but seems to be off by 2-3 seconds, I'll try playing with the delay. I made a python script to double the numbers, and upon looking at them, they seem fine. EDIT: Addin a delay doesn't really help as some parts are off by +1 second, whereas other parts are off by -1 seccond, I guess due to the variability of the fps? Idk.
--------------------- Mike Rieger SCR Performance 970-214-9702 - Mobile
How many frames are there in total for each version? Using the v2 timecodes it's easy to tell. If you open them with any text editor that displays the current line number in the status bar and you scroll to the end, the line number should be the same as the number of frames, minus the header line, I guess. If the number of frames for the encoded version isn't double the original, then it's not quite as "simple" as it appeared it should be. Which I guess leads to another question. How many images were there and did the same number of frames come out (or double) after converting them to video? It seems kind of odd that the original timecodes are almost okay if you simply double the frame rate.
For the original there's 45769 linse (v2). For the new one there's 83989 lines (v2). For the new one, I simply doubled the amount of frames there were, so it should work, quite confused myself.
--------------------- Keith Q. 2008 THSCC Top Gun 2004 330i (sold) 1996 M3 (sold) 1996 328is (sold) 1993 325is (sold)