PDA

View Full Version : How is the audio length (time) determined in vdubmod?


rozemab
25th August 2003, 01:17
Hello,

Searched the forum and could not find an answer so I decided to post here.

I have avi's produced by Dr Divx that play fine. The audio is in sync with the video throughout the encode. The encode is ~2hrs in length.

If I open the avi with vdubmod (the lastest) and do a file->file info, the stated audio length is ~ 10secs! Not a big deal since the avi will play fine. However, if I want to a 3rd pass with divx 5.05, and use vdobmod, it appears vdubmod will truncate the audio at ~10secs. (The remaining video will be processed fine.)


I opened the vob of the avi and asked vdubmod to report the audio length and it reports the correct length. (I feel this is a problem with Dr Divx and have reported it to the developers.)

Questions:

Is this the correct operation of vdubmod (using the audio length value) versus using actual data in the avi?

I'm curious where vdubmod gets it's audio length (is it calculated or read?) within the avi.

thanks, Brian

Joe_Bloggs
28th August 2003, 15:48
@rozemab
What type of audio are you dealing with?
What are you doing with DrDivX ?
Why are you trying a third pass?

It might be a good idea to demultiplex the audio then process the video and then remultiplex in any event that does not involve editing.

rozemab
28th August 2003, 16:52
Originally posted by Joe_Bloggs
@rozemab
What type of audio are you dealing with?
What are you doing with DrDivX ?
Why are you trying a third pass?

It might be a good idea to demultiplex the audio then process the video and then remultiplex in any event that does not involve editing.

Dr Divx uses MP3 @ 128bps. Dr Divx is an automated tool for creating divx avis (2-pass) using the Divx 5.05 encoder. I use it to convert VOBs and DVs into avis via the divx encoder. They use their own MP3 encoder to go from AC3 (using ac3filter .70b). I am interested in performing a 3rd pass with divx n-pass encoder. For this I must use an 3rd party tool like vdubmod etc. .

Funny thing is the output from dr divx plays just fine with any player. When I open the avi with vdubmodmod, the audio length is reported in seconds (~10s) for a 2hr long movie.

I may have to demux and remux to do a third pass.

thanks,

Joe_Bloggs
28th August 2003, 17:40
Have you considered GordianKnot / BeSweet. They are free and you get more codec options. I have the 57 page manual to DrDivX I just havn't got round to reading it. I prefer avi/ogg to avi/mp3 as it edits without sync errors and people say it sounds better for the bitrate. The drawback is you don't know how big the audio is going to be because quality is the key rather than bitrate. So you have to encode the audio first to get the bitrate for the video.

alexnoe
5th September 2003, 17:15
What does AVI-Mux GUI say about that file?

Suiryc
5th September 2003, 17:32
Does VirtualDub also shows the same 'nonsense' length ?
The duration of the stream (in the 'File information' window) is computed according to the length (in blocks) of the stream and the rate (blocks per second) of the stream.

In most cases (with compressed audio such as MP3 - not VBR - , AC3, etc) a block is 1-byte long, the length of the stream is the number of bytes in the stream and the rate is the average byterate of the stream.
The length shown may be wrong in the 'File information' window if the MP3 stream was muxed as VBR (in this case you would have seen a warning when openeing your AVI file). But the error would generally not be that big.

What is the duration shown for this stream in the 'Streams -> Stream list' window ? (may be different than in 'File information').

As suggested by alexnoe you should open your file with AVI-Mux GUI and report what the program say about it.

alexnoe
5th September 2003, 17:37
prefer avi/ogg I didn't even note that. That hack I want to see! Can you make a small sample file for me to download? A few seconds suffice...

Joe_Bloggs
5th September 2003, 19:31
Alex I admire your work and dedication. I on the other hand
wish to minimise my efforts especially when transcoding digital television. My solution is to run a program through ProjectX (formally DS.Jar) remultiplex with BBmpeg and then edit out adverts before program sections with DVD2AVI. I like to leave a few tens seconds on the end of program sections for a cut prior to joining and as a safety margin if things are just too big. This process results in demultiplexed audio and vidio.

I transcode the audio in Besweet to ogg vorbis and use the resulting size to calculate the bitrate for the divx5.x video handled by GordianKnot. The resulting audio and video are multiplexed in VirtualDubmod and subsequently edited and merged into a whole program.

