Forum Moderators: phranque
Im trying to develop a media server so what I decided to do was build a web application (written in PHP5) with a MySQL backend, Apache Webserver, and a 1TB RAID running on Debian (woody). This would allow me to be able to use any PC without having to install custom software like Freevo of MythTV.
To test this all out before I stared a created a simple webpage that pointed to the VOB of a particular movie. I mounted the directory via samba, and launched the test index.html file with a simple example:
<a href="/DVD/movie1/VIDEO_TS/VTS_01_1.VOB">movie</a>
Everything worked great. So I figured that doing a similar thing from a web-browser would offer me some more flexibility i.e. dynamic page generation, etc.
So I went ahead and set everything up. I set up a MySQL database with all my DVD's, Apache Webserver, and a simple PHP webpage to provide me with a movie link. Unfortunately this did not work. When I clicked on the file, instead of the movie beginning in the media player, it started downloading the VOB. No matter what I did playing with the mime types, media players, I could not get it to stream the content.
So I guess my questions are:
1. Is this even possible? Being able to server a webpage that allows you to reference a file on a samba mount?
2. Do I need any additional software? Multicast, realvideo, etc?
Any help would be greatly appreciated.
Thanks!
Most software players for PC support playing a DVD from a directory. AFAIK, you can't feed a DVD player through HTTP. In other words, the player needs direct access to the VIDEO_TS directory with the VOB's in it. By direct access I mean access to a local harddrive or through a mounted share on a Samba/Windows file server.
You can still use a webserver and a database backend to manage the DVDs, but eventually the urls to the VOB files need to start with "file:" which means that the files need to be available locally or on a mounted share, as I said.
Of course you could also convert your DVD's into a streamable format and get a highend streaming server. But then you'd have to abandon DVD-specific features like navigation, subtitles, multiple languages and so on and so on.
Or you could use Video4Linux. Have you looked into that?
Welcome to WebmasterWorld by the way!
Im planning on having the files locally available (via samba on my houses intranet) as I do now, so the URL can be "file:".
I have tried something along the lines of:
<a href='file://192.168.1.1\DVDs\movie1\VIDEO_TS\VTS_01_1.VOB'>movie 1</a>, but when I see the link on the webpage, it looks like this:
file://192.168.1.1\incoming\DVDs\movie1\video_ts\vts_01_1.vob/
I have tried a variety of forward slashes, and backslashes to correctly identify the path, but with no success. Plus for some reason a “/" gets appended at the end of the URL?
Is this just a school boy error in my syntax?
I have not checked out Video4Linux, but thats the first place Im going to check as soon as I post this message.
Thanks for your help!
file:///C:\path\to\your\file.vob
on Linux probably:
file:///home/somewhere/else/file.vob
Notice that it's 3 slashes.
I don't know about full length movies but for my kids cartoons like spongebob I use dvd shrink or similiar software and pull all the episodes out into indvidual VOB's and then just change the extensions to MPG. Not sure if this has anything to do with what your trying to accomplish but just thought I would share my 2 cents.
Everything looked great, but it didn't work. Im doing my testing on Firefox 1.0. When I click on the link nothing happens. When I use IE 6.0.2 SP2, it just starts downloading the file instead of reading it from the mounted network drive.
When I copy the link and paste it into the address bar, it works great, starts playing the movie right from the file system, but no go from the link itself.
Could it be some Apache setting that I might be missing?
Thanks again everybody!
It might also be a problem with security settings. The imho ideal solution would look like this: PHP dynamically generates a script file (CMD batch, WSH script or something similar) that lauches the player in the given directory. If PHP sends back the script with the correct MIME type, the browser should execute that script.
You can verify if this solution works by creating a CMD batch file on the server and pointing the browser to it. This might also fix the problem twist mentions because you're passing the whole directory to the player instead of a single vob file.
The batch file should look like
"C:\Program Files\Windows Media Player\wmplayer.exe" I:\DVD_Movies\movie1\VIDEO_TS
Obviously, the real solution needs to dynamically generate the batch file using PHP. HTH
-- Hannes
It starts playing in Windows Media Player. All the file associations are set as far as Windows is concerned.
I talked to one of my buddies who did some web development before, and he said I could write an ActiveX script to write a BAT file to the local drive, and then execute that bat. Very similar to what you mentioned. Since this is a local app that I am writing then I guess it's ok. Im always weary about some random programs executing local from my web browser, but in this case it might be the only solution.
If I decide to go this route, I definitely dont want to use ActiveX, but PHP or Python would be an option.
Thanks for all your help everyone! I'll keep you all posted.
I created a simple page that just had the following:
<a href="file://C:/Temp/Xstart.bat">x</a>
and I also tried:
<a href="file://C:\Temp\Xstart.bat">x</a>
Where Xstar.bat is a path to open sol.exe. I was almost positive this would work, but it didnt. I even put all my security settings to "LOW" enabling virtually everything that I could, still no go.
If anyone has a development server at home could they please try this test as a sanity check for me? All my boxes run WinXP Home SP2, and it might be some crazy security setting that is enabled.
It just seems everything I try isnt panning out....
I saved HTML file with the following code to my local drive, and opened it locally. It worked.
I placed the HTML file on a server I am running on the machine I am on, and tried to run the file, and it worked again.
Video is embedded into the web page.
<object
id="mediaplayer"
classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701"
standby="loading microsoft windows media player components..."
type="application/x-oleobject">
<param name="filename" value="\\Computername\videos\video_file.mpg">
<param name="animationatstart" value="true">
<param name="transparentatstart" value="true">
<param name="autostart" value="true">
<param name="showcontrols" value="true">
</object>
split0101 wants to view the entire DVD not just a single stream. Your method makes it impossible to use DVD specific features like subtitles, menu, etc.
split0101,
I tried your code and a few variations and couldn't get it to work. The only thing that worked was my original suggestion where the bat file comes from the server. I put a batch file (better use cmd than bat extension) on my intranet webserver (when browsing my intranet IE switches to Local Intranet security zone). On another HTML page on that same server I put two links to that batch file.
<a href="http://intranet/test.cmd">Test</a>
<a href="/test.cmd">Test</a>
When I click on either link using IE, a warning dialog appears. If I click the "Execute" button, the batch gets executed as intended.
In Firefox the script is not executed. Instead it's source code is displayed.
This might be helpful File URLs [cs.tut.fi].
Bottom line: don't use file: urls.