Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am working with VLC from C# by creating a process that opens the command line.

Is there any way of knowing when a movie ended in from the command line or something ?

share|improve this question

2 Answers 2

vlc.exe file.xxx vlc:quit

Then, wait for your process to terminate:

var info = new System.Diagnostics.ProcessStartInfo(); 
info.FileName = @"c:\path\to\vlc.exe file.xxx vlc:quit"; 
var process = new System.Diagnostics.Process(); 
process.StartInfo = info; 
process.Start(); 

//Wait for the process to be completed 
process.WaitForExit(); 

//It's finished. Enter your code here.
share|improve this answer
    
It is also worth noting that VLC has a command-line varient (CVLC/CVLC.exe) which is functionally the same, however it simply launches a video window that has no controls or menus unless you explicity enable them. Which depending on your usage may be a slightly improved situation. –  Turix Apr 13 '12 at 11:17

If you add vlc://quit to the playlist after the intended file you want to play, VLC will quit after playback has finished. This is surely possible to catch from the command-line.

(Perhaps this is also what you really are trying to do: quit VLC after playback has finished and let the script continue.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.