Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
"go To Last Keyframe" How To Do?, (using script)
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
DmitryF
  Posted: Aug 27 2010, 07:44 AM


Newbie


Group: Members
Posts: 1
Member No.: 28377
Joined: 27-August 10



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!
 
     Top
phaeron
Posted: Aug 29 2010, 09:40 PM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



Just use VirtualDub.subset.Delete() instead.
 
    Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
1 replies since Aug 27 2010, 07:44 AM Track this topic | Email this topic | Print this topic

<< Back to Advanced Video Processing