Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VLC command to stop recording a stream

First of all, thanks everyone who is even reading this. I'm able to save a stream from my IP CAM into a file using the given command (although I'm getting no audio recorded to the file, if anyone can help with that would be great too)

cvlc "http://***.***.*.***:****/videostream.asf?user=admin&pwd=**&rate=12&resolution=32" --run-time=10 --sout="#std{access=file,mux=asf,dst=path\test.asf}" vlc://quit --qt-start-minimized --no-qt-notification

This gives me a 7~8 seconds long recording, but the lenght of the video I want to make will be determined by an external factor (the camera's motion detection alarm). If I remove the "--run-time" it starts recording undefinatelly, so how can I tell VLC that it's time to stop saving the stream? ps: I want to make this automatic, so I'm only using command line. ps2: I'm using Ubuntu OS.

Thank you all very much!

like image 362
Gustavo Sgarbi Campos Avatar asked Nov 01 '22 12:11

Gustavo Sgarbi Campos


1 Answers

I'm by no means and expert on this subject but I am also capturing a live stream to start and stop at specific times. I don't know about the audio issue but here is my code maybe it will help you out somewhat.

at 2014-05-23 10:00
cvlc "http://*My url to video stream*" --sout file/mp4:*THEFILENAMEYOUCHOOSE*.mp4 --run-time=300 --stop-time=300 vlc://quit

Essentially I use the runtime and stop time switches to make sure it stops when I need it to, 300 seconds works out to almost an hour and a half of video so that's plenty for my needs, I'm having some trouble with being able to automatically script this so at this point I'm having to type the commands in by hand to set up the recording which is less than ideal.

Hope this helps you out even a little.

like image 148
user3664670 Avatar answered Nov 16 '22 05:11

user3664670