[sane-devel] Experience with the v4l backend?

Torfinn Ingolfsen tingox at gmail.com
Thu Jan 5 21:28:03 UTC 2017


Hello,
Does anyone here have experience with the v4l backend?
I recently got myself a CZUR ET16 scanner[1,2] and it shows up as a
video device, that is why I have to use the v4l backend. The scanner
has a 16Mpixel sensor, according to the company.
The company has (working) software for Windows, with software for Mac
OS X in beta. No plans for Linux support at this time.
But this device is a USB video class device, so it should work with
sane, provided that the v4l backend is good enough (the man page still
claims that it is alpha...).

Anyway, how do you convince the v4l backend to scan in a different
resolution than 640x480?
[tingo at kg-u35jc ~]$ scanimage -V
scanimage (sane-backends) 1.0.25; backend version 1.0.25


[tingo at kg-u35jc ~]$ scanimage -L
device `v4l:/dev/video1' is a Noname CZUR virtual device
device `v4l:/dev/video0' is a Noname USB 2.0 UVC 0.3M Webcam virtual device

[tingo at kg-u35jc ~]$ scanimage --help --device-name v4l:/dev/video1
Usage: scanimage [OPTION]...

Start image acquisition on a scanner device and write image data to
standard output.

Parameters are separated by a blank from single-character options (e.g.
-d epson) and by a "=" from multi-character options (e.g. --device-name=epson).
-d, --device-name=DEVICE   use a given scanner device (e.g. hp:/dev/scanner)
    --format=pnm|tiff|png|jpeg  file format of output file
-i, --icc-profile=PROFILE  include this ICC profile into TIFF file
-L, --list-devices         show available scanner devices
-f, --formatted-device-list=FORMAT similar to -L, but the FORMAT of the output
                           can be specified: %d (device name), %v (vendor),
                           %m (model), %t (type), %i (index number), and
                           %n (newline)
-b, --batch[=FORMAT]       working in batch mode, FORMAT is
`out%d.pnm' `out%d.tif'
                           `out%d.png' or `out%d.jpg' by default
depending on --format
    --batch-start=#        page number to start naming files with
    --batch-count=#        how many pages to scan in batch mode
    --batch-increment=#    increase page number in filename by #
    --batch-double         increment page number by two, same as
                           --batch-increment=2
    --batch-print          print image filenames to stdout
    --batch-prompt         ask for pressing a key before scanning a page
    --accept-md5-only      only accept authorization requests using md5
-p, --progress             print progress messages
-n, --dont-scan            only set options, don't actually scan
-T, --test                 test backend thoroughly
-A, --all-options          list all available backend options
-h, --help                 display this help message and exit
-v, --verbose              give even more status messages
-B, --buffer-size=#        change input buffer size (in kB, default 32)
-V, --version              print version information

Options specific to device `v4l:/dev/video1':
  Scan Mode:
    --mode Gray|Color [Gray]
        Selects the scan mode (e.g., lineart, monochrome, or color).
    --channel Camera 1 [inactive]
        Selects the channel of the v4l device (e.g. television or video-in.
  Geometry:
    -l 0..447pel (in steps of 1) [inactive]
        Top-left x position of scan area.
    -t 0..271pel (in steps of 1) [inactive]
        Top-left y position of scan area.
    -x 320..767pel (in steps of 1) [inactive]
        Width of scan-area.
    -y 240..511pel (in steps of 1) [inactive]
        Height of scan-area.
  Enhancement:
    --brightness 0..255 [0]
        Controls the brightness of the acquired image.
    --hue 0..255 [0]
        Controls the "hue" (blue-level) of the acquired image.
    --color 0..255 [0]
        Sets the picture's color.
    --contrast 0..255 [0]
        Controls the contrast of the acquired image.
    --white-level 0..255 [0]
        Selects what radiance level should be considered "white".

Type ``scanimage --help -d DEVICE'' to get list of all options for DEVICE.

List of available devices:
    v4l:/dev/video1 v4l:/dev/video0

[tingo at kg-u35jc ~]$ scanimage -d v4l:/dev/video1 --mode Color -T
scanimage: scanning image of size 640x480 pixels at 24 bits/pixel
scanimage: acquiring RGB frame, 8 bits/sample
scanimage: reading one scanline, 1920 bytes...    PASS
scanimage: reading one byte...        PASS
scanimage: stepped read, 2 bytes...     PASS
scanimage: stepped read, 4 bytes...     PASS
scanimage: stepped read, 8 bytes...     PASS
scanimage: stepped read, 16 bytes...     PASS
scanimage: stepped read, 32 bytes...     PASS
scanimage: stepped read, 64 bytes...     PASS
scanimage: stepped read, 128 bytes...     PASS
scanimage: stepped read, 256 bytes...     PASS
scanimage: stepped read, 512 bytes...     PASS
scanimage: stepped read, 1024 bytes...     PASS
scanimage: stepped read, 2048 bytes...     PASS
scanimage: stepped read, 2047 bytes...     PASS
scanimage: stepped read, 1023 bytes...     PASS
scanimage: stepped read, 511 bytes...     PASS
scanimage: stepped read, 255 bytes...     PASS
scanimage: stepped read, 127 bytes...     PASS
scanimage: stepped read, 63 bytes...     PASS
scanimage: stepped read, 31 bytes...     PASS
scanimage: stepped read, 15 bytes...     PASS
scanimage: stepped read, 7 bytes...     PASS
scanimage: stepped read, 3 bytes...     PASS

Gray doesn't work:
[tingo at kg-u35jc ~]$ scanimage -d v4l:/dev/video1 --mode Gray -T
scanimage: sane_start: Invalid argument

More info can be found at my Fedora page[3] for this scanner.
If more info / testing / debugging is needed, I can do it.

References:
1) http://www.czur.com/product/ET16
2) https://www.indiegogo.com/projects/czur-scanner-build-your-own-digital-library--2/
3) https://sites.google.com/site/tingox/ig_czurtek_czur_scanner_fedora
-- 
Regards,
Torfinn Ingolfsen
Oslo, Norway



More information about the sane-devel mailing list