Skip to main content

Locating HDMV Playlist error

15 replies [Last post]
tilemahosg
Offline
Joined: 2008-04-08
Points: 0

Hello.

Here's what I tried using BDLocator but it fails....After the initXlet method in which I initialize the HSceneFactory, HSceneTemplate and HScene, I have startXlet method as following.

public void startXlet() {
scene.setVisible(true);
while (true) {
try {
BDLocator bdloc = new BDLocator("bd://1.PLAYLIST:00008.MARK:00000");
plcc.selectPlayList(bdloc); //plcc is an object of PlayListChangeControl
player.start();
player.addControllerListener(this);

I don't have any idea why this thing doesn't starts. Doesn't bd url refers to the disc with DiscID 1, the Playlist with PlayListID 00008 and mark with MarkID 00000? This Playlist is an HDMV Playlist, already created. What about plcc? Should it be initialized? With what?

Can I have any help?

Thanks,
Goudas Tilemahos.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ihupont
Offline
Joined: 2010-03-03
Points: 0

Hi all!

I am trying to develop a (a priori!) very simple BD-J application for PS3 whose objective is to show on the screen a jmf player reproducing a .mp4 video file in a scene container. I have tried the code here above proposed by tilemahosg with the corrections by Chihiro_Saito… unsuccessfully.

I think maybe my problem is due to one of these issues:

- I am creating the PLAYLIST and STREAM directories of the BDMV root directory of my blu-ray disc thanks to the soft multiAVCHD (http://multiavchd.deanbg.com/tutorial.php): I just add the media (in this case, my .mp4 video files) and start the blu-ray disc building process. Then, the soft outputs the BDMV directory and I copy the obtained PLAYLIST and STREAM sub-directories into my own BDMV directory (where my BD-J application is located). Is this process correct? Do I have to do something more? I have seen that some files with .clpi extension are also created by the software, but I’m not able to understand what they mean and whether they are related to the playlist or not.
- When I debug my project, I don’t have any Exception. So my player seems to be correctly created and started, and my bdlocator seems to point to an existing playlist. I am even able to get the events related to the player life-cycle (startEvent, prefetchEvent, etc.). So maybe the problem could be related to the way I paint the visualComponent and controlComponent of the player in the screen? However it seems strange, since my code is exactly the same that the one proposed above. Do I need any permission in my PRF file to achieve it?
- In a more general way, do I need to establish any extra permission/configuration to use jmf players and playlists in my blu-ray disc?
- Finally, could my problem be related to the codecs that PS3 is able to reproduce? I use .mp4 video files…

I would be very grateful if someone could help me with that problem. I am really in a hurry with that BD-J project and not able to make any interesting progress.
Thanks in advance ;-) Best,

ihupont

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

Hi Goudas Tilemahos,

Give this a try.

Have your xlet Implement javax.media.ControllerListener

Then add this code in your Xlet (or maybe a new Class, and call it. You will want to keep a local copy of the player object that is created below)

String bdUrl = (new BDLocator(null, -1, 0, -1, -1, null)).toExternalForm();
MediaLocator medialocator = new MediaLocator(bdUrl);
Player player = Manager.createPlayer(medialocator);

try
{
setUpControlsHere();
player.addControllerListener(this);
player.prefetch();
} catch (Exception e)
{

}

Then in the implemented method: controllerUpdate(ControllerEvent controllerevent) you can check for the StartEvent class and do any extra work you might need.

public void controllerUpdate(ControllerEvent controllerevent)
{
try
{
if (controllerevent instanceof StartEvent)
doStartWorkHere();
} catch (Exception e)
{

}
}

Let me know if this works. If it is not working let me know if the controllerUpdate is being called.

Good luck!

Denny B.
-------------------------------------------------------------------------------------------------------------
[i]NetBlender DoStudio Blu-ray Team - DSA - http://dostudio.netblender.com [/i]

tilemahosg
Offline
Joined: 2008-04-08
Points: 0

Thanks for the response Denny.

I haven't tried this code example, yet, but as I can see in the line where initializing the bdUrl string (String bdUrl = (new BDLocator(null, -1, 0, -1, -1, null)).toExternalForm();), u call the BDLocator method passing null, -1 or 0 values. How is it supposed to work? If I would like to call a Playlist with PlaylistID 00008 from disc, with DiscID 1, in what order should I put those IDs in order to have a result?

Thanks,
Tilemahos.

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

Hi Tilemahos,

Ok the parameters that make the BDLocator are the following:

Disc Id - This is null: Unless you are going to write an easy way to always get the id of the disc (its like a GUID) then this can be left null.

Title number - We use -1 for all references to the title number.

Play List # - this is the number of the playlist you want to play in your case it should be 8.

Play Item # - -1 means no play list item to use.

Mark # - (-1) means no marker (chapter) to play.

The last parameter can always be null.

So in your case to get it to work it would be:

String bdUrl = (new BDLocator(null, -1, 8, -1, -1, null)).toExternalForm();

Hope this helps,

Denny B.
-------------------------------------------------------------------------------------------------------------
[i]NetBlender DoStudio Blu-ray Team - DSA - http://dostudio.netblender.com [/i]

tilemahosg
Offline
Joined: 2008-04-08
Points: 0

Hi Denny.

I tried what you said, but I didn't got a good result. Either this doesn't work or I've made some mistakes in it. Here's my code...

public class XletviewJMFExample
extends HContainer
implements Xlet, ControllerListener {
private static final String VIDEO_URL_1
= "bd://1.PLAYLIST:00008.MARK:00000";

private static final String VIDEO_URL_2
= "bd://0.PLAYLIST:00013.MARK:00000";
private static final long serialVersionUID = 00001;
private HScene scene;
private XletContext context;
private Player player;

public void initXlet(XletContext ctx)
throws XletStateChangeException {
this.context = ctx;
HSceneFactory factory = HSceneFactory.getInstance();
HSceneTemplate hst = new HSceneTemplate();
hst.setPreference(HSceneTemplate.SCENE_SCREEN_DIMENSION,
new org.havi.ui.HScreenDimension(1, 1),
HSceneTemplate.REQUIRED);
hst.setPreference(HSceneTemplate.SCENE_SCREEN_LOCATION,
new org.havi.ui.HScreenPoint(0, 0),
HSceneTemplate.REQUIRED);
scene = factory.getBestScene(hst);
if (scene == null)
throw new XletStateChangeException("Can't create HScene");
Rectangle rect = scene.getBounds();
setBounds(rect);

scene.setVisible(false);
scene.add(this);
}

public void startXlet() {
scene.setVisible(true);
while (true) {
try {
String bdUrl = (new BDLocator(null, -1, 8, -1, -1, null)).toExternalForm();
MediaLocator medialocator = new MediaLocator(bdUrl);
player = Manager.createPlayer(medialocator);
player.addControllerListener(this);
player.setMediaTime(new Time(0));
player.prefetch();
player.setRate(1f);
player.start();
if (context != null){}
System.out.println("sleeping...");
Thread.sleep(10000);

System.out.println("stopping video 1");
player.stop();

Thread.sleep(5000);
System.out.println("deallocating video 1");
player.deallocate();

Thread.sleep(5000);
System.out.println("closing video 1");
player.close();

Thread.sleep(5000);
System.out.println("starting video 2");
player.addControllerListener(this);
player.start();

System.out.println("started video 2");
Thread.sleep(10000);

}
catch (NoPlayerException e){
e.printStackTrace();
}
catch (org.davic.net.InvalidLocatorException e){
e.printStackTrace();
}
catch (InterruptedException e){
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
}

}

public void pauseXlet() {
player.stop();
player.close();
player = null;
}

public void destroyXlet(boolean unconditional) {
player.stop();
player.close();
player = null;
if (scene != null) {
scene.setVisible(false);
scene.remove(this);
HSceneFactory.getInstance().dispose(scene);
}
scene = null;
}

public void controllerUpdate(ControllerEvent event) {
System.out.println("! " + event + " !");
if (event instanceof RealizeCompleteEvent) {
Component comp;
if ((comp = player.getVisualComponent()) != null) {
add(comp);
System.out.println("Added " + comp + " as a video component");
comp.setSize(720, 576);
setSize(720, 576);
validate();
repaint();
}
}
else if (event instanceof EndOfMediaEvent) {
player.setMediaTime(new Time(0));
player.start();
}
}
}

Thanks anyway.
Tilemahos.

chihiro_saito
Offline
Joined: 2006-11-08
Points: 0

Hi Tilemahos,

Could you elaborate on "didn't get a good result"?

I adjusted the playlist numbers for the hdcookbook assets and ran your code on one of the pc players, and it seems to be working OK.

Best,
Chihiro

chihiro_saito
Offline
Joined: 2006-11-08
Points: 0

Just to clarify - I also removed the infinite loop in your startXlet() section for testing; it's a very bad idea to never return from this method.

tilemahosg
Offline
Joined: 2008-04-08
Points: 0

Hello Chihiro.

By saying "I didn't get a good result", I mean that my player couldn't start displaying something... I tried again removing the infinite loop in the startXlet() method, but I got the same result...The mistake must be somewhere else, except for the code, so I'm gonna keep on searching.

Thanks for help.
Tilemahos.

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

Hi Tilemahos,

Our extensive early access team had a wide variety of PCs and mac's. We logged more then a dozen playback issues that didn't have anything to do with code but the development environment. Would you be able to tell us a bit about your workstation?

Cheers,

Denny B.
-------------------------------------------------------------------------------------------------------------
[i]NetBlender DoStudio Blu-ray Team - DSA - http://dostudio.netblender.com [/i]

tilemahosg
Offline
Joined: 2008-04-08
Points: 0

Hello Denny.

I'm using a laptop with Intel Core 2 Duo T5600 processor at 1.83, 2GB RAM 100GB HDD, with no Blu-Ray Player (I wish to have an image on my pc and then burn it into a Blu-Ray Disc),NVidia GeForce Go 7600, 17'' display screen, Windows XP Professional Greek and at the time I posted this question I was experimenting on Scenarist. Now I have downloaded the trial version of DoStudio.
Since you're a member of DoStudio Team, I have a question. From what I've read in help file, the BD-J part, is only supported through 3rd party applications. I tried to make an application in DoStudio and the HDMV part is spectacular. It is amazing with how few moves you can have a wonderful result. But how can I make the connection between HDMV part and BD-J part(import an Xlet or JAR file)?

Thanks,
Tilemahos.

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

Hi Tilemahos,

I have good news, the support for BD-J applications is part of the release but it is not exposed. We'd love to work with you if you are interested in writing a plugin for DoStudio and this will expose the JAR import feature.
At the moment DSA will accept a plug in which is a JAR file that implements certain interfaces along with an Action XML file (if you are familiar with DoStudio's actions). We can take this offline and I can talk to you about this is in greater detail. dbreitenfeld at netblender dot com.
I am glad you like the menu creation part of DoStudio and even though it acts like HDMV it is all 100% BD-J. If you look in your JAR folder you'll see the .jar, the .nbi file and probably one or two .aca files.

Denny B.
-------------------------------------------------------------------------------------------------------------
[i]NetBlender DoStudio Blu-ray Team - DSA - http://dostudio.netblender.com [/i]

bashlaev
Offline
Joined: 2008-05-05
Points: 0

Hi Denny,

I have also downloaded a DoStudio trial version and have built a sample project with it. I have also been wondering how to put my sample BD-J application into a disc compilation. I would try to use HDCookbook way, but the problem is your authoring engine is evidently a BD-J application and I wasn't able to find any information on how to collaborate with it to make it launch my sample app. Is there any documentation on how to do it?

Thanks in advance, Yuriy.

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

Hi Yuriy,

Yes as you've noticed DoStudio runs in BD-J for the entire disc. Currently DoStudio will not jar files, we are working on publicly releasing our plug-in program that would allow you to include custom code for things like, games, animations, network features, and to control part of the DoStudio BD-J engine. The plug-in program also includes a library that allows you to build applications without the need for the bd-j classes. I can let you know when we release this to the public if you want?

Cheers,

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

bashlaev
Offline
Joined: 2008-05-05
Points: 0

Hi, Denny,

Thanks for the answer. Can you tell me the approximate time of release? I mean, is it a matter of days, weeks or months?

Thanks, Yuriy.

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

Hi Yuriy,

This will be closure to a month from now, if you need something sooner you can always contact me offline dbreitenfeld [at] netblender [dot] com. Is your jar for the menu or for a bonus feature?

Cheers,

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