Blanchimont
14th June 2008, 00:36
Are there any timecode manipulation tools in existence?
I mean ones that are more meant to work with true vfr and single frame editing, rather than those packed in deinterlacers...
I assume there must be, but frankly, I'm not having luck finding any (working ones).
I'm working on an encode with very old source which forced me to revert to manual manipulation of the timecode. Which...is...sloow....
The source was 29.970 fps cfr, pattern nnncc (three progressive, two interlaced, no hybrid but that's obvious based on its age...)
First I used TDeint to deinterlace/decomb with quite good results, and TDecimate afterwards to remove the unnecessary duplicate left after TDeint thus making playback smooth and bringing it down to 23.976 fps.
Then running that script into an uncompressed avi(video only) in VirtualDub.
As it had a lot of duplicate frames (it's anime) I wanted to make it more efficient and turn it into vfr by dropping the duplicates...it's then it turned hard...real hard...
Trying to use DeDup was a big no-no...
Half the frames contain artifacts, jump up/down in relation to each other, have different brightness...
Setting the threshold too low almost no frames get dropped, any higher and it starts dropping frames you want to keep (unless you'd fancy making overrides for half of them but that would effectively defeat the purpose of DeDup...)
Then I though of trying Yatta. As it was already deinterlaced/etc I chose type3 project and divided it into freedecimate sections.
Now, about the timecodes in Yatta, when first loading the avi and creating the project and those sections, it could output the correct timecodes, but after starting to manually drop frames, any attempt to create the timecodes file through Yatta gives back one that isn't in synch with the video...(I guess I'm doing something wrong but I'm failing to see what, perhaps I should have loaded the avi directly instead of through avs?...)
So I decided to manually edit the timecodes file in regards to the dropped frames (it's doable, but as I said, it's painfully slow...). Here's how;
If you drop only one frame, it's pretty straightforward;
(this assumes v2 timecode file)
(A,B = duplicates)
frame A = 85460.31 => frame A = 85460.31
frame B = 85502.02 => (frame decimated, timecode commented)
frame C = 85543.72 => Frame C =85543.72
This makes frame A extend its duration to the beginning of frame C.
(note; you WANT to keep the 'dropped' timestamp commented for debug purposes/sync issue fixing later...)
If two or more duplicates need to be dropped you need to pay a bit more attention as you will need to make sure the remaining frame occupies the right timeslot;
(A, B, C, D = duplicates)
Frame A = 146521.26 (drop)
Frame B = 146562.97 (drop) => commented
Frame C = 146604.67 (keep) => commented
Frame D = 146646.38 (drop) => commented
Note the order? What this does is it makes Frame C (which you want to keep) to occupy the timeslot for all four, from 146521.26 to end of D's duration...
With 50.000+ frames and corresponding timestamps, you're bound to get out of synch from time to time, however my solution is to load the avs generated by Yatta into AegiSub (after commenting out fielddeinterlace) along with the 'hand-edited' timecodes file, and then compare the frames between Yatta and Aegisub... If the framenumber, time, and what you see in the frame, match, then it's in synch... If not, it's a simple thing to narrow it down and fixing it.
But as I stated, editing a timecodes file in notepad and matching it against individual frames is not a fun thing to do... What I want to know if there are any tools that lets you do some of these things in a more automatic fashion? Or if someone could tell how to make Yatta to produce an accurate timecodes file after dropping frames then that would be at least half the victory...
I assume existing programs/functions I've already come across could do some of these tasks, but I've only got few months experience of encoding so I'm still having hard time sometimes figuring out what could be done with what...
It does however have it's points to be able to choose what frames to drop and keep; Once all duplicates have been dropped (through VDub into uncompressed avi again) I'm extracting that avi into bmp images to edit out any remaining source artifacts/adjust brightness in gimp thus less work as there'll be more good frames than otherwise, and afterwards back into avi before encoding it (in megui)...
I mean ones that are more meant to work with true vfr and single frame editing, rather than those packed in deinterlacers...
I assume there must be, but frankly, I'm not having luck finding any (working ones).
I'm working on an encode with very old source which forced me to revert to manual manipulation of the timecode. Which...is...sloow....
The source was 29.970 fps cfr, pattern nnncc (three progressive, two interlaced, no hybrid but that's obvious based on its age...)
First I used TDeint to deinterlace/decomb with quite good results, and TDecimate afterwards to remove the unnecessary duplicate left after TDeint thus making playback smooth and bringing it down to 23.976 fps.
Then running that script into an uncompressed avi(video only) in VirtualDub.
As it had a lot of duplicate frames (it's anime) I wanted to make it more efficient and turn it into vfr by dropping the duplicates...it's then it turned hard...real hard...
Trying to use DeDup was a big no-no...
Half the frames contain artifacts, jump up/down in relation to each other, have different brightness...
Setting the threshold too low almost no frames get dropped, any higher and it starts dropping frames you want to keep (unless you'd fancy making overrides for half of them but that would effectively defeat the purpose of DeDup...)
Then I though of trying Yatta. As it was already deinterlaced/etc I chose type3 project and divided it into freedecimate sections.
Now, about the timecodes in Yatta, when first loading the avi and creating the project and those sections, it could output the correct timecodes, but after starting to manually drop frames, any attempt to create the timecodes file through Yatta gives back one that isn't in synch with the video...(I guess I'm doing something wrong but I'm failing to see what, perhaps I should have loaded the avi directly instead of through avs?...)
So I decided to manually edit the timecodes file in regards to the dropped frames (it's doable, but as I said, it's painfully slow...). Here's how;
If you drop only one frame, it's pretty straightforward;
(this assumes v2 timecode file)
(A,B = duplicates)
frame A = 85460.31 => frame A = 85460.31
frame B = 85502.02 => (frame decimated, timecode commented)
frame C = 85543.72 => Frame C =85543.72
This makes frame A extend its duration to the beginning of frame C.
(note; you WANT to keep the 'dropped' timestamp commented for debug purposes/sync issue fixing later...)
If two or more duplicates need to be dropped you need to pay a bit more attention as you will need to make sure the remaining frame occupies the right timeslot;
(A, B, C, D = duplicates)
Frame A = 146521.26 (drop)
Frame B = 146562.97 (drop) => commented
Frame C = 146604.67 (keep) => commented
Frame D = 146646.38 (drop) => commented
Note the order? What this does is it makes Frame C (which you want to keep) to occupy the timeslot for all four, from 146521.26 to end of D's duration...
With 50.000+ frames and corresponding timestamps, you're bound to get out of synch from time to time, however my solution is to load the avs generated by Yatta into AegiSub (after commenting out fielddeinterlace) along with the 'hand-edited' timecodes file, and then compare the frames between Yatta and Aegisub... If the framenumber, time, and what you see in the frame, match, then it's in synch... If not, it's a simple thing to narrow it down and fixing it.
But as I stated, editing a timecodes file in notepad and matching it against individual frames is not a fun thing to do... What I want to know if there are any tools that lets you do some of these things in a more automatic fashion? Or if someone could tell how to make Yatta to produce an accurate timecodes file after dropping frames then that would be at least half the victory...
I assume existing programs/functions I've already come across could do some of these tasks, but I've only got few months experience of encoding so I'm still having hard time sometimes figuring out what could be done with what...
It does however have it's points to be able to choose what frames to drop and keep; Once all duplicates have been dropped (through VDub into uncompressed avi again) I'm extracting that avi into bmp images to edit out any remaining source artifacts/adjust brightness in gimp thus less work as there'll be more good frames than otherwise, and afterwards back into avi before encoding it (in megui)...