Skip to main content

PIPControl StreamNotAvailableException

3 replies [Last post]
mochilete
Offline
Joined: 2011-10-18
Points: 0

Hi!

I`m developing a blu-ray application and i need play a video using picture in picture function. I have 2 videos in one M2TS file. this file was created using a program called tsmuxer. this program generate a M2TS file with two different streams inside (Main and secundary video).

I have created a class that takes charge of managing the process of creation of the player. In this class, i create the BDlocator, select the playlist that i want to play, create de player, etc. The code is this:

bdLocator = new BDLocator("bd://PLAYLIST:00000");
locator = new MediaLocator(bdLocator);

Player p1 = Manager.createPlayer(locator);
p1.addControllerListener(this);
p1.prefetch();
p1.start();

this class contains a method called changePIP that gets the PIPControl and changes the video stream. the code is this:

public void ChangePIPStream(int nNewStream) {

try{

javax.media.Control acontrol[] = p1.getControls();
for (int ii = 0; ii < acontrol.length; ii++) {

if (acontrol[ii] instanceof PiPControl) {
pipCtrl = (PiPControl)acontrol [ii];
}
}
if (pipCtrl != null) {
try {
pipCtrl.addPiPStatusListener(this);

pipCtrl.selectStreamNumber(nNewStream);
pipCtrl.setDisplay(true);

} catch (Throwable e) {
Startitup.log(e);
}
}
}catch(Throwable a){
Startitup.log(a);
}
}

this method is called when i want to change video to Picture in Picture. But isn't work correctly. This method throws this exception:

org.bluray.media.StreamNotAvailableException]
at-com.cl.bdj.media.control.BasicPiPControl.selectStreamNumber(Unknown-Source)
at-show_video.VideoLoader.ChangePIPStream(Unknown-Source)
at-videos.video.ReproductorVideo.changePIP(Unknown-Source)
at-com.oditofi.motor.views.CarreraView.doEnter(Unknown-Source)

i print all the information about PIPControl before the method throws the exception using this method.

private void printControlPIP(PiPControl pipCtrl){

Startitup.log("PIPControlInformation----------------------------------------------");
Startitup.log("controlComponent:" +pipCtrl.getControlComponent());
Startitup.log("display:" + pipCtrl.getClipRegion() );
Startitup.log("InputVideoSize:" + pipCtrl.getInputVideoSize() );
Startitup.log("ActiveVideoArea:" + pipCtrl.getActiveVideoArea() );
Startitup.log("GETDisplay:" +pipCtrl.getDisplay());
Startitup.log("InputVideoSize:" +pipCtrl.getInputVideoSize());
Startitup.log("VideoSize:" +pipCtrl.getVideoSize());
Startitup.log("fullscreen:" +pipCtrl.getFullScreen());
Startitup.log("clipRegion:" +pipCtrl.getClipRegion());
Startitup.log("VideoAreaOnScreen:" +pipCtrl.getActiveVideoAreaOnScreen());
Startitup.log("TotalVideoAreaOnScreen:" +pipCtrl.getTotalVideoAreaOnScreen());
Startitup.log("IsSyncedDuringTrickPlay:" +pipCtrl.getIsSyncedDuringTrickPlay());
Startitup.log("getVerticalScalingFactors:" +pipCtrl.getVerticalScalingFactors());
Startitup.log("getHorizontalScalingFactors():" +pipCtrl.getHorizontalScalingFactors());
Startitup.log("PositioningCapability():" +pipCtrl.getPositioningCapability());
Startitup.log("supportsClipping():" +pipCtrl.supportsClipping());
Startitup.log("StreamNumber:" + pipCtrl.getCurrentStreamNumber());
Startitup.log("------------------------------------------------------------------");
}

And this is the information that it prints:

controlComponent: null
display: java.awt.Rectangle[x=0,y=0,width=0,height=0]
InputVideoSize:java.awt.Dimension[width=0,height=0]
ActiveVideoArea:org.havi.ui.HScreenRectangle@ba02bd4d
GETDisplay:false
InputVideoSize:java.awt.Dimension[width=0,height=0]
VideoSize:java.awt.Dimension[width=0,height=0]
fullscreen:false] START.
clipRegion:java.awt.Rectangle[x=0,y=0,width=0,height=0]
VideoAreaOnScreen:org.havi.ui.HScreenRectangle@64d50a93
TotalVideoAreaOnScreen:org.havi.ui.HScreenRectangle@e6997311
IsSyncedDuringTrickPlay:false
getVerticalScalingFactors:[F@9157a78d]
getHorizontalScalingFactors():[F@82b92c9e]
PositioningCapability():1
supportsClipping():true
StreamNumber:-1

The question is: Why cannot PipControl change of stream? why this exception is thrown? Is video created badly? Is this method of doing Picture in Picture correct?

Thanks for all and sorry for my english.

Cheers

Mochilete

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joe Rice Guest
Offline
Joined: 2011-11-18
Points: 0

Hi Mochilete,

How did you create the PlayList? You'll need to reference the secondary video in the playlist so that it appears in the STN table, which is what provides the reference stream IDs for BD-J to operate on.

The stream would also need to be referenced in an in-mux subpath (subpath type 7) with associated SubPlayItem. and there are various pip metadata settings, etc. Do you have access to the BD-ROM spec? As the complexity of PiP is more on the HDMV side than BD-J, if you're not using a commercial tool to create the PlayList, having the spec as a reference would be useful.

I can see if I have a simple example PlayList I could provide as a reference. Maybe with the HDCookbook tools that would be enough to help.

Joe

On Nov 29, 2011, at 2:25 AM, forums@java.net wrote:

> Hi!
>
> I`m developing a blu-ray application and i need play a video using picture in
> picture function. I have 2 videos in one M2TS file. this file was created
> using a program called tsmuxer. this program generate a M2TS file with two
> different streams inside (Main and secundary video).
>
> I have created a class that takes charge of managing the process of creation
> of the player. In this class, i create the BDlocator, select the playlist
> that i want to play, create de player, etc. The code is this:
>
> bdLocator = new BDLocator("bd://PLAYLIST:00000");
> locator = new MediaLocator(bdLocator);
>
> Player p1 = Manager.createPlayer(locator);
> p1.addControllerListener(this);
> p1.prefetch();
> p1.start();
>
> this class contains a method called changePIP that gets the PIPControl and
> changes the video stream. the code is this:
>
> public void ChangePIPStream(int nNewStream) {
> try{
>
> javax.media.Control acontrol[] =
> p1.getControls();
> for (int ii = 0; ii <
> acontrol.length; ii++) {
> if (acontrol[ii]
> instanceof PiPControl) {
> pipCtrl =
> (PiPControl)acontrol [ii];
> }
> }
> Startitup.log("PipContol3" + pipCtrl);
> if (pipCtrl != null) {
> try {
>
> pipCtrl.addPiPStatusListener(this);
>
>
> pipCtrl.selectStreamNumber(nNewStream);
> pipCtrl.setDisplay(true);
>
> } catch (Throwable e) {
> Startitup.log(e);
> }
> }
> }catch(Throwable a){
> Startitup.log(a);
> }
> }
>
> this method is called when i want to change video to Picture in Picture. But
> isn't work correctly. This method throws this exception:
>
> org.bluray.media.StreamNotAvailableException]
> at-com.cl.bdj.media.control.BasicPiPControl.selectStreamNumber(Unknown-Source)
> at-show_video.VideoLoader.ChangePIPStream(Unknown-Source)
> at-videos.video.ReproductorVideo.changePIP(Unknown-Source)
> at-com.oditofi.motor.views.CarreraView.doEnter(Unknown-Source)
>
> i print all the information about PIPControl before the method throws the
> exception using this method.
>
> private void printControlPIP(PiPControl pipCtrl){
>
> Startitup.log("PIPControlInformation----------------------------------------------");
> Startitup.log("controlComponent:"
> +pipCtrl.getControlComponent());
> Startitup.log("display:" + pipCtrl.getClipRegion() );
> Startitup.log("InputVideoSize:" + pipCtrl.getInputVideoSize()
> );
> Startitup.log("ActiveVideoArea:" +
> pipCtrl.getActiveVideoArea() );
> Startitup.log("GETDisplay:" +pipCtrl.getDisplay());
> Startitup.log("InputVideoSize:" +pipCtrl.getInputVideoSize());
> Startitup.log("VideoSize:" +pipCtrl.getVideoSize());
> Startitup.log("fullscreen:" +pipCtrl.getFullScreen());
> Startitup.log("clipRegion:" +pipCtrl.getClipRegion());
> Startitup.log("VideoAreaOnScreen:"
> +pipCtrl.getActiveVideoAreaOnScreen());
> Startitup.log("TotalVideoAreaOnScreen:"
> +pipCtrl.getTotalVideoAreaOnScreen());
> Startitup.log("IsSyncedDuringTrickPlay:"
> +pipCtrl.getIsSyncedDuringTrickPlay());
> Startitup.log("getVerticalScalingFactors:"
> +pipCtrl.getVerticalScalingFactors());
> Startitup.log("getHorizontalScalingFactors():"
> +pipCtrl.getHorizontalScalingFactors());
> Startitup.log("PositioningCapability():"
> +pipCtrl.getPositioningCapability());
> Startitup.log("supportsClipping():"
> +pipCtrl.supportsClipping());
> Startitup.log("StreamNumber:" +
> pipCtrl.getCurrentStreamNumber());
>
> Startitup.log("------------------------------------------------------------------");
> }
>
> And this is the information that it prints:
>
> controlComponent: null
> display: java.awt.Rectangle[x=0,y=0,width=0,height=0]
> InputVideoSize:java.awt.Dimension[width=0,height=0]
> ActiveVideoArea:org.havi.ui.HScreenRectangle@ba02bd4d
> GETDisplay:false
> InputVideoSize:java.awt.Dimension[width=0,height=0]
> VideoSize:java.awt.Dimension[width=0,height=0]
> fullscreen:false] START.
> clipRegion:java.awt.Rectangle[x=0,y=0,width=0,height=0]
> VideoAreaOnScreen:org.havi.ui.HScreenRectangle@64d50a93
> TotalVideoAreaOnScreen:org.havi.ui.HScreenRectangle@e6997311
> IsSyncedDuringTrickPlay:false
> getVerticalScalingFactors:[F@9157a78d]
> getHorizontalScalingFactors():[F@82b92c9e]
> PositioningCapability():1
> supportsClipping():true
> StreamNumber:-1
>
> The question is: Why cannot PipControl change of stream? why this exception
> is thrown? Is video created badly? Is this method of doing Picture in Picture
> correct?
>
> Thanks for all and sorry for my english.
>
> Cheers
>
> Mochilete
>
>

