The Illusive Art of Streaming ISOs

This forum is about all development around libVLC.
kfp
New Cone
New Cone
Posts: 5
Joined: 08 Dec 2012 18:16

The Illusive Art of Streaming ISOs

Postby kfp » 08 Dec 2012 20:05

For a long time I've been trying to come up with a way to stream DVDs stored locally to PCs elsewhere. I'm hesitant to simply transcode all the video off the DVDs because of the variety of rich features from the DVDs that I would lose. I want to maintain the menus of the DVDs (to easily access episode commentaries, outtakes, and other special features) and be able to access my whole library. I've done some rough calculations and a 5GB DVD ISO that is 2.5 hours of video would require somewhere around 5Mb/s for streaming directly. This should be doable on my LAN but probably not so much outside.

My solution basically boils down to streaming the menus off the ISO while transcoding the actual videos to serve via some HTML friendly format.

Some specifics:

1. Client makes a request to a web app running on my server.
2. I serve up some strictly HTML/JS/AJAX menu system for navigating the library as well as a an applet which includes a vlcj video player.
3. Once a DVD is chosen, the web app will start streaming the app locally with VLC and return the location of the stream to the client.
4. The client gets the stream location and starts reading the stream with the vlcj video player.
5. The client will make AJAX calls to the server to perform menu functions (arrow keys, enter, etc)
6. The web-app will receive the calls and in turn pass them to the local instance of VLC which will then be reflected back to the client via the stream.
7. Once an actual video is chosen by the client, the server will terminate the current stream and start a new stream transcoding the video as well.
8. Perhaps this stream can be served up in some HTML5 compliant format. If not, we'll just stream to our vlcj applet and update the path (or perhaps use the same path if that doesn't cause problems).
9. Video controls at this point are either handled via HTML5 magic client side or in a similar method to what was described in steps 5-6.

I'd love any feed back that anyone has. Am I re-inventing the wheel? Are there fatal flaws? I assume that cvlc probably has some controls I can tap into for step 6, but perhaps I should use vlcj on the server as well for more refined controls/better integration into the web-app.

Thanks for taking a look!

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: The Illusive Art of Streaming ISOs

Postby Jean-Baptiste Kempf » 10 Dec 2012 14:41

What about using the VLC webplugin to navigate from the client?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kfp
New Cone
New Cone
Posts: 5
Joined: 08 Dec 2012 18:16

Re: The Illusive Art of Streaming ISOs

Postby kfp » 12 Dec 2012 13:33

I've put together a simple proof of concept using the webplugin and it looks like this should drastically simplify my front end. Thanks for the suggestion!

Do you know if cvlc exposes a mechanism I can use to navigate the DVD menu before transcoding the main video? Or should I explore vlcj for that piece?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: The Illusive Art of Streaming ISOs

Postby Jean-Baptiste Kempf » 13 Dec 2012 00:24

Not really sure what you are trying to achieve...
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kfp
New Cone
New Cone
Posts: 5
Joined: 08 Dec 2012 18:16

Re: The Illusive Art of Streaming ISOs

Postby kfp » 27 Dec 2012 22:56

Not really sure what you are trying to achieve...
At a very basic level I'm trying to recreate native DVD functionality streaming over the internet to a remote browser. I doubt I'll have enough bandwidth to stream the whole ISO, so I'm trying to be sneaky and transcode the main video portion of the DVD on the fly while simply streaming the main menus as is.

I was unable to navigate the DVD through menus using the mouse with the web plugin and did not find any JavaScript bindings to do so either (http://wiki.videolan.org/Documentation:WebPlugin). Luckily I was able to find in the vlcj MediaPlayer functions to traverse and activate items in the menu (http://vlcj.googlecode.com/svn/trunk/vl ... vate%28%29). This has let me create a bunch of AJAX calls to perform menu changes and skip around the DVD through the browser (with the DVD ISO, client, and server all on the same machine). This is pretty much all I wanted from the streaming side.

Next is to transcode the selected titles on the fly. Ideally this would happen automatically once a user selects a DVD menu item which takes the user away from a main menu and into a video. Does libvlc provide a method to tell if the currently playing item is/contains a DVD menu or is simply a video? I'm definitely not an expert at how DVDs work under the hood so my fear is that menus are actually abstracted from the video in some manner so I won't be able to tell which is which.

I hope I've been a bit more clear. Thanks again!

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: The Illusive Art of Streaming ISOs

Postby sherington » 28 Dec 2012 10:33

Does libvlc provide a method to tell if the currently playing item is/contains a DVD menu or is simply a video? I'm definitely not an expert at how DVDs work under the hood so my fear is that menus are actually abstracted from the video in some manner so I won't be able to tell which is which.
I'm assuming you are still talking about vlcj here...

I usually strip menus when making the ISOs for my own media server solutions, so I don't know if this method is 100% reliable, but you can try this:

Code: Select all

List<TrackDescription> descriptions = mediaPlayer.getTitleDescriptions();
Then you can iterate those descriptions looking for the presence of "DVD Menu".

For example, I had a quick try and got this:

Code: Select all

Title Descriptions: [TrackDescription[id=0,description=DVD Menu], TrackDescription[id=1,description=Title 1 [2:15:13]]]
The id is used with mediaPlayer.setTitle() and mediaPlayer.getTitle().

Rémi Denis-Courmont
Developer
Developer
Posts: 15229
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: The Illusive Art of Streaming ISOs

Postby Rémi Denis-Courmont » 28 Dec 2012 10:41

DVD menus cannot be "streamed", and that is all.

So far, the only way to access DVD menus remotely consists of mounting a filesystem with the ISO inside (or the actual DVD drive).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

kfp
New Cone
New Cone
Posts: 5
Joined: 08 Dec 2012 18:16

Re: The Illusive Art of Streaming ISOs

Postby kfp » 28 Dec 2012 14:26

sharrington:

Ah, I see. I gave that a shot and it looks like DVD Menu appears for the few DVDs I have ripped so far. I'll use this moving forward and maybe just assume the first title is the menu if I don't see it explicitly. Thanks!

Remi:

I suppose I'm not entirely "streaming" the menu. What I'm doing currently is using a HeadlessMediaPlayer from vlcj and streaming it's output while making calls back to my web-app which tells the MediaPlayer to move the menu around. This has produced an interesting bug in that I cannot actually see the menu cursor moving around, only the underlying video. I can verify the cursor is "moving" on the server side by moving it a number of times I would on a normal DVD player, selecting an item, and verifying that the expected item is playing.
The menu cursor appears to be on some different layer of video and isn't (or cannot be as I suspect your comment was suggesting) streamed. Is there any way to get menu information (number of items, position/order)? I don't mind "faking" the menu interaction but would like to provide whatever feedback I can to the client to help them navigate.

kfp
New Cone
New Cone
Posts: 5
Joined: 08 Dec 2012 18:16

Re: The Illusive Art of Streaming ISOs

Postby kfp » 09 Feb 2013 02:55

For anyone interested, this is as far as I got. No transcoding, still doesn't highlight your menu items, but does stream the dvds. Good enough for local use.

https://github.com/kfp/isoStream


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 14 guests