Getting info from command line

Just have a drink and chat
_FrnchFrgg_

Getting info from command line

Postby _FrnchFrgg_ » 26 Jan 2005 20:27

Reading the forums, I found a post asking whether it was possible to get media duration from command line, and the answer was NO.

I thought there was a text-only interface ? Couldn't we grep on it's output ?

The main problem is probably to be able to get information from the media and quit as soon as it's gotten ; it seems (but I may be wrong) the way VLC functions permits only to get information while the stream is being read...

I think I could, with time and a bit of study of the code, write sort of a 'info' interface, that would simply output info on stdout (or stderr), and quit...
The way I see it it is not a extra interface, but really an interface; because we can (apart from sending the info to stdout) already do that by hand with the wxwindow interface, I am sure my project is easily feasible.

Could you tell me what you think about that ?

_FrnchFrgg_

Sigmund
Big Cone-huna
Big Cone-huna
Posts: 893
Joined: 26 Nov 2003 09:38

Postby Sigmund » 26 Jan 2005 23:34

The following little script gets info on a stream or file from vlc from command line. It's not pretty, but it might be enough for your needs. Otherwise it would be cool to have a proper implementation of this so feel free to go ahead on that project.

Code: Select all

#!/bin/bash (sleep 3; echo info;echo quit)|vlc -I rc --novideo --noaudio --rc-fake-tty -q $1

_FrnchFrgg_

Sequel to Info interface

Postby _FrnchFrgg_ » 05 Feb 2005 18:41

Considering the proposal you posted, I wonder if the following idea is good :

The rc module permits to do what I want, but since I have (or rather, know) no mean to delay the info command until vlc is able to give me such info, a sleep is needed (and probably reduces the usability of the script, as I am not sure of vlc's behaviour when the duration is less than the sleep delay).

The idea is to provide a mean to
1) load the file
2) as soon as it is ready, display the result of the 'info' rc command
3) quit

Some questions :
1) As you know far better than me the way VLC is built, you may have ideas on what kind of module I should write (an interface, or sth else)
2) Where can I get information on how to discuss with VLC in a module (or interface, or...) ? I may look at the code of rc module for instance, but
there might be a simpler module or something that would better suit the investigation (I could as well decide to get more involved, and study the whole VLC architecture, but I would postpone usable results to a unknown date depending on by skills -- very low -- and lack of time -- very high).
3) Enough for today. ;-)

_FrnchFrgg_[/b]


Return to “Coffee Corner”

Who is online

Users browsing this forum: No registered users and 6 guests