Quantcast VirtualDub-Mod Scripting - LAME MP3 CBR 320 Parameter - digitalFAQ.com Forums [Archives]
  #1  
02-27-2006, 11:50 PM
sparskter sparskter is offline
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 ?
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
03-02-2006, 05:40 AM
sparskter sparskter is offline
Free Member
 
Join Date: Jul 2005
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
any1 ?
Reply With Quote
  #3  
03-02-2006, 05:49 AM
Dialhot Dialhot is offline
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.
Reply With Quote
  #4  
03-02-2006, 06:49 AM
sparskter sparskter is offline
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
Reply With Quote
  #5  
03-02-2006, 07:02 AM
Dialhot Dialhot is offline
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
Reply With Quote
  #6  
03-02-2006, 12:24 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
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
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Audio Lame geovanebelusso Conversão e Codificação de Vídeo (Português) 2 08-16-2004 01:51 PM
Toolame and lame russiansexpat Players, DVRs, Media Centers 3 12-23-2003 06:03 AM
Use Lame decoder in Nero? azel Audio Conversion 0 10-29-2003 11:26 AM
do I need to use scripting to use KDVD? gidxg03 Video Encoding and Conversion 1 10-24-2003 11:53 AM
Encoding: The vbv parameter hachemoncourt Video Encoding and Conversion 0 02-04-2003 02:55 PM

Thread Tools



 
All times are GMT -5. The time now is 09:11 AM  —  vBulletin © Jelsoft Enterprises Ltd