Pygame camera can't read from non-default v4l2 video inputs

Issue #183 new
Former user created an issue

The camera module in pygame can read from /dev/videoN but only from the default input number 0, with the default norm.

Some video capture devices (like this one) must be given an input number and norm in order to work properly.

For example, to read input 1 as NTSC (not PAL) on that Kworld USB2800D device, you do this in mplayer:

mplayer tv:// -tv device=/dev/video1:input=1:norm=NTSC

In pygame there is no way to specify the equivalent of "input=1:norm=NTSC".

The neccesary details are specified here(

[Thanks to 'nrp' for explaining this to me on IRC.]

Comments (1)

  1. René Dudfield

    For norm... it looks like the VIDIOC_S_STD is to be set.

    With a std_id type from here:

    The code to set it will be something like:

    v4l2_std_id std_id;
    if (-1 == v4l2_xioctl (fd, VIDIOC_S_STD, std_id)) {
    // error handling. "Error selecting %d VIDIOC_S_STD", std_id);

    Then of course you will have to extend the Camera object to take in optional arguments.

    src/camera_v4l2.c is where this all lives in the pygame source.

  2. Log in to comment