XBMC Community Forum
Another External Player Code, but Very Simple to Setup - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: XBMC General Help and Support (/forumdisplay.php?fid=111)
+---- Forum: Windows support (/forumdisplay.php?fid=59)
+---- Thread: Another External Player Code, but Very Simple to Setup (/showthread.php?tid=116724)



RE: Another External Player Code, but Very Simple to Setup - Hessi - 2012-07-02 22:26

Hello again. Smile

Just tried the suggested playercorefactory.xml, and it almost works as I want it to. Everything but blu-ray discs is played in XBMC, but "PLAY DISC" option with blu-ray discs only starts PowerDVD12 without changing to correct drive or playing the movie.

Haven't tested with BDMV file structure yet.

Thanks again though... gonna try with Win 7 x86 again. Big Grin

Oh and, the reason for nothing else but blu-ray discs starting PowerDVD is the filename attributes in the rule tags. Like i said, all of my files are named like this. The Mask.iso Smile

And shouldn't...

<rule name="Blu-Ray" filename="F:\\.*" filetypes="bdmv" player="Bluray_Player"/>

be...

<rule name="Blu-Ray" filename="F:\.*" filetypes="bdmv" player="Bluray_Player"/>


RE: Another External Player Code, but Very Simple to Setup - scudlee - 2012-07-02 23:02

(2012-07-02 22:26)Hessi Wrote:  And shouldn't...

<rule name="Blu-Ray" filename="F:\\.*" filetypes="bdmv" player="Bluray_Player"/>

be...

<rule name="Blu-Ray" filename="F:\.*" filetypes="bdmv" player="Bluray_Player"/>

No, the filename attribute is a regexp, and the backslash is a special character which needs to be "escaped" to be treated as literal backslash, and the special character to escape something is... a backslash, hence the apparent doubling.


RE: Another External Player Code, but Very Simple to Setup - bluray - 2012-07-02 23:37

@Hessi- here are your new codes:

Playercorefactory.xml:

<playercorefactory>
<players>
<player name="ISO_Player" type="ExternalPlayer" audio="false" video="true">
<filename>C:\Users\Media Center\AppData\Roaming\XBMC\userdata\PlayISO.bat</filename>
<args>"{1}"</args>
<hidexbmc>true</hidexbmc>
<hideconsole>true</hideconsole>
<warpcursor>none</warpcursor>
<players>
<player name="Disc_Player" type="ExternalPlayer" audio="false" video="true">
<filename>C:\Users\Media Center\AppData\Roaming\XBMC\userdata\PlayDisc.bat</filename>
<args>"{1}"</args>
<hidexbmc>true</hidexbmc>
<hideconsole>true</hideconsole>
<warpcursor>none</warpcursor>
</player>
<player name="Universal_Player" type="ExternalPlayer" audio="false" video="true">
<filename>C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe</filename>
<args>"{1}"</args>
<hidexbmc>true</hidexbmc>
<hideconsole>true</hideconsole>
<warpcursor>none</warpcursor>
</player>
</players>
<rules action="prepend">
<!-- Bluray ISO -->
<rule filename=".*iso.*" filetype="iso" player="ISO_Player"/>
<!-- Bluray M2TS -->
<rule filename=".*m2ts.*" filetype="m2ts" player="Universal_Player"/>

<!-- Bluray Disc -->
<rule protocol="bd" player="Disc_Player"/>
</rules>
</playercorefactory>


PlayISO.bat:

@echo off
"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 %1
"C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe" G:


Since it didn't work with the other code, you can try the PlayDisc.bat below and the playercorefactory codes above....

PlayDisc.bat

@echo off
"C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe" F:


RE: Another External Player Code, but Very Simple to Setup - andyd - 2012-07-03 01:28

(2012-07-02 02:49)bluray Wrote:  @Andy.....

You need to tight up the rules a little bit........here are your rules:

