View Full Version :
Sylia script question
TelemachusMH
2nd December 2001, 07:20
I looked at the .jobs file so that I can see how to make them and automate the encoding process, but I have a question. The "VirtualDub.video.SetCompData()" command has a long ascii value that the codec uses. Is it always the same if you use the same codec? If not, how do I figure out how to make it so that I can make the job file complete?
Thanks,
PS Also if someone would like to post a script that they have made. It would be greatly appreciated.
Steady
2nd December 2001, 10:39
The ascii string is mime64 encoded binary data. It should always be the same for a given codec setting but I would not know how to interpret it since it is codec specific. Avery has a text file about sylia at virtualdub.org
They regularly post scripts in the Nandub profiles forum. Nandub is a modified version of Virtualdub so the scripts are similar with a few extra commands for Nandub.
b0b0b0b
5th December 2001, 03:14
I wrote a java class that builds the base64 string for the compression data. I can post it if you like.
b0b0b0b
5th December 2001, 03:17
I just re-read your post.
I have written a java program that, invoked from the command line, runs virtualdub via sylia and does a 2-pass divx 4.11 encode.
This was to tide me over while gknot .20 was in the works.
Any interest in the source code?
TelemachusMH
5th December 2001, 03:40
yes ... I would like to try either .. or both :p of the programs. Thanks a lot
b0b0b0b
5th December 2001, 04:59
Here is a long post with the source code. If you have Microsoft's SDK for java, you can compile to an exe with my make.bat. You have to know java to use this program; it is highly unconfigurable.
I am not going to reprint source code that is taken from the sun jdk source tree. I have not modified it other than putting it in my package. It is a package class, not public, which is why I needed to lift it.
Note that this is mostly for educational purposes. As I said before, it is highly unusable and I was just gettting started adding auto-nandub-muxing when I went to read a book and haven't touched it since.
If anybody actually wants to use this instead of gordian knot, God help you, let me know and I will clean it up.
.\doit\make.bat
jvc /nomessage /x- bob\*.java
jexegen /main:bob.doit bob\*.class
copy jex.exe \divx\virtualdub-1.4.7\doit.exe
.\doit\bob\base64.java (stolen from sun jdk source)
.\doit\bob\CompressionString.java
package bob;
public class CompressionString
{
public int bitrate = 6000000;
public int rate_control_averaging_period = 2000;
public int rate_control_reaction_period = 10;
public int rate_control_up_down_reaction = 20;
public int key_frame_interval = 300;
public int min_quantizer = 2;
public int max_quantizer = 31;
public int performance_quality = 5;
public int variable_bitrate_mode = 2; // 2 is 1st pass 3 is 2nd pass
public int encoding_quality = 100; // 40% quality irrelevant to mode 5
public int reserved1 = -1;
public int reserved2 = 1;
public String logfile = "c:\\divx.log";
public int idx_bitrate = 0;
public int idx_rate_control_averaging_period = 4;
public int idx_rate_control_reaction_period = 8;
public int idx_rate_control_up_down_reaction = 12;
public int idx_key_frame_interval = 16;
public int idx_min_quantizer = 20;
public int idx_max_quantizer = 24;
public int idx_performance_quality = 28;
public int idx_variable_bitrate_mode = 32;
public int idx_encoding_quality = 36; // 40% quality irrelevant to mode 5
public int idx_reserved1 = 52;
public int idx_reserved2 = 56;
public int idx_logfile = 60;
public int idx_max = 315;
public CompressionString () {}
private int getInt(byte[] barr, int offset)
{
int a = 0;
for (int i=4; i>0; i--) {
a *= 256;
a += getInt(barr[offset+i-1]);
}
return a;
}
private void setInt(byte[] barr, int offset, int val)
{
barr[offset] = (byte)((val << 24) >> 24);
barr[offset+1] = (byte)((val << 16) >> 24);
barr[offset+2] = (byte)((val << 8) >> 24);
barr[offset+3] = (byte)(val >> 24);
}
private void setPath(byte[] barr)
{
byte[] lb = logfile.getBytes();
System.arraycopy(lb, 0, barr, idx_logfile, lb.length);
}
private String getPath(byte[] barr)
{
return new String(barr, idx_logfile, idx_max - idx_logfile);
}
public CompressionString(String base64in)
{
byte[] barr = base64.base64ToByteArray(base64in);
bitrate = getInt(barr, idx_bitrate);
rate_control_averaging_period = getInt(barr, idx_rate_control_averaging_period);
rate_control_up_down_reaction = getInt(barr, idx_rate_control_up_down_reaction);
rate_control_reaction_period = getInt(barr, idx_rate_control_reaction_period);
key_frame_interval = getInt(barr, idx_key_frame_interval);
min_quantizer = getInt(barr, idx_min_quantizer);
max_quantizer = getInt(barr, idx_max_quantizer);
performance_quality = getInt(barr, idx_performance_quality);
variable_bitrate_mode = getInt(barr, idx_variable_bitrate_mode);
encoding_quality = getInt(barr, idx_encoding_quality);
reserved1 = getInt(barr, idx_reserved1);
reserved2 = getInt(barr, idx_reserved2);
logfile = getPath(barr);
}
public String toString()
{
StringBuffer sb = new StringBuffer();
sb.append("bitrate: "+bitrate+"\trcavg per.: "+rate_control_averaging_period+"\trcup down"+rate_control_up_down_reaction+"\trc reaction period"+rate_control_reaction_period+"\r\n");
sb.append("kfi: "+key_frame_interval+"\tminQ: "+min_quantizer+"\tmaxQ: "+max_quantizer+"\tperformance/quality: "+performance_quality+"\r\n");
sb.append("vbrmode: "+variable_bitrate_mode+"\tencoding quality: "+encoding_quality+"\treserved1: "+reserved1+"\treserved2: "+reserved2+"\r\n");
return sb.toString();
}
public String toBase64()
{
byte[] barr = new byte[idx_max+1];
setInt(barr, idx_bitrate, bitrate);
setInt(barr, idx_rate_control_averaging_period, rate_control_averaging_period);
setInt(barr, idx_rate_control_up_down_reaction, rate_control_up_down_reaction);
setInt(barr, idx_rate_control_reaction_period, rate_control_reaction_period);
setInt(barr, idx_key_frame_interval, key_frame_interval);
setInt(barr, idx_min_quantizer, min_quantizer);
setInt(barr, idx_max_quantizer, max_quantizer);
setInt(barr, idx_performance_quality, performance_quality);
setInt(barr, idx_variable_bitrate_mode, variable_bitrate_mode);
setInt(barr, idx_encoding_quality, encoding_quality);
setInt(barr, idx_reserved1, reserved1);
setInt(barr, idx_reserved2, reserved2);
setPath(barr);
return base64.byteArrayToBase64(barr);
}
/**
bitrate 0 (80 8d 5b 00) -- 6 million bits/sec == 6000 kbit/sec
rcap 2000 4 (d0 07 00 00)
rcp 10 8 (0a 00 00 00)
rcdur 20 12 (14 00 00 00)
kfi 300 16 (2c 01 00 00)
mQ 2 20 (02 00 00 00)
MQ 12 24 (0c 00 00 00)
pq slowest 28? (05 00 00 00)
vbr 2nd pass 32? (03 00 00 00)
encoding quality 36 (28 00 00 00)
logfile 60-316 or 256 bytes
0 80 8d 5b 00 d0 07 00 00 0a 00 00 00 14 00 00 00
16 2c 01 00 00 02 00 00 00 0c 00 00 00 05 00 00 00
32 03 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00
48 00 00 00 00 ff ff ff ff 01 00 00 00
60 c:\divx\log...
*/
public final static int getInt(byte b)
{
// -1 is FF
int ret=0;
ret = (b+256) % 256;
return ret;
}
public final static void printBytes(byte[] base64in)
{
byte[] barr = base64.base64ToByteArray(new String(base64in));
for (int i=0; i<barr.length; i+=16) {
System.out.print(i+"\t");
for (int k=i; k<i+16 && k<barr.length; k++) {
int howdy = getInt(barr[k]);
String out = Integer.toHexString(howdy);
if (out.length()==1) out = "0"+out;
System.out.print(out+" ");
}
System.out.print("[");
for (int k=i; k<i+16 && k<barr.length; k++) {
byte[] b2 = {barr[k]};
System.out.print(new String(b2));
}
System.out.println("]");
}
}
public final static void main(String[] args)
throws Exception
{
String howdy1 = "gI1bANAHAAAKAAAAFAAAACwBAAACAAAADAAAAAUAAAADAAAAKAAAAAAAAAAAAAAAAAAAAP////8BAAAAYzpcZGl2eDIubG9nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
String howdy = "gI1bANAHAAAKAAAAFAAAACwBAAACAAAADAAAAAUAAAACAAAAKAAAAAAAAAAAAAAAAAAAAP////8BAAAAYzpcZGl2eDIubG9nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
CompressionString cs = new CompressionString(howdy);
printBytes(howdy.getBytes());
String howdy2 = cs.toBase64();
if (!howdy.equals(howdy2)) {
System.out.println("not equal!");
printBytes(howdy2.getBytes());
} else {
System.out.println("all systems go");
}
CompressionString cs2 = new CompressionString();
printBytes(cs2.toBase64().getBytes());
}
}
.\doit\bob\VirtualdubScript.java
package bob;
/*
1st pass
VirtualDub.Open("C:\\rip\\hdtv\\sample1.avs",0,0);
// audio--as is
VirtualDub.audio.SetSource(0);
VirtualDub.audio.SetInterleave(1,500,1,0,0);
VirtualDub.audio.SetClipMode(1,1);
VirtualDub.audio.SetConversion(0,0,0,0,0);
VirtualDub.audio.SetVolume();
VirtualDub.audio.SetCompression();
// end audio
VirtualDub.video.SetDepth(24,24);
// fast recompress
VirtualDub.video.SetMode(1);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,0);
// divx 4.11
VirtualDub.video.SetCompression(0x78766964,0,10000,0);
VirtualDub.video.SetCompData(316,"gI1bANAHAAAKAAAAFAAAACwBAAACAAAADAAAAAUAAAACAAAAKAAAAAAAAAAAAAAAAAAAAP////8BAAAAYzpcZGl2eDIubG9nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=");
VirtualDub.video.filters.Clear();
VirtualDub.subset.Delete();
VirtualDub.SaveAVI("C:\\rip\\hdtv\\1.avi");
VirtualDub.Close();
*/
public class VirtualdubScript
{
public static final String getScript(String srcfile, String tmpfile, String destfile, CompressionString cs)
{
return getScript(srcfile,tmpfile,destfile,cs,true,true);
}
public static final String getScript(String srcfile, String tmpfile, String destfile, CompressionString cs,
boolean job1, boolean job2)
{
int jobcount = 0;
jobcount += job1?1:0;
jobcount += job2?1:0;
cs.variable_bitrate_mode = 2;
StringBuffer s = new StringBuffer();
s.append("// VirtualDub job list (Sylia script format)\r\n");
s.append("// This is a program generated file -- edit at your own risk.\r\n");
s.append("//\r\n");
s.append("// $numjobs "+jobcount+"\r\n");
s.append("//\r\n");
if (job1) {
s.append("// $job \"Divx 4.11 First Pass\"\r\n");
s.append("// $input \""+srcfile+"\"\r\n");
s.append("// $output \""+tmpfile+"\"\r\n");
s.append("// $state 0\r\n");
s.append("// $start_time 0 0\r\n");
s.append("// $end_time 0 0\r\n");
s.append("// $script\r\n");
cs.variable_bitrate_mode = 2;
s.append("VirtualDub.Open(\""+srcfile+"\",0,0);\r\n");
s.append("VirtualDub.audio.SetSource(0);\r\n");
s.append("VirtualDub.audio.SetInterleave(1,500,1,0,0);\r\n");
s.append("VirtualDub.audio.SetClipMode(1,1);\r\n");
s.append("VirtualDub.audio.SetConversion(0,0,0,0,0);\r\n");
s.append("VirtualDub.audio.SetVolume();\r\n");
s.append("VirtualDub.audio.SetCompression();\r\n");
s.append("VirtualDub.video.SetDepth(24,24);\r\n");
s.append("VirtualDub.video.SetMode(1);\r\n");
s.append("VirtualDub.video.SetFrameRate(0,1);\r\n");
s.append("VirtualDub.video.SetIVTC(0,0,-1,0);\r\n");
s.append("VirtualDub.video.SetRange(0,0);\r\n");
s.append("VirtualDub.video.SetCompression(0x78766964,0,10000,0);\r\n\r\n");
s.append("VirtualDub.video.SetCompData(316,\""+cs.toBase64()+"\");\r\n");
s.append("VirtualDub.video.filters.Clear();\r\n");
s.append("VirtualDub.subset.Delete();\r\n");
s.append("VirtualDub.SaveAVI(\""+tmpfile+"\");\r\n");
s.append("VirtualDub.Close();\r\n");
s.append("// $endjob\r\n");
s.append("//\r\n");
s.append("//--------------------------------------------------\r\n");
}
if (job2) {
s.append("// $job \"Divx 4.11 Second Pass\"\r\n");
s.append("// $input \""+srcfile+"\"\r\n");
s.append("// $output \""+destfile+"\"\r\n");
s.append("// $state 0\r\n");
s.append("// $start_time 0 0\r\n");
s.append("// $end_time 0 0\r\n");
s.append("// $script\r\n");
cs.variable_bitrate_mode = 3;
s.append("VirtualDub.Open(\""+srcfile+"\",0,0);\r\n");
s.append("VirtualDub.audio.SetSource(0);\r\n");
s.append("VirtualDub.audio.SetInterleave(1,500,1,0,0);\r\n");
s.append("VirtualDub.audio.SetClipMode(1,1);\r\n");
s.append("VirtualDub.audio.SetConversion(0,0,0,0,0);\r\n");
s.append("VirtualDub.audio.SetVolume();\r\n");
s.append("VirtualDub.audio.SetCompression();\r\n");
s.append("VirtualDub.video.SetDepth(24,24);\r\n");
s.append("VirtualDub.video.SetMode(1);\r\n");
s.append("VirtualDub.video.SetFrameRate(0,1);\r\n");
s.append("VirtualDub.video.SetIVTC(0,0,-1,0);\r\n");
s.append("VirtualDub.video.SetRange(0,0);\r\n");
s.append("VirtualDub.video.SetCompression(0x78766964,0,10000,0);\r\n");
s.append("VirtualDub.video.SetCompData(316,\""+cs.toBase64()+"\");\r\n");
s.append("VirtualDub.video.filters.Clear();\r\n");
s.append("VirtualDub.subset.Delete();\r\n");
s.append("VirtualDub.SaveAVI(\""+destfile+"\");\r\n");
s.append("VirtualDub.Close();\r\n");
s.append("// $endjob\r\n");
s.append("//\r\n");
s.append("//--------------------------------------------------\r\n");
}
s.append("// $done\r\n");
return s.toString();
}
}
<snip>
b0b0b0b
5th December 2001, 05:00
@Doom9: I apologize for the length of these posts
.\doit\bob\doit.java
package bob;
import java.io.*;
import com.ms.win32.Kernel32;
import com.ms.win32.win;
import com.ms.win32.COORD;
import java.util.*;
/** @dll.import("jcurzez") */
public class doit
{
private static char[] getChars(String s)
{
char[] chars = new char[s.length()];
s.getChars(0,s.length(),chars,0);
return chars;
}
public final static void main(String[] args)
throws Exception
{
if (args.length==0) {
System.out.println("Process an avisynth script:");
System.out.println("doit [--2] [--divx4log] -b <bitrate> [-mq #] [-Mq #] -src <src.avs> -dest <dest>");
System.out.println("Process a DVD2AVI project file. Deinterlace with vertical filter. 30fps.");
System.out.println("doit -crop <left,top,width,height> -resize <width,height> -b <bitrate> -src <src.d2v> -dest <dest> ");
System.out.println("Mux 1 audio stream into an avi");
System.out.println("doit -src <src.avi> -audio <vbrmp3> -delay <ms> -dest <dest>");
return;
}
doit d = new doit();
boolean firstpass = true, secondpass = true;
int bitrate = 6000, minQ = 2, maxQ = 31;
String src = null;
String dest = null;
String cropstr=null, resizestr=null;
Hashtable arghash = new Hashtable();
boolean skip = false;
String audio = null;
String delaystr = null;
for (int i=0; i<args.length; i++) {
if (!skip) {
if (args[i].startsWith("--")) {
if (args[i].equals("--2")) {
firstpass = false;
} else if (args[i].equals("--1")) {
secondpass = false;
}
} else if (args[i].startsWith("-")) {
if (args[i].equals("-src")) {
src = args[i+1];
} else if (args[i].equals("-dest")) {
dest = args[i+1];
} else if (args[i].equals("-b")) {
bitrate = Integer.parseInt(args[i+1]);
} else if (args[i].equals("-mq")) {
minQ = Integer.parseInt(args[i+1]);
} else if (args[i].equals("-Mq")) {
maxQ = Integer.parseInt(args[i+1]);
} else if (args[i].equals("-crop")) {
cropstr = args[i+1];
} else if (args[i].equals("-resize")) {
resizestr = args[i+1];
} else if (args[i].equals("-audio")) {
audio = args[i+1];
} else if (args[i].equals("-delay")) {
delaystr = args[i+1];
}
skip = true;
}
}
skip = false;
}
if (src.endsWith(".avi")) {
d.mux(src,dest,audio,delaystr);
} else {
if (src.endsWith(".d2v")) {
src = d.createAvs(src,cropstr,resizestr);
}
d.go(src,dest,bitrate,firstpass,secondpass,minQ,maxQ);
}
}
public String createAvs(String src, String cropstr, String resizestr)
throws Exception
{
BufferedWriter bw = new BufferedWriter(new FileWriter("c:\\temp.avs"));
writeln(bw,"LoadPlugin(\"c:\\divx\\mpeg2dec\\MPEG2DEC.dll\")");
writeln(bw,"LoadPlugin(\"C:\\divx\\greedyhma\\greedyhma.dll\")");
writeln(bw,"mpeg2source(\"c:\\rip\\daft\\"+src+"\")");
writeln(bw,"GreedyHMA(1,0,0,0,1,0,0,0)");
writeln(bw,"crop("+cropstr+")");
writeln(bw,"BilinearResize("+resizestr+")");
bw.close();
return "c:\\\\temp.avs";
}
private void writeln(BufferedWriter bw, String s)
throws Exception
{
bw.write(s,0,s.length());
bw.newLine();
}
public String replace(String src, String replFrom, String replTo)
{
int idx, lastidx=0;
String dest = "";
if (src.indexOf(replFrom) == -1) return src;
while ((idx=src.indexOf(replFrom,lastidx))!=-1) {
dest+=src.substring(lastidx,idx)+replTo;
lastidx = idx + replFrom.length();
}
dest+=src.substring(lastidx,src.length()-1);
return dest;
}
public void ConvertLogfile(String logfile)
throws IOException
{
System.out.println("converting logfile...");
BufferedReader br = new BufferedReader(new FileReader(logfile));
BufferedWriter bw = new BufferedWriter(new FileWriter(logfile+"2"));
String line;
while ((line = br.readLine())!=null) {
String line2 = replace(line,"quantizer","quant");
line2 = line2 + "\n";
bw.write(line2,0,line2.length());
}
br.close();
bw.close();
File orig = new File(logfile);
orig.delete();
File dest = new File(logfile+"2");
dest.renameTo(new File(logfile));
}
public void go2()
{
int hConsole = Kernel32.GetStdHandle(win.STD_OUTPUT_HANDLE);
COORD coord = new COORD();
coord.X=1;
coord.Y=1;
Kernel32.SetConsoleCursorPosition(hConsole, coord);
}
public void go(String src, String dest, int bitrate, boolean firstpass, boolean secondpass, int minQ, int maxQ)
throws Exception
{
CompressionString cs = new CompressionString();
cs.bitrate = bitrate * 1000;
cs.min_quantizer = minQ;
cs.max_quantizer = maxQ;
if (secondpass && !firstpass) {
ConvertLogfile(cs.logfile);
}
String script = VirtualdubScript.getScript(src,"c:\\\\temp.avi",dest,cs,firstpass,secondpass);
String vdjobs = "c:\\divx\\virtualdub-1.4.7\\virtualdub.jobs";
File tmpjobs = new File(vdjobs+".old");
tmpjobs.delete();
File jobs = new File(vdjobs);
jobs.renameTo(tmpjobs);
FileWriter fw = new FileWriter(vdjobs);
fw.write(script);
fw.close();
Runtime r = Runtime.getRuntime();
System.out.println(cs.toString());
Process p = r.exec("virtualdub /r");
long offset = 0;
while (true) {
Thread.currentThread().sleep(3500);
BufferedReader br = new BufferedReader(new FileReader(vdjobs));
String line, jobtext="";
while ((line=br.readLine())!=null) {
jobtext += line;
}
if (jobtext.indexOf("// $state 5")!=-1) {
System.out.println("ERROR!");
} else if (jobtext.indexOf("// $state 0")==-1 && jobtext.indexOf("// $state 1")==-1) {
System.out.println("done");
break;
}
System.out.print(".");
}
System.out.println();
p.destroy();
jobs = new File(vdjobs);
jobs.delete();
tmpjobs.renameTo(jobs);
}
public void mux(String src, String dest, String audio, String delay)
throws Exception
{
CompressionString cs = new CompressionString();
cs.bitrate = bitrate * 1000;
cs.min_quantizer = minQ;
cs.max_quantizer = maxQ;
if (secondpass && !firstpass) {
ConvertLogfile(cs.logfile);
}
String script = VirtualdubScript.getScript(src,"c:\\\\temp.avi",dest,cs,firstpass,secondpass);
String vdjobs = "c:\\divx\\nandub-1.0rc2\\virtualdub.jobs";
File tmpjobs = new File(vdjobs+".old");
tmpjobs.delete();
File jobs = new File(vdjobs);
jobs.renameTo(tmpjobs);
FileWriter fw = new FileWriter(vdjobs);
fw.write(script);
fw.close();
Runtime r = Runtime.getRuntime();
System.out.println(cs.toString());
Process p = r.exec("c:\\divx\\nandub-1.0rc2\\nandub /r");
long offset = 0;
while (true) {
Thread.currentThread().sleep(3500);
BufferedReader br = new BufferedReader(new FileReader(vdjobs));
String line, jobtext="";
while ((line=br.readLine())!=null) {
jobtext += line;
}
if (jobtext.indexOf("// $state 5")!=-1) {
System.out.println("ERROR!");
} else if (jobtext.indexOf("// $state 0")==-1 && jobtext.indexOf("// $state 1")==-1) {
System.out.println("done");
break;
}
System.out.print(".");
}
System.out.println();
p.destroy();
jobs = new File(vdjobs);
jobs.delete();
tmpjobs.renameTo(jobs);
}
}
TelemachusMH
11th December 2001, 19:40
I have been having trouble trying to get the program above working. (I don't that the java compiling is setup right), but anywho I would like to know more about the mime base 64 string that is inside the SetCompData() command. before it is turned to the mime base 64 string, what is in it? I am guessing that you have to have things like the log file location, bitrate, and all the other settings for the codec, but what order?
Thanks a lot for the help,
TelemachusMH
b0b0b0b
11th December 2001, 19:43
The toBase64() method takes care of all of that. I figured out all the indices.
TelemachusMH
11th December 2001, 20:00
Where did you learn about it though. I haven't been able to get the progarm to complile, and even if I did, I still can't see how to use it (I've never learned java). I will have quite a bit of time over christmas to work on this program, so I would like to make my own version, (although ... you program will help a lot in that area).
Thanks again,
b0b0b0b
11th December 2001, 20:52
To figure it out, I set a bunch of values in the compression dialog in virtualdub, saved a job, took the compression string from virtualdub.job, converted it from base64 to binary, and correlated the fields to the values I knew I had set.
TelemachusMH
12th December 2001, 21:05
ok ... I am trying to compile the program again (basicly the first real time, because I have been busy), and I realized that I didn't have the jtk source for the base64 call. Where did you get it ... I can't find it at sun.com either. Where did you get it? and would you be willing to zip the folders and files together and post them.:)
Thanks and I am sorry for being a pain,
b0b0b0b
12th December 2001, 22:05
try this:
http://www.sun.com/software/communitysource/java2/
TelemachusMH
19th December 2001, 07:31
I downloaded the source that you posted about finally, (I have been really busy recently), but the file that you use isn't in there. The only files that I can see that might match what you use are: BASE64Encoder.java, BASE64Decoder.java, and Base64CertPrint.java. Can you post the file that you used either like you did before or as an attachment.
Thanks
philippas
19th December 2001, 18:23
@b0b0b0b
I'm interesting on you java program. I see you posted two of the files of you program, CompressionString.java and doit.java.
Can you send me an e-mail @ underwoodc62@hotmail.com and attach all the sources of your program ?
b0b0b0b
19th December 2001, 18:30
virtualdubscript.java is posted here as well.
As for base64, you should keep looking for it. I don't think that sun lets people redistribute their sources. I'll try to come up with a better url.
Have fun with this.... I for one like being able to start a divx4.11 2-pass from the command line. Next thing I'd like to do is implement a compressibility check and have it auto-adjust the bitrate and resolution. After I finish this rip I've been working on for a couple of weeks.
philippas
19th December 2001, 18:57
The cool thing with the command line is that you can set the task scheduler to do multiple automatic encodes whenever you want.:)
can you e-mail me the base64 file.
I had i quick look and i get errors here:
String howdy1 = " gI1bANAHAAAKAAAAFAAAACwBAAACAAAADAAAAAUAAAADAAAAKA
AAAAAAAAAAAAAAAAAAAP//// 8BAAAAYzpcZGl2eDIubG9nAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
";
String howdy = " gI1bANAHAAAKAAAAFAAAACwBAAACAAAADAAAAAUAAAACAAAAKA
AAAAAAAAAAAAAAAAAAAP//// 8BAAAAYzpcZGl2eDIubG9nAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
";
What is that strings for ?
b0b0b0b
19th December 2001, 18:58
Those are strings used for testing.
I think vbb wrapped my line the strings should each be one line.
philippas
19th December 2001, 19:06
Changed them to be one line each and i don't get any errors now.
TelemachusMH
26th December 2001, 18:33
Soooo ... philippas, If you were able to get it to compile it means that you found the base64 java file. Where did you find it? :rolleyes:
philippas
27th December 2001, 02:12
No i didn't find it and so i didn't compiled the program. I just had a look in Vj++. I don't know where to find the base64 file.
When i've got time i look into it.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.