2009-08-07, 11:02
Hello all, I'm new here but a long time xbmc user. I wanted to enable BD/DVD external player playback with powerdvd9 and thought I'd share my work. I based it upon some of the other batch files I saw on the forum. With this script powerdvd can playback iso's of backed up BD or DVDs, using alcohol 120 to mount them, or playback regular files it recognizes. Unfortunately powerdvd9 is too boneheaded to play back direct rips (video_ts folders or bd folders). The movies work from the file view or library view (if they are isos or supported regular files) and the script can handle files on samba shares and strip out credentials so iso mounting works. To use select the media you want to externally play, bring up the context menu, select play using and chose powerdvd.
I am using vista 64 bit, but it should work on 32 bit as well. I'm using the latest svn.
playercorefactory.xml file, you'll have to add your user name and change the batch file location if you're on XP or don't want the script in the location I have it in. The space between .bat and </filename> is needed:
launchpowerdvd.bat - There are two changeable settings in this. You can change powerdvd9 to powerdvd8 below as well,manually. Powerdvd8 can also play back video_ts.ifo files but sometimes fails:
I am using vista 64 bit, but it should work on 32 bit as well. I'm using the latest svn.
playercorefactory.xml file, you'll have to add your user name and change the batch file location if you're on XP or don't want the script in the location I have it in. The space between .bat and </filename> is needed:
Code:
<playercorefactory>
<players>
<player name="PowerDVD" type="ExternalPlayer" video="true">
<filename>C:\Users\USERNAME\AppData\Roaming\XBMC\launchpowerdvd.bat </filename>
<hideconsole>true</hideconsole>
<hidexbmc>true</hidexbmc>
</player>
</players>
</playercorefactory>
launchpowerdvd.bat - There are two changeable settings in this. You can change powerdvd9 to powerdvd8 below as well,manually. Powerdvd8 can also play back video_ts.ifo files but sometimes fails:
Code:
:: Launches powerdvd9 to play selected file.
:: Mount iso,img images in Alcohol if file is an image file. Unmounts image after Powerdvd close. Powerdvd does not launch if mount fails.
:: Parses input from XBMC to remove leading garbage.
:: If a samba share is supplied from XBMC the credentials are removed. Make sure windows has your credentials.
:: --- Settings
:: Kill XBMC process or not, 1 and 2 kill, 0 does not. Killed xbmc will be restarted fullscreen with 2, windowed with 1
set killxbmc=0
:: Virtual Drive
set virtdrive=F
echo off
cls
set progprefix=%programfiles%\
set sourcefile=%*
:garbage_loop
set test=%sourcefile:~0,1%
if ^%test%==^" (
set sourcefile=%sourcefile:~1%
) else (
if ^%test%==^ set sourcefile=%sourcefile:~1%
)
if ^%test%==^" (goto garbage_loop)
if ^%test%==^ (goto garbage_loop)
for /f "tokens=1,2 delims=@" %%a in ("%sourcefile%") do set test=%%b
if not "x%test%"=="x" set sourcefile=\\%test%
set test=%sourcefile:~-4%
if %test%==.iso (
set imageflag=mount
) else (
set imageflag=no
)
if %test%==.img set imageflag=mount
echo.Input File: %sourcefile%
if %imageflag%==mount (echo Image File deteced, will be mounted)
if %killxbmc%==1 (
taskkill /F /IM XBMC.EXE
)
if %killxbmc%==2 (
taskkill /F /IM XBMC.EXE
)
if %imageflag%==mount (
"%progprefix%\Alcohol Soft\Alcohol 120\AxCmd.exe" %virtdrive%: /M:"%sourcefile%"
if not ERRORLEVEL==1 (
start "" /wait "%progprefix%\CyberLink\PowerDVD9\PowerDVD9.exe" /fullscreen %virtdrive%:\
)
) else (
start "" /wait "%progprefix%\CyberLink\PowerDVD9\PowerDVD9.exe" /fullscreen "%sourcefile%"
)
if %imageflag%==mount (
"%progprefix%\Alcohol Soft\Alcohol 120\AxCmd.exe" %virtdrive%: /U
)
if %killxbmc%==1 start "" "%progprefix%\XBMC\XBMC.exe"
if %killxbmc%==2 start "" "%progprefix%\XBMC\XBMC.exe" -fs
exit