<!-- Bluray ISO -->
<rule filename=".*iso.*" filetype="iso" player="ISO_Player"/>
<!-- Bluray BDMV -->
<rule filename=".*bdmv.*" filetype="bdmv" player="BDMV_Player"/>
<!-- Bluray M2TS -->
<rule filename=".*m2ts.*" filetype="m2ts" player="Universal_Player"/>

Hmm. I added the filetype parameter but it still doesn't seem to do it. Could it be an issue with the mp4s? I don't have a lot of mp4s but the it seems like it works ok when I launch a trailer from the movie page if it's in mp4 format. But the other videos for whatever reason trigger the launch


RE: Another External Player Code, but Very Simple to Setup - bluray - 2012-07-03 04:06

(2012-07-03 01:28)andyd Wrote:  
(2012-07-02 02:49)bluray Wrote:  @Andy.....

You need to tight up the rules a little bit........here are your rules:

<!-- Bluray ISO -->
<rule filename=".*iso.*" filetype="iso" player="ISO_Player"/>
<!-- Bluray BDMV -->
<rule filename=".*bdmv.*" filetype="bdmv" player="BDMV_Player"/>
<!-- Bluray M2TS -->
<rule filename=".*m2ts.*" filetype="m2ts" player="Universal_Player"/>

Hmm. I added the filetype parameter but it still doesn't seem to do it. Could it be an issue with the mp4s? I don't have a lot of mp4s but the it seems like it works ok when I launch a trailer from the movie page if it's in mp4 format. But the other videos for whatever reason trigger the launch
Can you provide one sample of your mp4s video?


RE: Another External Player Code, but Very Simple to Setup - SoWErA - 2012-07-03 13:09

I am unable to use this:

@echo off
rem you can place your PlayISO file anywhere
rem you need to put the correct VCDMount drive letter in the command below

"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 %1
"C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe" u:
"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 /u

if I remove the last unmounting line it works. However then I will have to manually unmount it later.

If I do keep all 3 lines then it unmounts before Powerdvd 12 plays the disc.

The Disc ain't autoplayed like TMT 5 used to do for me.


RE: Another External Player Code, but Very Simple to Setup - Hessi - 2012-07-03 15:20

(2012-07-02 23:37)bluray Wrote:  @Hessi- here are your new codes:

Playercorefactory.xml:

<playercorefactory>
<players>
<player name="ISO_Player" type="ExternalPlayer" audio="false" video="true">
<filename>C:\Users\Media Center\AppData\Roaming\XBMC\userdata\PlayISO.bat</filename>
<args>"{1}"</args>
<hidexbmc>true</hidexbmc>
<hideconsole>true</hideconsole>
<warpcursor>none</warpcursor>
<players>
<player name="Disc_Player" type="ExternalPlayer" audio="false" video="true">
<filename>C:\Users\Media Center\AppData\Roaming\XBMC\userdata\PlayDisc.bat</filename>
<args>"{1}"</args>
<hidexbmc>true</hidexbmc>
<hideconsole>true</hideconsole>
<warpcursor>none</warpcursor>
</player>
<player name="Universal_Player" type="ExternalPlayer" audio="false" video="true">
<filename>C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe</filename>
<args>"{1}"</args>
<hidexbmc>true</hidexbmc>
<hideconsole>true</hideconsole>
<warpcursor>none</warpcursor>
</player>
</players>
<rules action="prepend">
<!-- Bluray ISO -->
<rule filename=".*iso.*" filetype="iso" player="ISO_Player"/>
<!-- Bluray M2TS -->
<rule filename=".*m2ts.*" filetype="m2ts" player="Universal_Player"/>

<!-- Bluray Disc -->
<rule protocol="bd" player="Disc_Player"/>
</rules>
</playercorefactory>


PlayISO.bat:

@echo off
"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 %1
"C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe" G:


Since it didn't work with the other code, you can try the PlayDisc.bat below and the playercorefactory codes above....

PlayDisc.bat

