4

Goal is to capture video from my old usb webcam (device 0733:0430). Trying to save video gives this error. (I've tried both ffmpeg and avconv.)

Command ffmpeg -f v4l2 -i /dev/video2 -s 160x120 tmp.mkv

[video4linux2,v4l2 @ 0x815280] Time per frame unknown
[video4linux2,v4l2 @ 0x815280] Cannot find a proper format for codec 'none' (id 0), pixel format 'none' (id -1)
Assertion *codec_id != AV_CODEC_ID_NONE failed at /build/buildd/ffmpeg-2.3/libavdevice/v4l2.c:802

I know it can work on Linux, because I had it running a few years ago. How to get it to work now?


Below is information about the device.

Device dmesg output

[53008.270283] usb 2-1.2: new full-speed USB device number 4 using ehci-pci
[53008.363405] usb 2-1.2: New USB device found, idVendor=0733, idProduct=0430
[53008.363416] usb 2-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[53008.779745] gspca_main: v2.14.0 registered
[53008.809496] gspca_main: spca505-2.14.0 probing 0733:0430
[53008.812508] usbcore: registered new interface driver spca505

ffmpeg -list_formats 1 -f v4l2 -i /dev/video2

[video4linux2,v4l2 @ 0xbed5e0] Raw       : Unsupported :                 S505 : 160x120 176x144 320x240 352x288

v4l-info /dev/video2

### v4l2 device info [/dev/video2] ###
general info
    VIDIOC_QUERYCAP
        driver                  : "spca505"
        card                    : "USB Camera (0733:0430)"
        bus_info                : "usb-0000:00:1d.0-1.2"
        version                 : 3.13.11
        capabilities            : 0x85000001 [VIDEO_CAPTURE,READWRITE,STREAMING,(null)]

standards

inputs
    VIDIOC_ENUMINPUT(0)
        index                   : 0
        name                    : "spca505"
        type                    : CAMERA
        audioset                : 0
        tuner                   : 0
        std                     : 0x0 []
        status                  : 0x0 []

video capture
    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
        index                   : 0
        type                    : VIDEO_CAPTURE
        flags                   : 0
        description             : "S505"
        pixelformat             : 0x35303553 [S505]
    VIDIOC_G_FMT(VIDEO_CAPTURE)
        type                    : VIDEO_CAPTURE
        fmt.pix.width           : 160
        fmt.pix.height          : 120
        fmt.pix.pixelformat     : 0x35303553 [S505]
        fmt.pix.field           : NONE
        fmt.pix.bytesperline    : 160
        fmt.pix.sizeimage       : 28800
        fmt.pix.colorspace      : SRGB
        fmt.pix.priv            : 0

controls
    VIDIOC_QUERYCTRL(BASE+0)
        id                      : 9963776
        type                    : INTEGER
        name                    : "Brightness"
        minimum                 : 0
        maximum                 : 255
        step                    : 1
        default_value           : 127
        flags                   : 32
3
  • 4
    It took about 15 minutes to check all combinations of pix_fmt and framerate. They all appear to have resulted in the same error. I used this to check - ffmpeg -pix_fmts | sed 1,8d | awk '{ print $2; }' | while read i; do for j in $(seq 60); do ffmpeg -f v4l2 -i /dev/video2 -pix_fmt "$i" -r "$j" -s 160x120 -y tmp.mkv; echo "$i $j"; done; done Commented Aug 9, 2014 at 15:43
  • Clever stuff. The "same error" being the original error? Commented Aug 9, 2014 at 15:45
  • Same as original error, yes Commented Aug 10, 2014 at 11:47

1 Answer 1

0

I think you can use the guvcview. That's how I got my old webcam (Creative model CT6840) to work.

Though, I still couldn't get it to work with ffmpeg and ffplay. I hope someone can help us out here...

2
  • Since OP explicitly mentioned the need to work with ffmpeg I am afraid this answer does not bring much more than declaring… "I'm facing that problem too…" ;-) Commented Feb 28, 2024 at 14:16
  • 1
    I understand, though having an alternative while getting ffmpeg to work is a good thing. I am sure people looking for an answer (like me) can use guvcview to atleast check that their camera does output a video and it is only a matter of getting ffmpeg to work. I think this information is quite helpful :) Commented Feb 29, 2024 at 0:20

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.