Sout to a series of files without restarting vlc

About encoding, codec settings, muxers and filter usage
steinhak
Blank Cone
Blank Cone
Posts: 11
Joined: 04 May 2013 05:46

Sout to a series of files without restarting vlc

Postby steinhak » 05 May 2014 19:15

Hi,
We are developing a ip video recording solution based on the vlc player. Right now I'm faced with a task of writing a python script that does:

1) Establish connection to a network stream.
2) Write a series of short temporary files (10 to 30 seconds long) with no gaps from one another without disconnecting from stream source ( reconnection cause delays and artifacts). I plan on using use a tmpfs for that.
3) Glue all the files together and dump them on a main hard drive.
4) Disconnects from the network stream.

All those difficulties are needed because we can't read the video file before it's complitely written and closed (moov atom written at the begining)

Right now, my algorithm looks like this:

1) Open a vlc subprocess with --run-time 600 --sout "#http{dst=127.0.0.1:XXXX,mux=ts}
2) Sleep(2) for stream to settle down
3) Open another vlc supbrocess with http://127.0.0.1:XXXX --run-time=10 --sout #std{access=file,dst=fileN.mp4} Repeat 60 times. Store the names of the file in temporary list
4) Open all the the files with vlc with --sout-keep --sout "#{access=file,dst=result.mp4}

Overall this could work... But I think, there can be a more elegant and easier solution. Something like vlc's rc but with the ability to set sout's.

Can you point me to the right direction?

Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 23 guests