02-27-2006, 11:50 PM
|
Free Member
|
|
Join Date: Jul 2005
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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:
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 ?
|
Someday, 12:01 PM
|
|
Site Staff / Ad Manager
|
|
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
|
|
|
03-02-2006, 05:40 AM
|
Free Member
|
|
Join Date: Jul 2005
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
any1 ?
|
03-02-2006, 05:49 AM
|
Free Member
|
|
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
03-02-2006, 06:49 AM
|
Free Member
|
|
Join Date: Jul 2005
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
@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
|
03-02-2006, 07:02 AM
|
Free Member
|
|
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You're welcome.
Personally I never tried to understand the parameters for vdubmod, I always proceed like this
|
03-02-2006, 12:24 PM
|
Free Member
|
|
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by sparskter
So Block Align (whom is integer) must be 1
|
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 06:00 PM — vBulletin © Jelsoft Enterprises Ltd
|