digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   VirtualDub-MOD Scripting - LAME MP3 CBR 320 parameter (http://www.digitalfaq.com/archives/encode/14140-virtualdub-mod-scripting.html)

sparskter 02-27-2006 11:50 PM

VirtualDub-MOD Scripting - LAME MP3 CBR 320 parameter
 
Hello. I wrote a small script on VirtualDub-MOD 1.5.10.2 build 2542:

Code:

VirtualDub.Open("d:\\video\\01.avs",0,0);
VirtualDub.video.SetMode(1);       
VirtualDub.video.SetCompression("xvid",0,0,0);       
VirtualDub.stream[0].SetMode(0);
VirtualDub.stream[0].SetCompression(0x0055,48000,2,16,40000,x);
VirtualDub.SaveAVI("d:\\video\\01.avi");
VirtualDub.SaveWAV("d:\\video\\01.wav");
VirtualDub.Close();

I wish to encode audio using LAME MP3 CBR 320 KBPS:
http://www.digitalfaq.com/archives/error.gif

The problem is in this line of the script:
VirtualDub.stream[0].SetCompression(0x0055,48000,2,16,40000,
x
);

Accordingly to VdubHelp:
Quote:

SetCompression(int wFormatTag, int nSamplesPerSec, int nChannels, int wBitsPerSample, int nAvgBytesPerSec, int nBlockAlign)
So,
X
= nBlockAlign

What is Block Align and which value should it be ? :D

sparskter 03-02-2006 05:40 AM

any1 ? :D

Dialhot 03-02-2006 05:49 AM

Simply process to a conversion manually and go in the "File" menu and choose "Save process settings" to save the vcf file. Then open it in a texteditor and you will have the parameter value you need.

sparskter 03-02-2006 06:49 AM

@thanks DialHot :!: :!:

Code:

VirtualDub.RemoveInputStreams();
VirtualDub.stream[0].SetSource(0x73647561,0,1);
VirtualDub.stream[0].DeleteComments(1);
VirtualDub.stream[0].AdjustChapters(1);
VirtualDub.stream[0].SetMode(1);
VirtualDub.stream[0].SetInterleave(1,500,1,0,0);
VirtualDub.stream[0].SetClipMode(1,1);
VirtualDub.stream[0].SetConversion(48000,2,2,0,1);
VirtualDub.stream[0].SetVolume();
VirtualDub.stream[0].SetCompression(85,48000,2,0,40000,1,12,"AQAEAAAAwAMBAAAA");
VirtualDub.stream[0].EnableFilterGraph(0);
VirtualDub.stream[0].filters.Clear();
VirtualDub.video.DeleteComments(1);
VirtualDub.video.AddComment(0x00000002,"ISFT","MEncoder dev-CVS-051201-15:28-3.4.3");
VirtualDub.video.AdjustChapters(1);
VirtualDub.video.SetDepth(24,24);
VirtualDub.video.SetMode(0);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetCompression();
VirtualDub.video.filters.Clear();

VirtualDub.stream[0].SetCompression(85,48000,2,0,40000,1,12,"AQAEAAAAwAMBAAAA");

SetCompression(int wFormatTag, int nSamplesPerSec, int nChannels, int wBitsPerSample, int nAvgBytesPerSec, int nBlockAlign, int cbSize, string ex_data)

So Block Align (whom is integer) must be 1 :D

Dialhot 03-02-2006 07:02 AM

You're welcome.
Personally I never tried to understand the parameters for vdubmod, I always proceed like this :)

incredible 03-02-2006 12:24 PM

Quote:

Originally Posted by sparskter
So Block Align (whom is integer) must be 1 :D

Watch it!
Blockalign means the size of ONE audioframe (mono, stereo or multich.).
I dont know in case of mp3, here it "could" be that its a byte aligned order as its compressed so maybe 1 (1byte) is correct, just test your encoding and you'll hear.

In case of an uncompressed PCM Wave the blockalign will be calculated as followed.

BitsPersample/8*Channels

So 16bit/8*2channels = 4

Means in a 16bit wav one sample uses 2bytes (16bit) and in case of stereo we got 2 channels, so 2*2bytes = 4 bytes


All times are GMT -5. The time now is 12:48 AM  —  vBulletin Jelsoft Enterprises Ltd

Site design, images and content © 2002-2022 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2022 Jelsoft Enterprises Ltd.