mochilete
Offline
Joined: 2011-10-18
Points: 0

Hi Joe

Thank you very much for answer me.

To generate the Playlist files, I`m using the same tool that i have used to generate the M2TS file with the main and secondary video. This tool is called tsMuxer. using tsMuxer you can generate a M2TS file with 2 video streams and after you can generate the blu-ray structure. Them, i copy this structure in my project and generate my disc with my application. I don´t know other form to generate the Playlist files. I have tried to use the tool of playlist generation of HDcookbook but i don´t know what fields is necessary complete or with that values to do it.

If you show me an example to do this or to say me that it is what I have to do to generate the playlist file, I would be very grateful to you.

Thank you very much

Mochilete

mochilete
Offline
Joined: 2011-10-18
Points: 0

Hi Joe!

I found my problem! The MPLS file isn´t correct. In this file there isn`t any reference to secondary video, however, threre are two fields about primary video streams. the file is this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mplsObject>
<version>0200</version>
<appInfoPlayList>
<audioMixAppFlag>false</audioMixAppFlag>
<losslessFlag>false</losslessFlag>
<playListRandomAccessFlag>false</playListRandomAccessFlag>
<playbackCount>0</playbackCount>
<playbackType>SEQUENTIAL</playbackType>
<UOMaskTable/>
</appInfoPlayList>
<playList>
<PlayItem id="0">
<Angle id="0">
<clipName>00000</clipName>
<stcId>0</stcId>
</Angle>
<connectionCondition>1</connectionCondition>
<inTime>27000000</inTime>
<isDifferentAudios>false</isDifferentAudios>
<isMultiAngle>false</isMultiAngle>
<isSeamlessAngleChange>false</isSeamlessAngleChange>
<outTime>29698200</outTime>
<playItemRandomAccessFlag>false</playItemRandomAccessFlag>
<stillMode>0</stillMode>
<stillTime>0</stillTime>
<stnTable>
<PrimaryVideoStream id="0">
<streamAttribute streamCodingType="0x1b">
<frameRate>RESERVED_5</frameRate>
<videoFormat>VIDEO_720p</videoFormat>
</streamAttribute>
<streamEntry>
<refToStreamPIDOfMainClip>4113</refToStreamPIDOfMainClip>
<refToStreamPIDOfSubClip>0</refToStreamPIDOfSubClip>
<refToSubClipEntryId>0</refToSubClipEntryId>
<refToSubPathId>0</refToSubPathId>
<streamType>STREAM_FOR_PLAYITEM</streamType>
</streamEntry>
</PrimaryVideoStream>
<PrimaryVideoStream id="1">
<streamAttribute streamCodingType="0x1b">
<frameRate>Mz_60000_1001</frameRate>
<videoFormat>VIDEO_576p</videoFormat>
</streamAttribute>
<streamEntry>
<refToStreamPIDOfMainClip>4114</refToStreamPIDOfMainClip>
<refToStreamPIDOfSubClip>0</refToStreamPIDOfSubClip>
<refToSubClipEntryId>0</refToSubClipEntryId>
<refToSubPathId>0</refToSubPathId>
<streamType>STREAM_FOR_PLAYITEM</streamType>
</streamEntry>
</PrimaryVideoStream>
</stnTable>
<uoMaskTable/>
</PlayItem>
</playList>
<playListMark>
<Mark id="0">
<duration>0</duration>
<entryEsPid>0xffff</entryEsPid>
<markTimeStamp>27000000</markTimeStamp>
<playItemIdRef>0</playItemIdRef>
<type>0x1</type>
</Mark>
</playListMark>
<paddingN1>0</paddingN1>
<paddingN2>0</paddingN2>
<paddingN3>0</paddingN3>
<paddingN4>0</paddingN4>
</mplsObject>

