View Full Version : editing AVI file headers
jdlk
28th November 2007, 14:09
Is there a way to edit audio headers for AVI files without re-writing the entire file? I have a large number of files where I need to alter the audio delay. At the moment the best I have come up with is using Mencoder in a batch file with the following commands:
-ovc copy -oac copy -audio-delay -0.048 -o "%%~dpi%%~ni COPY".avi
While this works, I would have expected there to be a simple utility to mass edit headers without re-writing files (as you would say with photos, or audio files), but searching this forum has drawn a blank.
foxyshadis
28th November 2007, 15:04
Nope, delay is added to an avi by padding the audio or video segment out with FF bytes, so you have to remux. (Unless you can convert those chunks to junk chunks somehow, and fix up the index.)
jdlk
28th November 2007, 18:12
Okay. Thanks for the quick and clear response. I suppose batching the files through Mencoder is a fairly painless process.
squid_80
29th November 2007, 04:28
Nope, delay is added to an avi by padding the audio or video segment out with FF bytes, so you have to remux.
Eh? What about dwStart in the stream header?
jdlk
29th November 2007, 15:51
Eh? What about dwStart in the stream header?
I had never heard of dwStart, so did a bit of Googling. Very helpful.
I found that my media streamer (Pinnacle Showcenter) did not recognise changes made by using "-audio-delay" (which I'm guessing is for Mencoder/Mplayer only), but using "-delay" in Mencoder to set the dwStart header works just fine for the Showcenter.
Is "-delay" recognised by most standalones? (I am making the delay adjustment to counteract sync issues with my plasma).
foxyshadis
6th December 2007, 17:23
Eh? What about dwStart in the stream header?
Hm, I hadn't heard of that, but it seems that at least avi-mux gui uses it, though a lot of avi editors and some players don't support it. Nifty, I'll keep that in mind.
squid_80
6th December 2007, 18:03
Yes virtualdub doesn't like it and will complain when you open the file.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.