exit VLC when playing ends (for scripts etc.)?

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
mangoo
Blank Cone
Blank Cone
Posts: 46
Joined: 16 Jul 2007 12:05
Contact:

exit VLC when playing ends (for scripts etc.)?

Postby mangoo » 03 Sep 2007 14:58

Is it possible to exit VLC when the file/stream it plays come to an end?

I would like to script vlc, but right now, after the file/stream ends, vlc doesn't exit; it just closes the interface.

CloudStalker
Big Cone-huna
Big Cone-huna
Posts: 2581
Joined: 14 Jan 2007 19:00
VLC version: OVER 9000!!!
Operating System: It's...blue screen
Location: Heaven? No no. What's that other place that starts with an "H"? Oh yes: Home. ^_^

Re: exit VLC when playing ends (for scripts etc.)?

Postby CloudStalker » 03 Sep 2007 15:10

You could try a nightly build, it has the option to close VLC after everything in the playlist has finished.

mangoo
Blank Cone
Blank Cone
Posts: 46
Joined: 16 Jul 2007 12:05
Contact:

Re: exit VLC when playing ends (for scripts etc.)?

Postby mangoo » 03 Sep 2007 15:16

You could try a nightly build, it has the option to close VLC after everything in the playlist has finished.
And what option is that? I use the svn version already.

I noticed that if I add "--sout-all vlc:quit", vlc quits like I wanted.
And this option seems to be in 0.8.6c.

mangoo
Blank Cone
Blank Cone
Posts: 46
Joined: 16 Jul 2007 12:05
Contact:

Re: exit VLC when playing ends (for scripts etc.)?

Postby mangoo » 03 Sep 2007 15:34

I noticed that if I add "--sout-all vlc:quit", vlc quits like I wanted.
And this option seems to be in 0.8.6c.
Hmm, "--sout-all vlc:quit" sometimes works, sometimes doesn't.

I would still appreciate that "close" option in the nightly build - I looked through "vlc -H --advanced", but didn't find such an option.

kmf31
Cone that earned his stripes
Cone that earned his stripes
Posts: 308
Joined: 11 Mar 2007 21:47

Re: exit VLC when playing ends (for scripts etc.)?

Postby kmf31 » 03 Sep 2007 16:16

Hmm, "--sout-all vlc:quit" sometimes works, sometimes doesn't.
I think you only need to add "vlc:quit" (without the "--sout-all") but as last option of the command line. Then it should always work.

mangoo
Blank Cone
Blank Cone
Posts: 46
Joined: 16 Jul 2007 12:05
Contact:

Re: exit VLC when playing ends (for scripts etc.)?

Postby mangoo » 03 Sep 2007 17:37

Hmm, "--sout-all vlc:quit" sometimes works, sometimes doesn't.
I think you only need to add "vlc:quit" (without the "--sout-all") but as last option of the command line. Then it should always work.
--sout-all is something else, indeed, and doesn't take any arguments.

So, just vlc:quit doesn't always work.

Mostly, it will quit with:

$ vlc -I dummy --run-time 5 http://address:port vlc:quit --sout "#duplicate{dst=std{access=file,mux=ts,dst="/tmp/check-http.avi"}}"
VLC media player 0.9.0-svn Grishenko
[00000305] main playlist error: Reloading playlist not implemented.
[00000312] dummy interface: using the dummy interface module...
[00000332] main access: International Domain Names not supported
[00000334] main private error: cannot pre fill buffer
[00000339] dummy demuxer: command `quit'
[00000305] main playlist: saving Media Library to file /home/blah/.vlc/ml.xsp


But sometimes (5-10% of cases), it just "hangs" after saying "command `quit'":

$ vlc -I dummy --run-time 5 http://address:port vlc:quit --sout "#duplicate{dst=std{access=file,mux=ts,dst="/tmp/check-http.avi"}}"
VLC media player 0.9.0-svn Grishenko
[00000305] main playlist error: Reloading playlist not implemented.
[00000312] dummy interface: using the dummy interface module...
[00000332] main access: International Domain Names not supported
[00000334] main private error: cannot pre fill buffer
[00000339] dummy demuxer: command `quit'


And it sits here, waiting for someone to kill it.

Yeah, can be scripted, too - just run it with & at the end, and kill with $! variable later, but it's not very clean solution.

kmf31
Cone that earned his stripes
Cone that earned his stripes
Posts: 308
Joined: 11 Mar 2007 21:47

Re: exit VLC when playing ends (for scripts etc.)?

Postby kmf31 » 03 Sep 2007 22:43

vlc -I dummy --run-time 5 http://address:port vlc:quit --sout "#duplicate{dst=std{access=file,mux=ts,dst="/tmp/check-http.avi"}}"
Did you test:

Code: Select all

vlc -I dummy --run-time 5 http://address:port --sout "#duplicate{dst=std{access=file,mux=ts,dst="/tmp/check-http.avi"}}" vlc:quit
i.e. with "vlc:quit" at the end and not in the middle as I already told you:
but as last option of the command line.
By the way, I don't see the sense for "#duplicate{...}" in this particular case. Here "#standard{...}" or maybe "#transcode{...}" (in case you do really transcoding) should be sufficient or even correct. With "#duplicate{...}" you should define a 2nd destination (e.g. a 2nd file or further streaming to another computer etc.).

If I try with #standard and vlc:quit at the end it works:

Code: Select all

vlc -I dummy --run-time 30 http://address:port --sout "#standard{access=file,mux=ts,dst="/tmp/check-http.avi"}" vlc:quit

mangoo
Blank Cone
Blank Cone
Posts: 46
Joined: 16 Jul 2007 12:05
Contact:

Re: exit VLC when playing ends (for scripts etc.)?

Postby mangoo » 03 Sep 2007 22:57

vlc -I dummy --run-time 5 http://address:port vlc:quit --sout "#duplicate{dst=std{access=file,mux=ts,dst="/tmp/check-http.avi"}}"
Did you test:

Code: Select all

vlc -I dummy --run-time 5 http://address:port --sout "#duplicate{dst=std{access=file,mux=ts,dst="/tmp/check-http.avi"}}" vlc:quit
i.e. with "vlc:quit" at the end and not in the middle as I already told you:
but as last option of the command line.
By the way, I don't see the sense for "#duplicate{...}" in this particular case. Here "#standard{...}" or maybe "#transcode{...}" (in case you do really transcoding) should be sufficient or even correct. With "#duplicate{...}" you should define a 2nd destination (e.g. a 2nd file or further streaming to another computer etc.).

If I try with #standard and vlc:quit at the end it works:

Code: Select all

vlc -I dummy --run-time 30 http://address:port --sout "#standard{access=file,mux=ts,dst="/tmp/check-http.avi"}" vlc:quit
Yes, it works 9 times out of 10, but 1 time out of 10, it just doesn't quit.

There is no sense in that "#duplicate{...}", I just minimized the command line to eliminate errors.

unjordi
New Cone
New Cone
Posts: 1
Joined: 04 Mar 2013 04:20

Re: exit VLC when playing ends (for scripts etc.)?

Postby unjordi » 04 Mar 2013 04:26

I found the right way.

I was transcoding a bunch of files and ended up with the same problem, wich was solved adding "vlc://quit" at the end of the command, like this:
vlc <<very fancy things>> vlc://quit
That will do.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 41 guests