Skip to main content

Unable to Playing Video files on OCAP-RI

6 replies [Last post]
lanore
Offline
Joined: 2008-07-30
Points: 0

Hello,

I'm trying to develop a VOD application on Tru2Way RI platform.

However, I can't create an javax.media.Player instance.
(Video files that are in the '../resources/tunedata' directory was used.)

The code and outputs are like this

-------------------- Code ---------------------------------------------------------
url = new URL("http://localhost:18080/Temp/background.mpg");
dataSource = Manager.createDataSource(url);

// For Debugging - Start
System.out.println("######## Contents Type : "+dataSource.getContentType());
System.out.println("######## mimeTypeToPackageName : "+ContentDescriptor.mimeTypeToPackageName(dataSource.getContentType()));

Enumeration e = Manager.getHandlerClassList(ContentDescriptor.mimeTypeToPackageName(dataSource.getContentType())).elements();

while(e.hasMoreElements())
{
Object obj = e.nextElement();
System.out.println("######## Handler : "+obj);
}
// For Debugging - End

player = Manager.createPlayer(dataSource);

-------------------- Console Output ---------------------------------------------------------

######## Contents Type : video/mpeg
######## mimeTypeToPackageName : video.mpeg
######## Handler : media.content.video.mpeg.Handler
######## Handler : org.cablelabs.impl.media.content.video.mpeg.Handler
javax.media.NoPlayerException
at javax.media.Manager.createPlayer(Manager.java:729)
at javax.media.Manager.createPlayer(Manager.java:357)
at org.ocapproject.xlet.MovieView.initPlayer(MovieView.java:57)
at org.ocapproject.xlet.MovieView.(MovieView.java:32)

------------------------------------------------------------------------------------------------------

Do I need to use another type of Video file?

Message was edited by: lanore

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cpratt
Offline
Joined: 2008-12-18
Points: 0

Note that while OCAP supports drip feed data sources, the RI does not currently.

RI Platform support for drip feed should be available in a future release.

lanore
Offline
Joined: 2008-07-30
Points: 0

Thank you for the information.... :)

scottdeboy
Offline
Joined: 2009-02-02
Points: 0

The OCAP spec defines support for a drip feed player and datasource (see the OCAP spec section 16.2.1.5.9, as well as MHP 1.0.3 sections 7.1.3 and 11.11.9). A drip feed datasource allows you to 'feed' individual MPEG2 I and P frames to a decoder (not B frames).

See OCAP section 9.1 for a correlation table describing the supported media formats.

DripFeedDataSource is the only mechanism supporting playback of standalone MPEG2 video files. The OCAP spec does not include support for other video formats (AVI, etc).

There is an example xlet which demonstrates how to use a DripFeedDataSource in:
$OCAPROOT/apps/qa/org/cablelabs/xlet/DripFeedTest/DripFeedTestXlet.java

lanore
Offline
Joined: 2008-07-30
Points: 0

Thank you scottdeboy

I was able to create the instance of the Player, and start playing.

However the RI emulator screen doesn't display anyting. (It shows just black screen).

Do I miss anything?

The modified code is

--------------------------------- Code ------------------------------------------------

MediaLocator mediaLocator = new MediaLocator("dripfeed://localhost:18080/Temp/background.mpg");
dataSource = Manager.createDataSource(mediaLocator);

player = Manager.createPlayer(dataSource);
player.realize();
while (!(player.getState() == Player.Realized)) {}

player.prefetch();

while(!(player.getState() == Player.Prefetched)) {}

player.start();

-------------------------------------------------------------------------------------------

lanore
Offline
Joined: 2008-07-30
Points: 0

Does any body know what types of Video file are supported by the OCAP-RI?

I think there is an implementation of Video file.

There is "org.cablelabs.impl.media.content.video.dvb.mpeg.drip.Handler" class in the ocap-classes.jar file, that looks like an implementation of Video file

However, I couldn't find any Video file types that is matched with this Player(Handler).

Creating an instance of the class is also seems to be not possible.

I get "ClassNotFoundException" When I try to create an instance of the org.cablelabs.impl.media.content.video.dvb.mpeg.drip.Handler class instance.
This is weird, because the ocap-classes.jar(containg the class file) file is in the class path.

greg80303
Offline
Joined: 2008-07-03
Points: 0

I can help answer part of your question. As an OCAP Xlet, you can not access org.cablelabs.impl.media.content.video.dvb.mpeg.drip.Handler because it is not a public OCAP API as specified by OCAP, MHP, JavaTV, or PBP. This is an internal implementation class. Access to any APIs outside the ones that are publicly defined is explicitly denied by the specifications.

The goal of OCAP is to define a middleware such that a single application will run exactly the same no matter who created the middleware implementation.

I'm not very familiar with JMF, so I can't help with your underlying question. Hopefully, someone else will jump on here and help out.

Greg