The unexpected bonus is how well the stuff edits. In my opinion it edits as good as a wav file. This makes it very fast in a resync review loop. Bits join together well but not without the rare problem that can always be solved.
It is important to randomly jump through a file to gauge the sync and then pick on key points of interest that represent the program. This is where ogg vorbis beats mp3 in my opinion as it either in sync or not. There is no period of uncertainty. It also sounds better for the bitrate but you have to use your own ears to prove it.

alexnoe
5th September 2003, 20:02
Well, I need the AVI-Mux GUI info about the file to find out if DrDivX writes bad files, or if VDubMod has (another) bug... some hours ago, I've talked with Suiryc on IRC about how one could actually store vorbis audio in an AVI file, and the only solution I can come up with is really obfuscated, and the hack is so dirty that MP3 VBR is nothing against this.
If I find the time, I'll try to implement it, but this hack is actually :scared: :scared: :eek: :devil:

Joe_Bloggs
5th September 2003, 22:01
Alex I see where you are comming from. When I said AVI I meant an AVI produced by DivX5 (No sound). VirtualDubMod can multiplext the two together to make an ogm (Ogg Media File) or an mkv (Matroska). If you try to save as .avi with ogg audio then only the video is written.

Subsequent edits are done whist maintaining the OGM format in my case.

It is best to use the version VirtualDubMod that Comes with GordianKnot to avoid incompatability bugs. (It is also Free unlike DrDivX).You can also change the codec to XVID if you prefer.

I was commenting on DrDivX costing lots of money and you still had to read the manual to use it. GordianKnot with BeSweet would give you more control and a better result assisted by the tutorials on Doom9 and the expertise of the forum members. I am sure DrDivX will be popular but it will only be bought by those who are new to transcoding technology.

Sorry for any confusion.

rozemab
6th September 2003, 04:03
For the same Dr Divx avi (audio plays throughout the entire 2+ hr movie)

Here's what is reported by vdub 1.5.2

file -> file info

audio stream
sample rate 48 khz
channels 2 (stereo)
sample precision 0-bit
compression Fraunhofer etc.
Preload skew 0 samples (0.00s)
# of frames 229893
min/avg/max/total frame size 206/667/8000 (189819k)


=========================================================


Here's what is reported by vdubmod 1.5.4.1
....
layout 334 chunks
length 229893 samples (0:14.36)
min/avg/max/total frame size 353/688/8000 (225k)

If I go into streams->streams list I get

source input avi file
desc avi audio stream 1 (tag 0x0055, MPEG Layer 3)
length 00:00:14.368

=========================================================

Here's what is reported by avi-mux

# audio streams 1

bitrate 128 kbits/s
size of stream (strh) 153,413,981 units
"" (index) 153,413,981 bytes
# of chunks 229,893
format tag 0x0055
sample rate 48,000
channels 2
suggested buffer size 0


@Suiryc - I'm new to avi-mux. Is it possible to copy the contents of the avi info window to the clipboard to paste here?


==========================================================

As I mentioned, the audio will play fine throughout the avi. Anything else I can get from the avi?

alexnoe
6th September 2003, 12:38
@Suiryc - I'm new to avi-mux. Is it possible to copy the contents of the avi info window to the clipboard to paste here? You can rightclick onto the listbox and save it to a text file.

Suiryc
6th September 2003, 15:18
Seems like all files using MP3 encoded by DrDivX have the same problem. There is an unexpected (for this kind of stream, and at least for VirtualDubMod) value in the headers and due to the tricks used for MP3 VBR (and not present in VirtualDub, which should work with your file) the program would take it wrong.

This should be fixed now, try this (http://cyrius.bunkus.org/VDubMod_Release.zip) fix to see it it works now.

alexnoe
6th September 2003, 15:19
I've informed them on the forum on www.divx.com about the b0rked files.

rozemab
6th September 2003, 21:30
Originally posted by Suiryc
Seems like all files using MP3 encoded by DrDivX have the same problem. There is an unexpected (for this kind of stream, and at least for VirtualDubMod) value in the headers and due to the tricks used for MP3 VBR (and not present in VirtualDub, which should work with your file) the program would take it wrong.

This should be fixed now, try this (http://cyrius.bunkus.org/VDubMod_Release.zip) fix to see it it works now.

Suiryc/Alexnoe,

The fix worked fine!!! A very big thanks for your help. And a kudos to Doom9 for having such a nice resource as these forums!!!!

@alexnoe - I saw your posting on www.divx.com about the file structure problem. Looks Like Digit56k will take your advice and forward the issue to the right people.

Thanks!!!!!