Skip to main content

Clear the video plane OR more precise video playback events?

6 replies [Last post]
sfritzinger
Offline
Joined: 2008-02-05
Points: 0

All,

I'm playing 2 streams back to back and am currently getting the following behavior:

- Stream 1 plays
- Stream 1 ends (I get javax.media.EndOfMediaEvent)
- At this point, the last frame from Stream 1 stays on the screen
- I begin playback of Stream2
- I get javax.media.StartEvent for Stream2
- 2-3 seconds passes... (last frame from Stream 1 is still on the screen)
- Stream 2 begins to play

I'm looking for a way to either:
- Clear the video plane so that the last frame of Stream 1 is no longer visible
or
- More precisely detect the start of Stream 2 (no 2-3 second delay between event and visual playback start) so that I can draw a black rect in the graphics plane between the end of Stream 1 and true beginning of Stream 2

Thanks!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ijcoder
Offline
Joined: 2008-06-15
Points: 0

Hi sfritzinger:

If you want to know a bit more precisely the time that a stream starts playing, perhaps processing org.davic.media.MediaPresentedEvent is better than processing javax.media.StartEvent.

In the GEM Javadoc, org.davic.media.MediaPresentedEvent has the following description:

"Generated as soon as possible after new content is actually being presented to the user, regardless of whether a state change has taken place in the player or not."

Good luck!

sfritzinger
Offline
Joined: 2008-02-05
Points: 0

ijcoder,

Thanks for the reply!

I don't receive that event in the ControllerListener, PlaybackListener, or MediaTimeListener interfaces. Do I need to register for it?

I have gone through all of the API's for the available player control classes (AngleControl, PlaybackControl, MediaTimeEventControl, etc...) and have implemented each of the required interfaces but do not receive MediaPresentedEvent in any of them :-(

Can you provide an additional pointer?

Thanks!

ijcoder
Offline
Joined: 2008-06-15
Points: 0

Hi sfritzinger:

Yes, the MediaPresentedEvent is passed on to the ControllerListener's that were registered with a Player through its addControllerListener method.

Are you testing your application using PowerDVD? Because I also had problems catching MediaPresentedEvent with the version of PowerDVD that still allows playback from hard drive; whereas TotalMedia Theatre and PS3 both seem to work fairly happily.

gent2k7
Offline
Joined: 2007-06-25
Points: 0

You could also add a black image at the end of the 1st stream, so that the player will stays on it until it reaches the next stream.
Or Björn's solution is also a good way to achieve your goal.

bjoern_minkmar
Offline
Joined: 2007-06-11
Points: 0

Hi sfritzinger,

as far as i know there is no way to clear the video plane. So once Stream 1 has
reachend its end, the last frame will stay on the screen.

To detect if Stream 2 has already started you can use

- javax.media.StartEvent or
- PlaybackMarkEvent from the bluray package

In order to use the second approach, you have to add playback marks to your video stream and mux the video. This can be done in a software like Sonic Scenarist.
Once you have done so, you will have to implement the PlaybackListener interface in the class where you want to control the playback of the video.

Overwriting the markReached() method will hopefully bring you closer to your goal.
There you can check if the appropriate mark has been reached by using the getMark() method.

The playback mark will only be reached if the video is actually being played back.
That's when you can clear the graphics plane again and let the user enjoy the Stream 2.

Hope this helps,
Björn

dbreitenfeld
Offline
Joined: 2007-03-18
Points: 0

Hi Sfritzinger,

I don't think this is a possibility at least we haven't seen it. Maybe someone else here has figure it out.

Cheers,

Denny B.
---------------------------------------------------------------------------------------------------------------------------------------
NetBlender DoStudio Blu-ray Team | http://dostudio.netblender.com | http://www.clearblu.org