Split DirectShow Capture
I am currently using ffmpeg to capture video and audio from direcshow (windows 7):
ffmpeg.exe -f dshow -i video="V string":audio="A string" -r 25 -t 300 -n output.avi
"-t 300" makes it to capture for 300 seconds (5 mins). But i would like to capure more time splitting the output file in chunks.
For example make a 30 minute recording in 6 chunks of 5 minutes. I could do this in a batch file calling 6 times ffmpeg in a loop, but in this way i lose capture time between the loops (1 second more or less). I would like to do it without losing capture time.
Any way i can make this to happen?
Thanks for your reply. I cant get it to work, i am probably doing something wrong.
ffmpeg.exe -f dshow -s 352x288 -i video="Video WebCam":audio="Micr¢fono (Realtek High Definit" -r 10 -f segment out%03d.avi
I also tried this:
ffmpeg.exe -f dshow -s 352x288 -i video="Video WebCam":audio="Micr¢fono (Realtek High Definit" -r 10 -f segment -time 10 out%03d.avi
I put this just to show and compare how it works without segmenting.
ffmpeg.exe" -f dshow -s 352x288 -i video="Video WebCam":audio="Micr¢fono (Realtek High Definit" -r 10 out.avi
Looks like their documentation is out of date. Try something more like this:
change vcodec/acodec to whatever codec types you are aiming for.
**This is for ver. 0.9.x
Thanks. I tried what you said but it still isnt working:
ffmpeg.exe" -f dshow -s 320x240 -i video="Video WebCam":audio="Micr¢fono (Realtek High Definit" -vcodec ffv1 -acodec pcm_s16le -map 0 -r 5 -f segment -segment_time 10 -container_format avi -segment_pattern %03d -segment_basename output dummy_out.avi
I have been trying with older ffmpeg builds and i found that with this build it works:
I would like to use last build of ffmpeg if possible, but it says "Unrecognized option 'container_format'". Did the segmenting option names change? Is there any way to use segmenting with last build?
Thanks for your replies, i can work with it now.
The builds you are using are pulled directly from the git repo. Most likely they are coming from the tip of the development branch, which could have any number of undocumented changes. Furthermore, you don't really know if that is pulled from the mainline git repo, or somebody's private clone which could potentually also have changes in it that differ from the main development.
Trying finding builds of release versions. I am using 0.9.1, which is the most recently tagged release. Unless you need some feature that has been added since the 0.9.x branch was created, you will probably have the benefit of better stability as well.
To close the issue, here can be seen the changes made to segment.c
On 2011-12-19 was when they changed the variable names to "segment_time", "segment_format"...
I am not using this last version because seems to work worse than 2011-10-17 version.
I has a bug (or i am using it wrong) that if i want to encode a video segmented in 10 sec chunks, the first clip is 10 seconds long, the second 20 seconds long (only last 10 sec with video data), the third is 30 secs long (only last 10 sec with video data), and so on.