Split stream into multiple files

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
jankarlitos
Blank Cone
Blank Cone
Posts: 26
Joined: 23 Jan 2009 23:49

Split stream into multiple files

Postby jankarlitos » 26 Mar 2009 18:29

Hi,

I have an IP camera, streaming 24/7. I need to watch the stream live, and save it in multiple files, let's say a file per hour, or a file per 100 MB, or anything else.

I can watch the stream, and save it in a single file... but i don't know if it's possible to split it.

I would appreciate any help, regarding if this is possible using VLC, and if so, how to do it.

Thanks.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Split stream into multiple files

Postby Jean-Baptiste Kempf » 28 Mar 2009 18:53

No. Fill a feature request.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kg4dhz
New Cone
New Cone
Posts: 6
Joined: 12 May 2008 18:06

Re: Split stream into multiple files

Postby kg4dhz » 31 Mar 2009 01:51

Actually, there is a way.. a few actually..

The commandline provides the ability to limit recording time to a filename, hence 1 day, or 24 hours or 1440 minutes or 86400 seconds.. (I forgot which I used.)

I was using VLC to record my favorite 80s station so I could load it onto my IPOD. and since I had a system running fulltime, it was the best choice.

Now, for the filename issue, this gets tricky..

If you are a programmer, you can solve this by writing your own 10 line program (or less depending on the language). or if you are crafty, do it all with a VBS script (or similar.)

To do it in DOS is complicated, but follow me for a sec..

echo %date%

on a normal system (MSDOS 6.2 and up) should report something like "Mon 03/30/2009", well.. the day I posted anyways.. This is not a valid filename. However, using Regional settings on the system account will allow you to change this. (Very complicated and dangerous).. a personal script can reform the date to something like 03-30-2009.mpg

to launch (and I am recreating this from what I find right now), you would create a batch file with a single line:
"C:\Program Files\VideoLAN\VLC\vlc.exe" --stop-time=86405 dshow:// :dshow-vdev="TD3101_3104 Video Capture" :dshow-adev="TD3101_3104 Audio Capture" :sout=#transcode{vcodec=WMV1,vb=800,scale=1}:duplicate{dst=std{access=file,mux=asf,dst=%date%.avi}}
I know I screwed up the line.. but it would end up being something like that...

Basically, there is a command that tells VLC to stop recording (or playing) after a number of seconds. the rest is just the information that tells it how to work. -sout would point to a file, and the input would be normal..

Once this is figured out, put it into a batch file like c:\rec.bat

Now, for the tricky part.. but there is light at the end of the tunnel... I am asuming you are using Windows...

Click Start -> Programs -> Accessories -> System Tools -> Scheduled Tasks
click Add Scheduled Task
If the "First Time" wizard appears, click Next.
It now asks what program to use, click Browse, then enter c:\rec.bat
it nos asks for a name. Enter Daily Recorder (or something similar
Enter When my computer starts. (Don't worry. we'll add the daily shortly.)
click Next.
Now, it asks what user to run as... Preferrably, enter a username that you don't use, but has full access to the directory in question, and to VLC. If you use your normal account, the window will be visible, and you can accidentally cancel the recording.

Once entered, click next.
Now, you have successfully finished the first half. Press Finish.

ok. now to make it run safely.
Right click on the new event and click Properties.
Select the tab /Schedule\ at the top.
at the bottom, check the "Show Multiple Schedules" box.
Now, click [New] to add the daily routine.
Set to Daily as 12:01am (trust me.) and set to every 1 days.
now click Apply to save this step.

ok, now for fault fixing.. click on /Settings\
Uncheck all boxes.

Finally, if the program stops, it will not restart until the following day..

There are some holes in this posting (mostly because I haven't done this in almost a year, and can't find my original batch file used to do the recording, however, I got a full 7 days of 24 hours of my favorite music recorded and onto my IPOD for travel. The only real downside to this is whether or not a program is capable of editing such large files, or even playing them back. However, VLC has handled these greatly.

There are a few other ways to do this, and 2 that can get you into real trouble, but I think what I have provided will help you, or someone else will get the idea and fill in the blanks..

If I find my batch file, I will post it here (minus the recording location).

Also, when watching the security recording, using keyboard combinations allow you to "skim" a recording successfully.
Shift-Left and Shift-Right is the default for short jumps. You can also use + to speed up the video. I have a very fast dual-processor system that can only handle 4x video, but that's good enough to skip through a day's video in about 30 minutes (less when skimming.)

I only wish they had these features available internally, and the ability to save configuration to a batch file. (would save me looking it all up next time.)

Good luck.

(Can't believe this was just recently posted.)

Perplexer
New Cone
New Cone
Posts: 8
Joined: 11 May 2008 21:22

Re: Split stream into multiple files

Postby Perplexer » 27 Jun 2009 10:43

I'm looking for the exact same thing. However I don't want to mess around with scripts and all. Sounds way too complicated. There are programs out there that allow you to save Internet streams. I think it's just a matter of finding the one that has the ability to split the files every few MB or every few hours and also automatically delete the oldest ones so that you can leave the system running indefinitely without the need for any human intervention. I am having MAJOR problems finding such a program, even a commercial one. Frustrating.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Split stream into multiple files

Postby VLC_help » 27 Jun 2009 11:56

I am having MAJOR problems finding such a program, even a commercial one.
AFAIK there isn't a program that would split all known container formats to certain sized files. You can easily split MKV (use MKVtoolnix), MP4 (use MP4box), AVI (use AVIdemux or Virtualdub) and ASF/WMV (use AsfBin) files with command-line tools, if you want some automated process.

Sunpeace
New Cone
New Cone
Posts: 4
Joined: 23 Jan 2014 12:26

Re: Split stream into multiple files

Postby Sunpeace » 10 May 2014 14:42

No. Fill a feature request.
Has it already been implemented?


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 118 guests