@echo off
"C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe" F:
With the above, nothing starts PowerDVD. Not even discs (neither blu-ray or DVD). And as SoWErA said, the bat without "C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 /u won't unmount the image thus leaving the "PLAY DISC" option on in XBMC. That's why i modified my PlayISO.bat... but it does increase the CPU-usage.

Isn't it possible to make a playercorefactory.xml that only starts PowerDVD when playing blu-ray discs and if possible, BDMV file structures? :\

Oh and, by the way, I know what regular expressions are, but thanks for the explanation. Smile
(2012-07-03 13:09)SoWErA Wrote:  I am unable to use this:

@echo off
rem you can place your PlayISO file anywhere
rem you need to put the correct VCDMount drive letter in the command below

"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 %1
"C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe" u:
"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 /u

if I remove the last unmounting line it works. However then I will have to manually unmount it later.

If I do keep all 3 lines then it unmounts before Powerdvd 12 plays the disc.

The Disc ain't autoplayed like TMT 5 used to do for me.
try this... it will autoplay your iso and unmount when you exit PowerDVD. But as mentioned it will increase the CPU-usage every other second
Code:
@echo off
"C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe" G:
timeout /T 2
"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 %1
:loop
timeout /T 2
tasklist /FI "IMAGENAME eq PowerDVDCinema12.exe" 2>NUL | find /I /N "PowerDVDCinema12.exe">NUL
if "%ERRORLEVEL%"=="0" goto loop
"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 /u
You might have to/want to change...
Code:
tasklist /FI "IMAGENAME eq PowerDVDCinema12.exe" 2>NUL | find /I /N "PowerDVDCinema12.exe">NUL
to...
Code:
tasklist /FI "IMAGENAME eq PowerDVD12.exe" 2>NUL | find /I /N "PowerDVD12.exe">NUL



RE: Another External Player Code, but Very Simple to Setup - Hessi - 2012-07-03 16:01

Wouldn't this be the way to go for only blu-ray discs, and (if possible) BDMV file structures?

playercorefactory.xml
Code:
<playercorefactory>
    <players>
        <player name="Bluray_Player" type="ExternalPlayer" audio="false" video="true">
            <filename>C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe</filename>
            <args>"{F:}"</args>
            <hidexbmc>true</hidexbmc>
            <hideconsole>true</hideconsole>
            <warpcursor>none</warpcursor>
        </player>
        <player name="BDMV_Player" type="ExternalPlayer" audio="false" video="true">
            <filename>C:\Users\Media Center\AppData\Roaming\XBMC\userdata\PlayBDMV.bat</filename>
            <args>"{1}" /fullscreen</args>
            <hidexbmc>true</hidexbmc>
            <hideconsole>true</hideconsole>
            <warpcursor>none</warpcursor>
        </player>
        <player name="Universal_Player" type="ExternalPlayer" audio="false" video="true">
            <filename>C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe</filename>
            <args>"{1}" /fullscreen</args>
            <hidexbmc>true</hidexbmc>
            <hideconsole>true</hideconsole>
            <warpcursor>none</warpcursor>
        </player>
    </players>
    <rules action="prepend">
        <!-- Blu-Ray Discs -->
        <rule filename="F:\\.*" filetypes="bdmv|m2ts" player="Bluray_Player"/>
        <!-- Bluray BDMV -->
        <rule filetypes="bdmv" player="BDMV_Player"/>
        <!-- Bluray M2TS -->
        <rule filetypes="m2ts" player="Universal_Player"/>
    </rules>
</playercorefactory>

PlayBDMV.bat - maybe this needs some changes? Maybe like - set pth=%pth:BDMV\STREAM\*.m2ts=%
Code:
@echo off
set pth=%1
set pth=%pth:BDMV\index.bdmv=%
"C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe" %pth% exit

This this still wouldn't autoplay the movie in PowerDVD. What does the warpcursor element do? Can it be used to send a spacebar press to PowerDVD?


