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.

 
Total Length Of A Video, How to get duration of the video
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
6_6_6
Posted: Mar 9 2005, 07:50 PM


Unregistered









Hello,

I am trying to extract segments from avi files through job control scripts.

When I use VirtualDub.video.SetRange(X,Y), I would need the duration of the video to get end of the extracted segment.

Explanation of SetRange is:

"The start offset is measured in milliseconds from the beginning, and the end offset is in milliseconds from the end. Yes, I know this is stupid."

I couldn't agree more! But program is lovely.

Since I am using a perl program to feed in start and end time slices, I would like to know a way to calculate the duration of the video in order to obtain the END of the slice.

I tried using an external program mediainfo. However, this is not accurate. It shows playtime as 1h 27m while in fact it is 1h 27m 44s.

Is there a way to get the length of the video through vdub? If not, how can I do that?

Thanks for your time!
 
  Top
6_6_6
Posted: Mar 9 2005, 11:10 PM


Unregistered









AVIscan from http://aviscan.freezope.org is giving me video length precisely.
Thank you!



 
  Top
DarrellS
Posted: Apr 9 2005, 06:08 PM


Advanced Member


Group: Members
Posts: 567
Member No.: 1061
Joined: 28-November 02



Just go to the last frame in Virtualdub and get the length of the movie.

1:27.666
 
     Top
phaeron
Posted: Apr 9 2005, 10:50 PM


Virtualdub Developer


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



There are actually two ways to cut video in VirtualDub at the script level. One is the edit list (subset), which consists of a set of frame ranges, and the other is the start/end bounds set by SetRange(). What gets processed is the intersection of the two. If you have absolute frame numbers, do SetRange(0,0) and then use the subset instead.
 
    Top
dEf
Posted: Apr 14 2005, 11:21 AM


Unregistered









hello
i'm trying to do similar thing (select few frames from start of the video and save image seq), but im not able to make the selection
phaeron please could you explain your advice? i haven't found a way how to use combination of video.setrange and subset.addframe to make the selection let's say 50 miliseconds from start of the video. do i have to pass the clip length/frames count to the vdscript?
thanks
 
  Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
4 replies since Mar 9 2005, 07:50 PM Track this topic | Email this topic | Print this topic

<< Back to Newbie Questions