I'm encoding video from a Logitech Oribit AF that should support these resolutions under USB 1.1 for mjpeg: Listing available frame formats for device video0: Pixel format: MJPG (MJPEG; MIME type: image/jpeg) Frame size: 160x120 Frame rates: 30, 25, 20, 15, 10, 5 Frame size: 176x144 Frame rates: 30, 25, 20, 15, 10, 5 Frame size: 320x240 Frame rates: 30, 25, 20, 15, 10, 5 Frame size: 352x288 Frame rates: 30, 25, 20, 15, 10, 5 Frame size: 640x480 Frame rates: 30, 25, 20, 15, 10, 5 Frame size: 800x600 Frame rates: 15, 10, 5 When I try to record with ffmpeg at 320x240, it forces the resolution down to 176x144. This would be correct behavior for YUYV, but 320x240 MJPG should be no problem, even on USB 1.1. Here's the command and output: root at gumstix-custom-verdex:~$ ffmpeg -s 320x240 -r 5 -f video4linux2 -vcodec mjpeg -i /dev/video0 out.avi FFmpeg version SVN-r15392, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --enable-cross-compile --cc=/home/randall/gumstix/gumstix-oe/tmp/cross/bin/arm-angstrom-linux-gnueabi-gcc --arch=arm --enable-nonfree --disable-stripping --disable-armvfp --disable-armv6 libavutil 49.10. 0 / 49.10. 0 libavcodec 52. 0. 0 / 52. 0. 0 libavformat 52.22. 1 / 52.22. 1 libavdevice 52. 1. 0 / 52. 1. 0 built on Sep 23 2008 13:05:31, gcc: 4.1.2 [video4linux2 @ 0x7c3320][3]Capabilities: 4000001 [video4linux2 @ 0x7c3320]The V4L2 driver changed the video from 320x240 to 176x144 Input #0, video4linux2, from '/dev/video0': Duration: N/A, start: 1222143652.782699, bitrate: 2027 kb/s Stream #0.0: Video: mjpeg, yuyv422, 176x144, 2027 kb/s, 5.00 tb(r) File 'out.avi' already exists. Overwrite ? [y/N] y Output #0, avi, to 'out.avi': Stream #0.0: Video: mpeg4, yuv420p, 176x144, q=2-31, 200 kb/s, 5.00 tb(c) Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding frame= 0 fps= 0 q=0.0 size= 6kB time=10000000000.00 bitrate= 0.0kbits/s BTW, it also just seems to do nothing. It doesn't actually write any data. I'm able to achieve 800x600 with uvccapture. If I leave out "-vcodec mjpeg", it drops to the same resolution and does encode and write data, but it uses YUYV instead of MJPG input. Ideas? Randall
Bumping and condensing. Condensed question: How do I tell ffmpeg to force the webcam to mjpeg (low bandwidth) mode? -Randall Randall Smith wrote:
I'm encoding video from a Logitech Oribit AF that should support these resolutions under USB 1.1 for mjpeg:
Listing available frame formats for device video0: Pixel format: MJPG (MJPEG; MIME type: image/jpeg) Frame size: 160x120 Frame rates: 30, 25, 20, 15, 10, 5 Frame size: 176x144 Frame rates: 30, 25, 20, 15, 10, 5 Frame size: 320x240 Frame rates: 30, 25, 20, 15, 10, 5 Frame size: 352x288 Frame rates: 30, 25, 20, 15, 10, 5 Frame size: 640x480 Frame rates: 30, 25, 20, 15, 10, 5 Frame size: 800x600 Frame rates: 15, 10, 5
When I try to record with ffmpeg at 320x240, it forces the resolution down to 176x144. This would be correct behavior for YUYV, but 320x240 MJPG should be no problem, even on USB 1.1. Here's the command and output:
root at gumstix-custom-verdex:~$ ffmpeg -s 320x240 -r 5 -f video4linux2 -vcodec mjpeg -i /dev/video0 out.avi FFmpeg version SVN-r15392, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --enable-cross-compile --cc=/home/randall/gumstix/gumstix-oe/tmp/cross/bin/arm-angstrom-linux-gnueabi-gcc --arch=arm --enable-nonfree --disable-stripping --disable-armvfp --disable-armv6 libavutil 49.10. 0 / 49.10. 0 libavcodec 52. 0. 0 / 52. 0. 0 libavformat 52.22. 1 / 52.22. 1 libavdevice 52. 1. 0 / 52. 1. 0 built on Sep 23 2008 13:05:31, gcc: 4.1.2 [video4linux2 @ 0x7c3320][3]Capabilities: 4000001 [video4linux2 @ 0x7c3320]The V4L2 driver changed the video from 320x240 to 176x144 Input #0, video4linux2, from '/dev/video0': Duration: N/A, start: 1222143652.782699, bitrate: 2027 kb/s Stream #0.0: Video: mjpeg, yuyv422, 176x144, 2027 kb/s, 5.00 tb(r) File 'out.avi' already exists. Overwrite ? [y/N] y Output #0, avi, to 'out.avi': Stream #0.0: Video: mpeg4, yuv420p, 176x144, q=2-31, 200 kb/s, 5.00 tb(c) Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding frame= 0 fps= 0 q=0.0 size= 6kB time=10000000000.00 bitrate= 0.0kbits/s
BTW, it also just seems to do nothing. It doesn't actually write any data. I'm able to achieve 800x600 with uvccapture. If I leave out "-vcodec mjpeg", it drops to the same resolution and does encode and write data, but it uses YUYV instead of MJPG input. Ideas?
Randall
Randall Smith wrote:
Bumping and condensing. Condensed question:
How do I tell ffmpeg to force the webcam to mjpeg (low bandwidth) mode?
My understanding would be that ffmpeg just takes a video stream, it does not do anything with the webcam. You'd have to tell v4l what resolution, framerate and format you want the webcam's output to be. - Naz.
participants (2)
-
lists@mrnaz.com -
randall@tnr.cc