Skip to main content

alphaWorks  >  Forums  >  IBM Toolkit for MPEG 4  >  developerWorks

Determine when video has stopped    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is answered.

Permlink Replies: 5 - Pages: 1 - Last Post: Apr 16, 2009 6:15 PM Last Post By: bluestorm7 Threads: [ Previous | Next ]
bluestorm7

Posts: 3
Registered: Apr 16, 2009 01:27:34 PM
Determine when video has stopped
Posted: Apr 16, 2009 01:34:35 PM
 
Click to report abuse...   Click to reply to this thread Reply
Hi!,

We are having a problem with the player component and it would be great if someone could give us some ideas.

We need to know whether or not the video that is currently being played has finsished or if it is still playing. I am trying to play a file from a local folder.
I understand that setting the player in END_ACTION_STOP should stop the video after it is done.
The files being played were generated by our own camera system and do not contain any metadata about them.
Whenever I use the call getDuration() call I get a 0 and the player keeps playing even though it has finished playing the video (it stays on PLAYING when making the call getPlayerStateName())

->Is there any other way to know if the video has stopped?

->if not, how does the player obtains the duration of the file that is playing? does it check its metadata? there is no info about this on the API

Thanks in advance for your help
SteveWood

Posts: 160
Registered: Jul 25, 2005 12:18:31 PM
Re: Determine when video has stopped
Posted: Apr 16, 2009 05:24:31 PM   in response to: bluestorm7 in response to: bluestorm7's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi, for the player to stop playing it must know the content duration which it will read or determine from any metadata in the file. The value it reads or determines is what is passed back on the getDuration() call. So if your video file is just a raw video stream, while the player will play it, it will not automatically stop as it won't know the duration.

Steve
SteveWood

Posts: 160
Registered: Jul 25, 2005 12:18:31 PM
Re: Determine when video has stopped
Posted: Apr 16, 2009 05:36:18 PM   in response to: bluestorm7 in response to: bluestorm7's post
 
Click to report abuse...   Click to reply to this thread Reply
Sorry for splitting my reply in two parts but the forum was complaining "Disallowed content detected" that it would not post. So here is the other part I cut out in order to at least post something the first time around!

If you searched the forum for END_ACTION you will find a prior thread that discussed this a little. Since I am still having difficulty posting with an bit I copied from the thread I will just provide a link in the hope that I can then post this ok (although the forum here usually messes up on links too!!!)

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14083124

Look at the first part of the 4th message in that thread.

Hopefully between what I just wrote and this other bit I referenced it's made things a little clearer for you.

Steve
bluestorm7

Posts: 3
Registered: Apr 16, 2009 01:27:34 PM
Re: Determine when video has stopped
Posted: Apr 16, 2009 05:55:50 PM   in response to: SteveWood in response to: SteveWood's post
 
Click to report abuse...   Click to reply to this thread Reply
Thanks for your quick response!

I did check this thread and was quite usefull. However, I still have the problem.

-Do you know what exact metadata is the player looking for? (are they the default MPEG4 metadata... like MOV files?)

I can modifiy the way we write our files so that I can add that metadata at the end. I will just like to ensure before I jump into it

Thanks again for your help,
SteveWood

Posts: 160
Registered: Jul 25, 2005 12:18:31 PM
Re: Determine when video has stopped
Posted: Apr 16, 2009 06:07:11 PM   in response to: bluestorm7 in response to: bluestorm7's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi, if for the video is contained in an mp4 file, a mov file or an avi file then the player will be able to get the duration from the standard metadata that describes the tracks/video in those files. I think the issue with the duration is really only for raw video bitstreams where the file simply just has the compressed bits of the video.

If it's a raw video bitstream you have then you can use AVGen to create an mp4 file from it which should then get the duration. Since AVGen is an authoring component in the toolkit it spends the time going through the raw video file looking at the frame information to determine the duration which it can then put in the mp4 file as part of the metadata of that container.

Clearer now I hope...

Steve
bluestorm7

Posts: 3
Registered: Apr 16, 2009 01:27:34 PM
Re: Determine when video has stopped
Posted: Apr 16, 2009 06:15:54 PM   in response to: SteveWood in response to: SteveWood's post
 
Click to report abuse...   Click to reply to this thread Reply
Thanks for your help!
I will look into AVgen and metadata stuff.

Point your RSS reader here for a feed of the latest messages in all forums