PDA

View Full Version : Stoping a video at a particular spot


Zeev
12-27-2003, 06:40 PM
It is easy to seek to a particular position in a video and then play from there. Is there a way of stopping the video at a particular spot? Essentially it is desired to be able to play a video from time1 to time2. How can that be done?

Corey
12-27-2003, 06:50 PM
Hi. If you read the video object section in the help file it will answer all your questions and provide examples, i.e. http://www.indigorose.com/webhelp/ams50/Program_Reference/Objects/Video/Actions.htm

In general you will find that to be the best source for basic info on any object and/or its actions...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Zeev
12-28-2003, 01:19 AM
I did read carefully each of the actions that are possible for a video object. I could find nothing that allows me to seek to a certain position and then to play for a predetermined length of time.

Thats too bad. It would be nice to just have one long video file and just play segments in it. Instead, it looks like I have to cut up the video file and play each individually.

What am I missing here?

eric_darling
12-28-2003, 01:54 AM
Try combining a few concepts in programming.

1) Video.GetCurrentPos (http://www.indigorose.com/webhelp/ams50/Program_Reference/Actions/Video.GetCurrentPos.htm)
2) Page.StartTimer (http://www.indigorose.com/webhelp/ams50/Program_Reference/Actions/Page.StartTimer.htm)
3) Video.Seek (http://www.indigorose.com/webhelp/ams50/Program_Reference/Actions/Video.Seek.htm)

AMS is highly event based. Fortunately, with 5.0, you now have access to a page timer which, when called to run a certain function, like getting a video's current position, can do so on a very regular (ie. once every second) interval. So, you have a little script check the video's position, and jump to another page or load another video or whatever once it reaches a specified time into the file.

Conversely, through cunning use of Video.Seek, you can have a "chapter" button jump to a specific second in a video clip even more easily. Of course, this functionality has been part of AMS since 4.0, and is not new.

In any case, creativity in building your AMS projects is required as much as is your creativity in creating the elements that will appear there, whether audio, video, still graphics or written word.

I still contend that there is very little AMS won't do. You just need to find the way.

Zeev
12-28-2003, 02:21 AM
Eric, thank you so much for the quick reply and excellent information. This is certainly a doable approach.

I have to make sure that no other events affect being able to get to the timer event on time and stopping the video at the right place. If there is any delay in the program getting to the timer event, the playing could go just beyond the stop point.

I could try to have short timer events (1/4 second or so). But I am not sure yet what will happen to performance with all the checking that would be going on. But it is worth a try.

Thanks again.

Corey
12-28-2003, 03:37 AM
4 checks per second won't slow down any modern computer although for this application once per second would likely fit the bill...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

eric_darling
12-28-2003, 12:15 PM
Corey's right. Experience has shown me that the Page Timer is easy on system resources. You'd think running even a small amount of code a few times a second would drag down performance quickly, but you will be surprised at how well it works without a hitch. You can always push beyond the limits on the lower end systems first, so be sure to test your project on the lowest end system that you want to qualify for your project.

Zeev
12-28-2003, 07:35 PM
Thank you Eric and Corey.

It worked great.

I needed to be able to go through a video and determine the start and end points of many segments.

I created a timer event that would occur every 33 milliseconds. That allowed me to get a timer event for every frame in my video. Then I created a Label object. Every time the event hit, I filled in the Label text with a the time code in hh:mm:ss.ff format. As the video played, you can see the time counter (with frames) rolling.

Now I can put in the code to stop it at a predetermined location.

You guys are great. Thanks again.

eric_darling
12-28-2003, 10:22 PM
Neat idea with the timecode display, Zeev! Glad you got it working the way you want.