Trouble with the ffmpeg -ss flag when capturing one frame from a Macbook iSight webcam
For about five years I've used ffmpeg in a shell script to grab one frame from my linux'd-up Macbook's iSight:
ffmpeg -f video4linux2 -s 640x480 -r 15 -i /dev/video0 -an -vframes 1 -vcodec mjpeg -y -sameq -ss 1.5 snapshot.jpg
I just upgraded my Ubuntu distro from Lucid to Natty (ffmpeg ver. 0.6.2-4:0.6.2-1ubuntu1). Now that syntax turns the iSight on but hangs indefinitely.
[output snipped, ending with:]
frame= 0 fps= 0 q=0.0 Lsize= -0kB time=10000000000.00 bitrate= -0.0kbits/s
video开发者_运维技巧:0kB audio:0kB global headers:0kB muxing overhead -inf%
Without the '-ss' flag it seems to successfully grab the first frame and exit immediately - the only difference in output being:
frame= 1 fps= 0 q=0.0 Lsize= -0kB time=0.07 bitrate= -2.6kbits/s
video:16kB audio:0kB global headers:0kB muxing overhead -100.132730%
However, the '-ss 1.5' was necessary to delay the frame capture by 1.5 seconds to allow the cam sufficient time to adjust the exposure.
The -itsoffset flag seemed promising, but doesn't seem to change ffmpeg's behavior (ie doesn't hang, but no delay).
Any ideas?
精彩评论