Log in

View Full Version : D-frames in VirtualDub & VDubMod


DLaxer
3rd May 2005, 18:26
Hello.
As VirtualDub can determine dropped frames (D-frames) and let us manually delete them one by one, is it possible to use some script to perform this operation automatically (it's very inconveniently to delete a thousands of d-frames manually)? Maybe it's possible to do in other program, like AviSynth, though I don't know how.

bond
3rd May 2005, 23:49
why do you want to delete them?

DLaxer
4th May 2005, 05:11
To get rid of audio/video desynchronization. I know some people say it won't solve the problem, but I noticed a strong correspondence between the amount of d-frames and the lag of the sound. The more d-frames (e.g in second) the fragment of the video has the more the sound lags later on.

bond
4th May 2005, 06:29
Originally posted by DLaxer
I know some people say it won't solve the problemwell count me as one of those...
but i am too lazy to explain these things over and over again, if you want to save yourself some time :search:

DLaxer
4th May 2005, 09:03
Well, it may be so, but the question was how to use some script-like means in the connection with the VirtualDub to automatically delete d-frames (or maybe k-frames if it will be such need).

stephanV
4th May 2005, 09:19
Removing D-frames will indeed influence A/V-synch as the amount of total frames is changed and therefor the video lenght. If removing D-frames will make your video in synch I really wouldnt know.

I don't think there is any automated way to remove D-frames though. Removing key-frames is stupid.

stephanV
4th May 2005, 09:41
I guess you could try do it in a hex-editor though using find and replace.

A D-frame should probably look like this in hexdec: 30 30 64 63 00 00 00 00 00

Just do a find and replace for this and replace with nothing (if your hexeditor allows that, which it should IMO.) Then look for the idx1 header and replace it with JUNK (in hexadec: look for 69 64 78 31 and replace with 4A 55 4E 4B)

Then let VDub reconstruct your index again (with rederiving keyframe flags) et voila. :)

movmasty
14th May 2005, 05:06
Originally posted by stephanV
Removing D-frames will indeed influence A/V-synch as the amount of total frames is changed and therefor the video lenght. If removing D-frames will make your video in synch I really wouldnt know.

I don't think there is any automated way to remove D-frames though. Removing key-frames is stupid.
Not always, as k frames comes in when changes occour, these changes could be bad frames,

i found that in many movies k frames occour when a frame is bad interlaced, you know, even lines from previous frame and odds from next, in this case kf are double: one kf for the interlaced and one after for the good.

Needs half an hour to memove them from a Star trek episode of 40 mins, too long for a whole movie, automatize would be nice. :)

stephanV
14th May 2005, 06:24
removing key frames is removing the ability to properly decode the video.

as for automated removal, that cant be done as you can only safely remove a key frame if another key frame follows right after it. And you still have to define what a bad frame is... if you keep interlaced frames after applying a deinterlacing filter, you should reco0nsider your deinterlacing method.