if you show this file, you will not found any references to secondary video streams. For this reason, the program throws the NotAvailaveVideoException.

I generate manually the mpls file, but i don`t know the value of the fields. The file is this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mplsObject>
<version>0200</version>
<appInfoPlayList>
<audioMixAppFlag>false</audioMixAppFlag>
<losslessFlag>false</losslessFlag>
<playListRandomAccessFlag>false</playListRandomAccessFlag>
<playbackCount>0</playbackCount>
<playbackType>SEQUENTIAL</playbackType>
<UOMaskTable/>
</appInfoPlayList>
<playList>
<PlayItem id="0">
<Angle id="0">
<clipName>00000</clipName>
<stcId>0</stcId>
</Angle>
<connectionCondition>1</connectionCondition>
<inTime>27000000</inTime>
<isDifferentAudios>false</isDifferentAudios>
<isMultiAngle>false</isMultiAngle>
<isSeamlessAngleChange>false</isSeamlessAngleChange>
<outTime>29698200</outTime>
<playItemRandomAccessFlag>false</playItemRandomAccessFlag>
<stillMode>0</stillMode>
<stillTime>0</stillTime>
<stnTable>
<PrimaryVideoStream id="0">
<streamAttribute streamCodingType="0x1b">
<frameRate>RESERVED_5</frameRate>
<videoFormat>VIDEO_720p</videoFormat>
</streamAttribute>
<streamEntry>
<refToStreamPIDOfMainClip>4113</refToStreamPIDOfMainClip>
<refToStreamPIDOfSubClip>0</refToStreamPIDOfSubClip>
<refToSubClipEntryId>0</refToSubClipEntryId>
<refToSubPathId>0</refToSubPathId>
<streamType>STREAM_FOR_PLAYITEM</streamType>
</streamEntry>
</PrimaryVideoStream>
<SecondaryVideoStream id="1">
<streamAttribute streamCodingType="0x1b">
<frameRate>Mz_60000_1001</frameRate>
<videoFormat>VIDEO_576p</videoFormat>
</streamAttribute>
<streamEntry>
<refToStreamPIDOfMainClip>4113</refToStreamPIDOfMainClip>
<refToStreamPIDOfSubClip>1</refToStreamPIDOfSubClip>
<refToSubClipEntryId>0</refToSubClipEntryId>
<refToSubPathId>1</refToSubPathId>
<streamType>STREAM_FOR_IN_MUX_SUBPATH</streamType>
</streamEntry>
</SecondaryVideoStream>
</stnTable>
<uoMaskTable/>
</PlayItem>
<subPaths id="1">
<subPathType>OUT_OF_MUX_AND_SYNC</subPathType>
<SubPlayItem id="1">
<syncPlayItemId>0</syncPlayItemId>
<isMultiClipEntries>false</isMultiClipEntries>
<spConnectionCondition>0</spConnectionCondition>
<SubClipInfo id="0">
<clipName>00000</clipName>
<stcId>0</stcId>
</SubClipInfo>
<subPlayItemInTime>27000</subPlayItemInTime>
<subPlayItemOutTime>29698</subPlayItemOutTime>
</SubPlayItem>
</subPaths>
</playList>
<playListMark>
<Mark id="0">
<duration>0</duration>
<entryEsPid>0xffff</entryEsPid>
<markTimeStamp>27000000</markTimeStamp>
<playItemIdRef>0</playItemIdRef>
<type>0x1</type>
</Mark>
</playListMark>
<paddingN1>0</paddingN1>
<paddingN2>0</paddingN2>
<paddingN3>0</paddingN3>
<paddingN4>0</paddingN4>
</mplsObject>

The question is: Do you know how complete this xml file? or do you Know other form to do this?

and other question: when you play two videos in Picture in Picture, where show the secondary video? what is the default value for the Active Area?

Thank you for all Joe

cheers

MOCHILETE