Printable Version of Topic
Click here to view this topic in its original format
Unofficial VirtualDub Support Forums > Advanced Video Processing > "go To Last Keyframe" How To Do?


Posted by: DmitryF Aug 27 2010, 07:44 AM
Hi All!

I need to join a lot of files captured from my cam grouping them by date/scene etc.
I could easily doing it by next scenario:

1. Open file
2. Select range <Video start> - <last keyframe> (otherwise audio become out of sync)
3. Save as with "Add to jobs" flag
Continue 1-3 till my mind and hands are in pain... smile.gif
4. Join all files of group together
5. Do all again to process a next group

I could use a batch file which do it for me by preparing a VirtualDub script and run it
Script (taken from a "job" file):
CODE
// $job "Job 15"
// $input "D:\Video_converted\scene'20080823 18.31.00.avi"
// $output "D:\Video_converted\_scene'20080823 18.31.00.avi"
// $state 2
// $start_time 01cb455e b95922a0
// $end_time 01cb455e b9d04e70
// $script

VirtualDub.Open("D:\\Video_converted\\scene'20080823 18.31.00.avi","",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.audio.EnableFilterGraph(0);
VirtualDub.video.SetInputFormat(0);
VirtualDub.video.SetOutputFormat(7);
VirtualDub.video.SetMode(0);
VirtualDub.video.SetSmartRendering(0);
VirtualDub.video.SetPreserveEmptyFrames(0);
VirtualDub.video.SetFrameRate2(0,0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,2000);
VirtualDub.video.SetCompression();
VirtualDub.video.filters.Clear();
VirtualDub.audio.filters.Clear();
VirtualDub.subset.Clear();
VirtualDub.subset.AddRange(0,170);
VirtualDub.project.ClearTextInfo();
VirtualDub.project.AddTextInfo("ISFT", "MEncoder Sherpya-MT-SVN-r31878-4.4.0");
// -- $reloadstop --
VirtualDub.SaveAVI("D:\\Video_converted\\_scene'20080823 18.31.00.avi");
VirtualDub.audio.SetSource(1);
VirtualDub.Close();

// $endjob
//
//--------------------------------------------------



The only differences between jobs are:
1. filename (I will do it by batch file)
2. VirtualDub.subset.AddRange(0,<LAST KEYFRAME NUMBER HERE>);

But I couldn't find how to get the last keyframe of a file opened inside a script.

Gurus, help me, please!

Thank you in advance!

Posted by: phaeron Aug 29 2010, 09:40 PM
Just use VirtualDub.subset.Delete() instead.

Powered by Invision Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)