RE: Another External Player Code, but Very Simple to Setup - bluray - 2012-07-03 16:32

(2012-07-03 13:09)SoWErA Wrote:  I am unable to use this:

@echo off
rem you can place your PlayISO file anywhere
rem you need to put the correct VCDMount drive letter in the command below

"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 %1
"C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe" u:
"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 /u

if I remove the last unmounting line it works. However then I will have to manually unmount it later.

If I do keep all 3 lines then it unmounts before Powerdvd 12 plays the disc.

The Disc ain't autoplayed like TMT 5 used to do for me.
PDVD12 is so new, and Cyberlink decided to change a lot of things.....it's very tough to make it work seamless with playercorefactory code. You can leave the un-mount line out, and it doesn't hurt anything for the movie to stay mounted to a VCD drive.....it'll mount/playback another blu-ray ISO fine....


RE: Another External Player Code, but Very Simple to Setup - bluray - 2012-07-03 17:43

(2012-07-03 16:01)Hessi Wrote:  Wouldn't this be the way to go for only blu-ray discs, and (if possible) BDMV file structures?

playercorefactory.xml
Code:
<playercorefactory>
    <players>
        <player name="Bluray_Player" type="ExternalPlayer" audio="false" video="true">
            <filename>C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe</filename>
            <args>"{F:}"</args>
            <hidexbmc>true</hidexbmc>
            <hideconsole>true</hideconsole>
            <warpcursor>none</warpcursor>
        </player>
        <player name="BDMV_Player" type="ExternalPlayer" audio="false" video="true">
            <filename>C:\Users\Media Center\AppData\Roaming\XBMC\userdata\PlayBDMV.bat</filename>
            <args>"{1}" /fullscreen</args>
            <hidexbmc>true</hidexbmc>
            <hideconsole>true</hideconsole>
            <warpcursor>none</warpcursor>
        </player>
        <player name="Universal_Player" type="ExternalPlayer" audio="false" video="true">
            <filename>C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe</filename>
            <args>"{1}" /fullscreen</args>
            <hidexbmc>true</hidexbmc>
            <hideconsole>true</hideconsole>
            <warpcursor>none</warpcursor>
        </player>
    </players>
    <rules action="prepend">
        <!-- Blu-Ray Discs -->
        <rule filename="F:\\.*" filetypes="bdmv|m2ts" player="Bluray_Player"/>
        <!-- Bluray BDMV -->
        <rule filetypes="bdmv" player="BDMV_Player"/>
        <!-- Bluray M2TS -->
        <rule filetypes="m2ts" player="Universal_Player"/>
    </rules>
</playercorefactory>

PlayBDMV.bat - maybe this needs some changes? Maybe like - set pth=%pth:BDMV\STREAM\*.m2ts=%
Code:
@echo off
set pth=%1
set pth=%pth:BDMV\index.bdmv=%
"C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe" %pth% exit

This this still wouldn't autoplay the movie in PowerDVD. What does the warpcursor element do? Can it be used to send a spacebar press to PowerDVD?
For playback blu-ray disc, you don't need to include the m2ts in bluray_player rule. It should work with "<rule filename="F:\\.*" filetypes="bdmv" player="Bluray_Player"/>", because it use index.bdmv.........

Since you have PDVD12 in your HTPC, please try to play around with it and let us know what you find out........I installed the trial version of PDVD12 but I don't have it anymore.....


RE: Another External Player Code, but Very Simple to Setup - scudlee - 2012-07-03 18:08

(2012-07-03 17:43)bluray Wrote:  For playback blu-ray disc, you don't need to include the m2ts in bluray_player rule. It should work with "<rule filename="F:\\.*" filetypes="bdmv" player="Bluray_Player"/>", because it use index.bdmv.........
I agree, in fact you can actually go one step further and nest the BDMV_Player and Bluray_Player rules, like so:

