Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#48 Link against libv4l1


As discussed in https://sourceforge.net/tracker/?func=detail&aid=3272052&group_id=5776&atid=105776 linux kernel has dropped support for V4L1. There is however a library to provide V4L1-compatible access to V4L2 drivers. In the mentioned report, sikon suggested mjpeg tools use this. The attached patch is an attempt to make that change. It does compile for me, but I haven't tested it yet as my V4L device is currently unavailable.


  • First version of patch

    • assigned_to: nobody --> waldviertler
  • Thanks for posting the patch.

    I am not sure if this is the right way. The reason why I am unsure is that Klaus Stengel updated the zoran driver so it works on modern machine, and he hat posted a first ptach for the liblavrec. Where the mjpegtools use v4l2. That works only half way, but I think it is really a start:
    https://sourceforge.net/mailarchive/message.php?msg_id=27540662 (search for liblavrec.c.bz2)

    For a long term solution I would prefer that the mjpegtools native support v4l2.

  • Dimitri P.
    Dimitri P.

    > For a long term solution I would prefer that the mjpegtools native support v4l2.
    Me too )
    patch for liblavrec didn`t do his job. Also after compiling 2.0.0 I can`t find lavrec itself.

    ~/i/mjpeg/mjpegtools-2.0.0 $ find . -iname 'lavrec*'

    ~/i/mjpeg/mjpegtools-2.0.0 $ gcc -I./utils/ -I./lavtools/ lavtools/lavrec.c -o lavtools/lavrec
    lavtools/lavrec.c: В функции «Usage»:
    lavtools/lavrec.c:224:38: ошибка: expected «)» before «VERSION»

    ~/i/mjpeg/mjpegtools-2.0.0 $ lavvideo --help
    lavvideo: invalid option -- '-'
    lavvideo shows an overlay video window on the screen.

    usage: lavvideo [ options ]

    options: [defaults]
    -h help
    -v verbose operation
    -d debug information
    -c device specify device [/dev/video0]
    -t seconds the time the video window shows [infinite]
    -s size specify size [400x300]
    -o offset displacement on screen [5x5]
    -x xres screen x resolution [800]
    -b pixbits Bits per pixel (15,16,24,32) [32]
    -n tvnorm set pal/ntsc/secam [pal]
    -i input set input source (int) [0]
    -C chanlist channel list
    (c) 2000 Gernot Ziegler<gz@lysator.liu.se>
    ~/i/mjpeg/mjpegtools-2.0.0 $ lavvideo -s 768x576
    VIDIOCSCHAN failed.: Invalid argument

  • You are right, for some strange reason compiling fails on my machine too,

    When I add to after the line: #include "v4l.h"
    this line: #include <linux/videodev.h>
    to that files: lavvideo.c, liblavplay.c, liblavrec.c, testrec.c,
    compiling work and you should have again lavrec. Please add the lines, and tell us the result.