[vlc-devel] Re: Missing features in libvlc

Jean-Paul Saman jean-paul.saman at planet.nl
Sat Mar 31 17:08:12 CEST 2007


Chris Lahey wrote:
> I'm going to start by talking about what I'm doing with vlc and what
> functionality I need.  Then I will talk about how I want to implement
> it and get your input.
> 
> I work on Democracy Player, a video podcast client.  On the windows
> platform, we use the vlc mozilla plugin to view videos.  I can change
> the plugin code as well as the libvlc code.  We ship a patched copy of
> the plugin and the library so as to not require an installed vlc and
> to make sure we're always using the same version of vlc.

Any chance we see some of these patches? So we can integrate them in our 
code base.

> Currently, I'm trying to implement a new feature that we have on the
> other platforms.  Specifically, I need to fetch the duration and a
> frame for use as a thumbnail for each video, without playing the
> videos.
> 
> I'd like to continue using the mozilla plugin to implement this
> behavior, but there's a couple of missing features.  The plugin can
> only have one video loaded at a time, but to work around this, I plan
> to simply embed a second plugin with the different features and
> without it being displayed.

That is a design limitation, since VLC is a media player it means that 
only one video at the same time can be viewed. Only in streaming mode it 
is possible to handle multiple streams at the same time. But not for 
playback.

> There are still a number of things that I need to change.  Firstly, I
> need to code the plugin to allow you to specify the output mode.  This
> shouldn't be too much of a problem.  I need to be able to specify the
> image video output.  I think for this I just need to specify the
> output plguin in the argv.

Output mode can always be added to the mrl or mrl options. Since these 
are configuration items. See vlc's documentation for this.

> The next problem, and the one I don't know how exactly I'm going to
> fix is that the plugin provides no way to load a video and get
> metadata like duration and to set the input plugin to a certain time.
> In this case, I'd like to set the time to half of the duration to
> match the behavior on the other platforms.  I'd be fine setting the
> time to 30 seconds in, if the duration isn't set for a video, but as
> it is, there's no way to set the offset until after the video starts
> playing.

You can use vlc.playlist.add(mrl,name,options) with options including 
":start-time=30", if you use vlc-0.8.6 and above. See the plugin 
documentation on http://www.videolan.org/doc or http://wiki.videolan.org.

> I got on irc to ask about this and they suggested preparse, but libvlc
> doesn't have such a function.  Can anyone suggest how I would go about
> adding this functionality to libvlc and the mozilla plugin?  (I'm not
> nearly as concerned about the plugin.  It's a very thin wrapper around
> libvlc.)  Preparse would also be useful for the main app, but we work
> around it there by repeatedly trying to set the offset until it
> succeeds.

The plugin currently doesn't export information about the length of the 
video. Since vlc does a preparse it should be possible to get at least 
some of that information for certain video types. This is on the todo list.

> The final thing I'm concerned about is how I will get the image plugin
> to play a single frame and then stop.  Or at the very least, how I'll
> be able to tell that it's finished that first frame.

VLC is currently not frame accurate, but a play; sleep(40ms); pause(); 
should do the trick.

> Any suggestions you can offer on these problems are appreciated.  I
> would appreciate any answers to my specific questions, things I'm
> doing wrong in general, or suggestions of approaches.

Gtz,
Jean-Paul Saman

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list