5

I'm capturing video from my webcam with the following command:

ffmpeg -r 30 -f v4l2 -video_size 160x120 -i /dev/video0 output.avi

The -r option indicate the framerate I want. However, it's not that I want 30 FPS, it's just that otherwise it does not work correctly.

Without framerate, the capture is very buggy (I guess it tries to capture too much, but can't follow).

With a framerate set to 15, the output video is twice longer that the capturing duration (kind of slow motion).

With a framerate set to 30, it seems to be allright.

How can I be sure that I should use 30 fps? If i'd like to capture 15 fps, what should I do to get a correct playback?

Info about my webcam:

co@macbook2008:~$ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
  Index       : 0
  Type        : Video Capture
  Pixel Format: 'YUYV'
  Name        : YUV 4:2:2 (YUYV)
    Size: Discrete 160x120
      Interval: Discrete 0.033s (30.000 fps)
      Interval: Discrete 0.036s (27.500 fps)
      Interval: Discrete 0.040s (25.000 fps)
      Interval: Discrete 0.044s (22.500 fps)
      Interval: Discrete 0.050s (20.000 fps)
      Interval: Discrete 0.057s (17.500 fps)
      Interval: Discrete 0.067s (15.000 fps)
      Interval: Discrete 0.080s (12.500 fps)
      Interval: Discrete 0.100s (10.000 fps)
      Interval: Discrete 0.133s (7.500 fps)
      Interval: Discrete 0.200s (5.000 fps)
    Size: Discrete 176x144
      Interval: Discrete 0.033s (30.000 fps)
      ... and so on for other resolutions

Thank you

0 Answers0