PDA

View Full Version : How to retrieve start and end infos from job list ?


Le Furet
11th May 2003, 12:43
Hello

I want to retrieve start and end frame numbers of the video I'm working on. I don't see a easy way to do it. I tried to retrieve these infos in the .jobs file. I found :

// $start_time 01c31760 57ec9e90
// $end_time 01c3176a c40d3d00


It smells like hexadecimal, but once converted in decimal, It gives far too big numbers to represent anything.

Could someone tell me how to interpret these numbers ?

Suiryc
11th May 2003, 19:34
Yes those are hexadecimal values, and represent a FILETIME value.
Here is the code used in VirtualDub :
FILETIME ft;
if (2 != sscanf(t, "%08lx %08lx", &ft.dwHighDateTime, &ft.dwLowDateTime))
throw "invalid start time";
if (!ft.dwHighDateTime && !ft.dwLowDateTime)
memset(&job->stStart, 0, sizeof(SYSTEMTIME));
else
FileTimeToSystemTime(&ft, &job->stStart);
(job->stStart is the time expressed in SYSTEMTIME)
A similar treatment is made for the ending time.
Now here is what MSDN tell about FILETIME :
The FILETIME structure is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601.

typedef struct _FILETIME {
DWORD dwLowDateTime; /* low 32 bits */
DWORD dwHighDateTime; /* high 32 bits */
} FILETIME, *PFILETIME, *LPFILETIME;
And here is about SYSTEMTIME :
The SYSTEMTIME structure represents a date and time using individual members for the month, day, year, weekday, hour, minute, second, and millisecond.

typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
As you can see in VirtualDub code you can convert a FILETIME value to a SYSTEMTIME one using the FileTimeToSystemTime function.

Le Furet
11th May 2003, 20:52
Thanks a lot for the long and detailled (not sure it's english, but as you're french, you'll understand ^^) answer, but It looks like I didn't look at the right line.

These lines seems to point at the date when encoding began and ended.

I want to find the start and end of the selection I encoded, which is quite different.

But strangely, I can't find where this info is stored. Here's the lines of the .jobs file concerning one of the film (this is Nandub, not VDub, but I think it works the same way) :


//--------------------------------------------------
// $job "Job 1"
// $input "E:\video\WIP\Masters of Russian Animation vol. 3\vobz\all.avs"
// $output "E:\video\WIP\Masters of Russian Animation vol. 3\Tale of Tales\t2.avi"
// $state 2
// $start_time 01c31760 57ec9e90
// $end_time 01c3176a c40d3d00
// $script

VirtualDub.Open("E:\\video\\WIP\\Masters of Russian Animation vol. 3\\vobz\\all.avs",0,0);
VirtualDub.audio.SetSource(1);
VirtualDub.audio.SetMode(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();
VirtualDub.audio2.SetSource(1);
VirtualDub.audio2.SetMode(0);
VirtualDub.audio2.SetInterleave(1,500,1,0,0);
VirtualDub.audio2.SetClipMode(1,1);
VirtualDub.audio2.SetConversion(0,0,0,0,0);
VirtualDub.audio2.SetVolume();
VirtualDub.audio2.SetCompression();
VirtualDub.video.SetDepth(24,24);
VirtualDub.video.SetMode(1);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(25442,6621288);
VirtualDub.video.SetDivX(1225,9999);
VirtualDub.video.SetQualityControl(0,0,0,0);
VirtualDub.video.SetMotionDetection(15,15,300,300);
VirtualDub.video.SetCrispness(100,0);
VirtualDub.video.SpaceKF(100);
VirtualDub.video.InternalSCD(100);
VirtualDub.video.SetMinKBPS(270);
VirtualDub.video.SetCurveFile("E:\\video\\WIP\\Masters of Russian Animation vol. 3\\1st_1225_kbps_270_min.stats");
VirtualDub.video.SetCurveMcFactor(0);
VirtualDub.video.SetCurveCompression(0,0);
VirtualDub.video.SetCurveFilter(0,6000);
VirtualDub.video.SetCurveCredits(0,270);
VirtualDub.video.SetLumaCorrectionAmp(0,10,30);
VirtualDub.video.SetCurveRedist(0);
// VirtualDub.video.CalcCurveCompression();
VirtualDub.video.SetCompLevelsMain(2,16);
VirtualDub.video.SetCompLevelsA(300,3,16);
VirtualDub.video.SetCompLevelsB(300,4,16);
VirtualDub.video.SetCompLevelsC(300,5,16);
VirtualDub.video.SetCompLevelsD(300,6,16);
VirtualDub.video.SetCompLevelsE(300,7,16);
VirtualDub.video.SetCompLevelK(2,4);
VirtualDub.video.SetBitsReservoir(0,35,30,70,10,0);
VirtualDub.video.SetLowBrCorrection(0,0);
VirtualDub.video.NoAVIOutput(0);
VirtualDub.video.GenStats("",0);
VirtualDub.video.SetEncodingControl("E:\\video\\WIP\\Masters of Russian Animation vol. 3\\1st.ecf");
VirtualDub.video.filters.Clear();
VirtualDub.subset.Delete();
VirtualDub.brc.Set( 0, 645 );
VirtualDub.brc.Set( 1, 1 );
VirtualDub.brc.Set( 2, 128 );
VirtualDub.brc.Set( 3, 0 );
VirtualDub.brc.Set( 4, 1 );
VirtualDub.SaveAVI("E:\\video\\WIP\\Masters of Russian Animation vol. 3\\Tale of Tales\\t2.avi");
VirtualDub.Close();

// $endjob
//

Suiryc
12th May 2003, 01:23
Well the information you want (at least a part of it) is then in the video.SetRange function.
The first number represents the starting time of your selection (expressed in ms), and the second number the ending offset (i.e. the time between your selection end and the actual clip end) in ms.
For example in the pasted job "VirtualDub.video.SetRange(25442,6621288);" should mean you selected video from time 00:00:25.442 to the end of your clip minus 01:50:21.288.
So actually you don't know the real ending time of your selection.

Le Furet
12th May 2003, 07:45
Thanks a lot.