Results 1 to 5 of 5
Hi Guys!
I was able to make some video capture using ffmpeg the code of which I posted below.
My question is, would it be possible for me to make ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-30-2012 #1
Help Needed in FFMPEG Tweaking Please.
Hi Guys!
I was able to make some video capture using ffmpeg the code of which I posted below.
My question is, would it be possible for me to make ffmpeg take shots every 3 seconds or so instead of a continues video? Thanks!
Code:jun@jun:~$ ffmpeg -t 00:00:30 -f video4linux2 -s 128x96 -r ntsc -i /dev/video0 -f alsa -ac 2 -i pulse -qscale 3 sample_output.avi
nujinini
Linux User #489667
- 06-01-2012 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,694
i don't know much about ffmpeg, but you could do it with a bash loop, i think. something like this:
i left out the other ffmpeg options, you can add in what you need, but some of those options won't work w/writing to an image file. i don't have a video device, btw, so i can't test this code. i could only do an x11grab to take a video screen capture of my X11 display, but it won't let me do snaps for some reason.Code:#!/bin/bash # how long to run (in seconds) max=30 # how frequently to take a picture int=3 declare -i x=1 until [ $x -gt $max ]; do imgfile="test_$(printf "%02d" $x).png" ffmpeg -f video4linux2 -i /dev/video0 -vframes 1 $imgfile sleep $int x+=$int done
- 06-01-2012 #3
Thanks atreyu!
When I try
#! /bin/bash
It just returns me to the prompt and nothing else happens
fyi.
nujinini
Linux User #489667
- 06-01-2012 #4Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,694
sorry, nujinini, i should have explained a little further. you want to put all that code into a script then execute that script.
so if your editor is nedit, you could do:
then cut-and-paste the code I posted into the editor, then save and quit.Code:nedit ~/ffmpeg-screencap.sh
then make it executable:
then run it:Code:chmod +x ~/ffmpeg-screencap.sh
Code:~/ffmpeg-screencap.sh
- 06-21-2012 #5
try
Code:bash ~/ffmpeg-screencap.sh


Reply With Quote