Code:
<rules name="Custom rules" action="prepend">
  <rule name="Bluray BDMV" filetypes="bdmv" player="BDMV_Player">
    <rule name="Bluray Disc" filename="F:\\.*" player=Bluray_Player"/>
  </rule>
  <rule name="Bluray m2ts" filetypes="m2ts" player="Universal_Player"/>
</rules>

...Doesn't really save a whole lot of code, but it looks neat.

(I recommend adding the name attribute to the rules, as it makes it easier to debug.)


RE: Another External Player Code, but Very Simple to Setup - Hessi - 2012-07-03 21:31

bluray - Thanks for your help. Of course you're right... no need for the m2ts filetype in the attribute.

Since PowerDVD12 doesn't support BDMV file structure playback with initation through the index file, and since I only wanted blu-ray discs and the mentioned BDMV file structure to playback with PowerDVD12 I've shortened my playercorefactory.xml to the following.

Code:
<playercorefactory>
    <players>
        <player name="External_Player" type="ExternalPlayer">
            <filename>C:\Program Files (x86)\CyberLink\PowerDVD12\PDVDLaunchPolicy.exe</filename>
            <hideconsole>true</hideconsole>
        </player>
    </players>
    <rules>
        <rule filename="F:\\.*" filetypes="bdmv" player="Bluray_Player"/>
    </rules>
</playercorefactory>
It's worth mentioning that i've only tested this with PowerDVD12 in cinema mode. Smile
But as you mentioned in your earlier post if you navigate to the BDMV folder in PowerDVD12 it will play the movie fine with all features. Do you know in what way the code for this would have to be made? Is it xml markup, batch file or something else?

PowerDVD12 supports playback of m2ts files but then it would be without any other form of information or feature. F.x. no subtitles. Undecided

And of course there's no need for batch files. On the other hand, if I can figure out how to create batch file that starts PowerDVD12 and presses space or enter after a short delay, that would be preferable. Smile

For now i'll stick to the xml (playercorefactory) with this build, and try with the Frodo PVR margro build as standalone. Wink


RE: Another External Player Code, but Very Simple to Setup - andyd - 2012-07-04 13:43

(2012-07-03 04:06)bluray Wrote:  
(2012-07-03 01:28)andyd Wrote:  
(2012-07-02 02:49)bluray Wrote:  @Andy.....

You need to tight up the rules a little bit........here are your rules:

<!-- Bluray ISO -->
<rule filename=".*iso.*" filetype="iso" player="ISO_Player"/>
<!-- Bluray BDMV -->
<rule filename=".*bdmv.*" filetype="bdmv" player="BDMV_Player"/>
<!-- Bluray M2TS -->
<rule filename=".*m2ts.*" filetype="m2ts" player="Universal_Player"/>

Hmm. I added the filetype parameter but it still doesn't seem to do it. Could it be an issue with the mp4s? I don't have a lot of mp4s but the it seems like it works ok when I launch a trailer from the movie page if it's in mp4 format. But the other videos for whatever reason trigger the launch
Can you provide one sample of your mp4s video?


I finally figured it out. Not sure why but I had to change the filenames. I originally had "Episode 1" etc as part of the file names. That would for some reason trigger the TMT launch. After changing Episode 1 to just 1 now the files play properly. Pretty weird


RE: Another External Player Code, but Very Simple to Setup - scudlee - 2012-07-04 15:09

(2012-07-04 13:43)andyd Wrote:  I finally figured it out. Not sure why but I had to change the filenames. I originally had "Episode 1" etc as part of the file names. That would for some reason trigger the TMT launch. After changing Episode 1 to just 1 now the files play properly. Pretty weird

Not really, filename=".*iso.*" will match all files with "iso" anywhere in their name... Episode...

That's why you should just use filetypes="iso". That will only match against the file extension.

(filetype="iso", without the s on filetypes, is incorrect and is ignored by XBMC)


RE: Another External Player Code, but Very Simple to Setup - andyd - 2012-07-04 15:44

Oh ok. I'll switch it