Welcome to the Invelos forums. Please read the forum rules before posting.

Read access to our public forums is open to everyone. To post messages, a free registration is required.

If you have an Invelos account, sign in to post.

    Invelos Forums->DVD Profiler: Plugins Page: 1  Previous   Next
LoadDVD, my revised PlayFromFile.bat (Playing DVD's from a harddrive)
Author Message
DVD Profiler Unlimited Registrantbspeng
Registered: February 5, 2009
United States Posts: 26
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
This bat file tries its best to be universal.  Playing IFO's or ISO's (using a virtual DVD) using a variety of common media players.  It expects the Sort Title to match the name of the stored DVD.

Personally, I store DVD ISO's and play them using "daemon tools lite v4.30.4" and Windows Media Player from a network shared drive, rather drives (plural, they fill up).

I prefer "daemon tools lite v4.30.4" because (1) it will return the drive letter it's using, which is very nice from batch file programming and additionally (2) it will remount ISO's automatically when the computer is restarted.

I prefer Windows Media Player because it's (almost) always available and it does the job as long as you get the codecs.

The batch file uses some rather simple logic to "find" available VirtualDrive utilities and media players.  The explanation can be found in the bat file comments.

I set the Profile "Sort Title" to match the filename of the ISO (or vice versa).  In LoadDVD options, I set the "Default Open Path" to \\computername\dvd\playfromfile.bat , set the default changer to "none" and finally "%5" to "Sort Title". This eliminates the need to add the [filepath] stuff to each profile.

PlayFromFile.bat
Quote:

@echo off
cls
::This batch file uses SET features available in WINXP and later
::
::Expects ISO's or VIDEO_TS folders named as defined below to organized in folders
::by named media type (DVD, HD, BLUERAY) located in SourceDir. Searching multiple
::folders is possible by adding a sequence digit for the additional folder names (e.g. DVD1).
::
::Support for various Players and Virtual DVD emulation is using for playing ISO's
::Otherwise, expectation is that .IFO is associated with your player.
::
:: Players: PowerDVD8, WinDVD, Media PLayer. (The ordered list can located below)
:: The last program found is used, thus, Media Player currently takes
:: precedence
:: Virtual DVD
:: Emulation: Daemon Tools, Slysoft's Virtual CD
::
:: _1 DescriptionSideA
:: _2 profileid - this is usually the UPC code
:: _3 disc#
:: _4 slot# or collection#
:: _5 Title or Sort Title or Label Side A
:: _6 filepath
:: _7 mediatype = "DVD", "HD" or "BluRay"
:: _8 and thereafter - remainder of Location field
set count=0
:loop
setLocal EnableDelayedExpansion
shift
set /a count = count + 1
call set _%count%=%0
call :deQuote _%count%
if not ~%0~==~~ goto :loop
set count=0

echo.variables:
echo.%_1% %_2% %_3% %_4% %_5% %_6% %_7% %_8% %_9%

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::  CUSTOMIZATIONS HERE!
:: "DVD"        = if ISO images are used, set this to the Drive letter of the virtual Drive
::                (this is not required/used by daemon tools)
:: "SourceDir"  = must have trailing \
:: "Folder"    = if not blank, must have trailing \
:: "Filename"  = the name of the ISO or VIDEO_TS folder
:: "LastFolder" = The last search folder in the sequence: DVD, DVD1, DVD2, etc.
::                (this allows for searching multiple folders. If you only have one folder,
::                set it the same as "Folder")
set DVD=D:
set SourceDir=\\msi7309\
set Folder=%_7%\
set Filename=%_5%
set LastFolder=%_7%1\
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

call :FindProgram VirtualDrive vcdmount.exe
call :FindProgram VirtualDrive daemon.exe

call :FindProgram player powerdvd8.exe {drive}
call :FindProgram player windvd.exe    {drive}
call :FindProgram player vlc.exe    {drive}
call :FindProgram player wmplayer.exe  "/prefetch:4 /fullscreen /device:dvd "{drive}""

Set thisFolder=%Folder%
Set nextFolder=%Folder:~0,-1%1\
if ~%Folder:~-2%~==~1\~ set Set nextFolder=%Folder:~0,-2%2\
if not ~%player%~==~~ goto :FindVideo
echo Can't Locate DVD Video player
pause
exit

:FindVideo
if not exist "%SourceDir%%thisFolder%." goto NotFound
set iso="%SourceDir%%thisFolder%%Filename%.ISO"
if EXIST %iso% goto :iso
set Filename_=%Filename: =_%
set iso="%SourceDir%%thisFolder%%Filename_%.ISO"
if EXIST %iso% goto :iso
set Filename_=%Filename:~0,30%
set iso="%SourceDir%%thisFolder%%Filename_%.ISO"
if EXIST %iso% goto :iso
set Filename_=%Filename_: =_%
set iso="%SourceDir%%thisFolder%%Filename_%.ISO"
if EXIST %iso% goto :iso
set play="%SourceDir%%thisFolder%%Filename%\VIDEO_TS\VIDEO_TS.IFO"
if EXIST %play% goto :video
set play="%SourceDir%%thisFolder%%Filename_%\VIDEO_TS\VIDEO_TS.IFO"
if EXIST %play% goto :video
if ~%Folder%~==~~ goto :NotFound
if ~%thisFolder%~==~%LastFolder%~ goto :NotFound
Set thisFolder=%nextFolder%
set count=%thisFolder:~-2,1%
set /a count = count + 1
set nextFolder=%nextFolder:~0,-2%%count%\
goto :FindVideo

:NotFound
echo    * * * NOT FOUND * * *
echo      SourceDir = "%SourceDir%"
echo        Folder = "%Folder%"
echo Video Filename = "%Filename%"
pause
exit

:video
echo %play%
%play%
exit

:iso
Echo Mount ISO
if not ~%VirtualDrive%~==~~ goto :MountISO
echo Can't find Virtual Drive Application
pause
exit

:MountISO
Call :deQuote PlayerCommand
if /i ~%VirtualDriveProgram%~==~daemon.exe~  goto :daemon
if /i ~%VirtualDrive%Program~==~vcdmount.exe~ goto :vcdmount

:Daemon
%VirtualDrive% -get_letter 0
set /a ErrorLevel=%ErrorLevel%+1
set DVD="ABCDEFGHIJKLMNOPQRSTUVWXYZ
Call Set DVD=%%DVD:~%ErrorLevel%,1%%:
%VirtualDrive% -unmount 0
%VirtualDrive% -mount 0,%iso%
set PlayerCommand=!PlayerCommand:{drive}=%DVD%!
Call Set GoPlay=%Player% %PlayerCommand%
echo %GoPlay%
%GoPlay%
::I decided it's probably best to unmount the image...
%VirtualDrive% -unmount 0
exit

:vcdmount
set PlayerCommand=!PlayerCommand:{drive}=%DVD%!
%VirtualDrive% /d=0 /u
%VirtualDrive% /d=0 %iso%
Call Set GoPlay=%Player% %PlayerCommand%
echo %GoPlay%
%GoPlay%
%VirtualDrive% /d=0 /u
exit

:FindProgram
for /f "tokens=* delims= " %%z in ('attrib/s "%ProgramFiles%.\%2"') do (
set %1temp=%%z
)
call set test=!%1temp:~0,14!
if /i "%test%"=="File Not Found" goto :FindProgram1
call set %1="!%1temp:~11!"
set %1Program=%2
set %1Command=%3
:FindProgram1
goto :eof

:deQuote
set _deQuoteVar=%1
call set _deQuoteStr=%%!_deQuoteVar!%%
set _deQuoteStr=#@#%_deQuoteStr%#@#
set _deQuoteStr=%_deQuoteStr:"#@#=#@#%
set _deQuoteStr=%_deQuoteStr:#@#"=#@#%
set %_deQuoteVar%=%_deQuoteStr:~3,-3%
goto :eof


It works well for me, hopefully for you too!
 Last edited: by bspeng
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,401
Posted:
PM this userVisit this user's homepageDirect link to this postReply with quote
Wow!!!!     

Where do you get all the codecs for WMP? I actually like it also, especially for playing CDs because it's library management is better than Media Center.

But for videos I usually wind up using VLC Player because it solves most of the codec issues and has more options for adjusting the playback (aspect ratio, etc.).

But I would like to use WMP more, if I can get a good handle on the codecs. I am aware of the K-Lite packages, but somehow I get conflicts and confusion when I try to use it. And those FFDSHOW options ... can't figure them out.
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
 Last edited: by mediadogg
DVD Profiler Unlimited Registrantbspeng
Registered: February 5, 2009
United States Posts: 26
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
That's the beautiful thing!  If you want to use WINDVD, then REM out WMP:
Quote:
call :FindProgram player wmplayer.exe  "/prefetch:4 /fullscreen /device:dvd "{drive}""
Quote:
REM call :FindProgram player wmplayer.exe  "/prefetch:4 /fullscreen /device:dvd "{drive}""


The last program found in this list is the one that will be used.  Change the order or REM out unwanted lines.
Quote:
call :FindProgram player powerdvd8.exe {drive}
call :FindProgram player windvd.exe    {drive}
call :FindProgram player wmplayer.exe  "/prefetch:4 /fullscreen /device:dvd "{drive}""

perhaps add a new program, VLC, for instance:
Quote:
call :FindProgram player powerdvd8.exe {drive}
call :FindProgram player windvd.exe    {drive}
call :FindProgram player wmplayer.exe  "/prefetch:4 /fullscreen /device:dvd "{drive}""
call :FindProgram player vlc.exe    {drive}
 Last edited: by bspeng
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,401
Posted:
PM this userVisit this user's homepageDirect link to this postReply with quote
Quoting bspeng:
Quote:
I set the Profile "Sort Title" to match the filename of the ISO (or vice versa).  In LoadDVD options, I set the "Default Open Path" to \\computername\dvd\playfromfile.bat , set the default changer to "none" and finally "%5" to "Sort Title". This eliminates the need to add the [filepath] stuff to each profile.

I couldn't have imagined such a clever thing. This is the part of making plugins that I enjoy the most. Seeing people have fun and doing even more creative things!
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
DVD Profiler Unlimited Registrantiamwolverine
Registered: May 18, 2008
Posts: 1
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
what's a good way to get this to work with the PS3?
There are already several streaming programs [tversity, ps3 media server, playon, wmp, and a couple others] ... and i can browse my dvd profiler collection online via the browser ... but could there possibly be a way to auto-load and stream to the tv through the ps3 ?
DVD Profiler Desktop and Mobile Registrantmediadogg
Aim high. Ride the wind.
Registered: March 18, 2007
Reputation: Highest Rating
United States Posts: 6,401
Posted:
PM this userVisit this user's homepageDirect link to this postReply with quote
Quoting iamwolverine:
Quote:
what's a good way to get this to work with the PS3?
There are already several streaming programs [tversity, ps3 media server, playon, wmp, and a couple others] ... and i can browse my dvd profiler collection online via the browser ... but could there possibly be a way to auto-load and stream to the tv through the ps3 ?

Probably. What I choose to work on is mainly guided by my own needs. I have an Xbox 360, but not a PS3. My use of the Xbox 360 is so little - just for games, mostly when the family is gathered for holidays (Gears of War on 100" screen  ).

I have so many ideas on a bunch of notepads lying around. Some of them involve streaming. I have looked a bit into Nero Home and more into VLC Player as streaming engines. VLC is reasonably easy to use.

I don't have a bunch of time now, but until then, Google up some VLC Player streaming command line scripts. You can then write those commands lines with PlayFromDisk.bat and you will have the beginnings of one of the solutions I had in mind. I was going to test it and provide a script, or build in the VLC call internally.

But like I said, no time now. I will happily take advantage of your results if you want to give it a shot. 

By the way, one of the reasons I have not explored streaming is that you have to insert so many middle-men, that performance becomes an issue. I prefer to play the file directly from a network share. I mean, there is no need to stream if you have a network with wi-fi enabled devices, unless the player has a limited number of codecs - then you need to transcode and stream.

That's why LoadDVD Pro - my platform for future A/V options, of which I have a ton on the drawing boards, including some kind of streaming.
Thanks for your support.
Free Plugins available here.
Advanced plugins available here.
Hey, new product!!! BDPFrog.
 Last edited: by mediadogg
DVD Profiler Unlimited RegistrantSearch1990
Registered: March 29, 2007
Posts: 69
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
can this batch file be modified to work with powerdvd 9?
    Invelos Forums->DVD Profiler: Plugins Page: 1  Previous   Next