mikeathome
3rd February 2003, 16:56
Hi,
I emailed the author twice, never receive an answer, pls. help me !
The following script:
// $script
declare framesAVS;
declare framesVOB;
declare framerate;
VirtualDub.Open("d:\\tmp\\Vts_01_V01C__.vob", 0, 0);
framerate=VirtualDub.video.GetFrameRate(0);
Sylia.dprint("Framerate: ",framerate,"\n");
framesVOB=VirtualDub.video.GetRange(0);
Sylia.dprint("Number of Frames in VOB: ",framesVOB,"\n");
VirtualDub.Close();
VirtualDub.Open("d:\\tmp\\Vts_01_V01C__.avs", 0, 0);
framesAVS=VirtualDub.video.GetRange(0);
Sylia.dprint("Number of frames in AVS: ",framesAVS,"\n");
VirtualDub.Close();
Sylia.dprint("DVD2AVI missed frames: ",framesVOB-framesAVS,"\n");
// $endjob
delivers:
Framerate: 0
Number of frames in VOB: 0
Number of frames in AVS: 0
DVD2AVI missed frames: 0
Drives me crazy...
What ever I try alwys '0' even the scriptversion:
declare frames;
frames = VirtualDub.video;
Sylia.dprint(frames.GetRange(0));
delivers something odd but not the number of frames.
I use the special VD version with direct VOB support. I get the right number of frames in the File/Information dialog.
I changed the object.cpp:
#include <windows.h>
#include <stdio.h>
#include "ScriptInterpreter.h"
#include "ScriptValue.h"
#include "ScriptError.h"
static void func_Sylia_dprint(IScriptInterpreter *, CScriptObject *, CScriptValue *argv, int argc) {
char lbuf[12];
while(argc--) {
if (argv->isInt()) {
wsprintf(lbuf, "%ld", argv->asInt());
OutputDebugString(lbuf);
printf(lbuf);
} else if (argv->isString()) {
OutputDebugString(*argv->asString());
printf(*argv->asString());
} else
SCRIPT_ERROR(TYPE_INT_REQUIRED);
++argv;
}
}
static ScriptFunctionDef objFL_Sylia[]={
{ (ScriptFunctionPtr)func_Sylia_dprint, "dprint", "0." },
{ NULL }
};
CScriptObject obj_Sylia={
NULL,
objFL_Sylia
};
This enables output of the Sylia.dprint function to stdout where you can redirect it into a file.
Why I am doing this, ok, I am working on an automatic solution for correcting the DVD2AVI projects wrong framecount. I have already a reliable patch solution, only missing is an automatic framecount function.
I emailed the author twice, never receive an answer, pls. help me !
The following script:
// $script
declare framesAVS;
declare framesVOB;
declare framerate;
VirtualDub.Open("d:\\tmp\\Vts_01_V01C__.vob", 0, 0);
framerate=VirtualDub.video.GetFrameRate(0);
Sylia.dprint("Framerate: ",framerate,"\n");
framesVOB=VirtualDub.video.GetRange(0);
Sylia.dprint("Number of Frames in VOB: ",framesVOB,"\n");
VirtualDub.Close();
VirtualDub.Open("d:\\tmp\\Vts_01_V01C__.avs", 0, 0);
framesAVS=VirtualDub.video.GetRange(0);
Sylia.dprint("Number of frames in AVS: ",framesAVS,"\n");
VirtualDub.Close();
Sylia.dprint("DVD2AVI missed frames: ",framesVOB-framesAVS,"\n");
// $endjob
delivers:
Framerate: 0
Number of frames in VOB: 0
Number of frames in AVS: 0
DVD2AVI missed frames: 0
Drives me crazy...
What ever I try alwys '0' even the scriptversion:
declare frames;
frames = VirtualDub.video;
Sylia.dprint(frames.GetRange(0));
delivers something odd but not the number of frames.
I use the special VD version with direct VOB support. I get the right number of frames in the File/Information dialog.
I changed the object.cpp:
#include <windows.h>
#include <stdio.h>
#include "ScriptInterpreter.h"
#include "ScriptValue.h"
#include "ScriptError.h"
static void func_Sylia_dprint(IScriptInterpreter *, CScriptObject *, CScriptValue *argv, int argc) {
char lbuf[12];
while(argc--) {
if (argv->isInt()) {
wsprintf(lbuf, "%ld", argv->asInt());
OutputDebugString(lbuf);
printf(lbuf);
} else if (argv->isString()) {
OutputDebugString(*argv->asString());
printf(*argv->asString());
} else
SCRIPT_ERROR(TYPE_INT_REQUIRED);
++argv;
}
}
static ScriptFunctionDef objFL_Sylia[]={
{ (ScriptFunctionPtr)func_Sylia_dprint, "dprint", "0." },
{ NULL }
};
CScriptObject obj_Sylia={
NULL,
objFL_Sylia
};
This enables output of the Sylia.dprint function to stdout where you can redirect it into a file.
Why I am doing this, ok, I am working on an automatic solution for correcting the DVD2AVI projects wrong framecount. I have already a reliable patch solution, only missing is an automatic framecount function.