PDA

View Full Version : What mustn't be done when splicing XVID/ASP frames?


shae
13th March 2007, 20:10
What things can vary and what can't when splicing XVID/MPEG4 ASP frames? For example, I suppose resolution should be kept the same and possibly the QM, but anything else?

Is it okay to arbitrarily shuffle around I/P/B/S/N frames? I assume the stream might be valid, even if it may cause visual anomalies depending on what's changed.

Is there more leeway when a spliced stream starts at a keyframe?

(And actually, what tools allow this sort of arbitrary frame copying/pasting/insertion/deletion?)

Blue_MiSfit
14th March 2007, 06:05
You can (sort of) do this with VirtualDub. It will only cut on a keyframe, and it's a linear editor, so you have to add pieces one at a time, using the file -> append AVI segment tool. So that means you have to direct stream copy the segments you want to use first, then assemble them, and direct stream copy the final result again.

Not very intuitive or elegant, but then again, not what VirtualDub was designed for :)

~MiSfit

shae
14th March 2007, 08:40
I'm actually looking to do this NOT on keyframe boundaries, so VirtualDub won't do. For now I'm just editing the AVI index with a hex editor.

But I'm not sure what my constraints are. Certain things just crash it (the video decoder), so clearly some things are *bad* :) (but maybe I should just not play with it in its packed bitstream form), but I'm not sure even when it looks okay it really IS okay.

foxyshadis
14th March 2007, 12:29
If you're not doing it on key-frames, where AVI typically inserts a new copy of the all-important codec private data, then you're probably entirely at the mercy of the error-robustness of the decoders, and each will have different tolerances. Most of the interesting options will probably break it, though.

shae
14th March 2007, 15:02
The main incentive I have for this sort of splicing is not to join different videos, but to fix problems.

One thing I'd like to do is move around delta frames of the same encoding. Another might be inserting new keyframes instead of other key or non-key frames.

Are there any MPEG4 ASP validators that check for compliance and give hints also for border cases?