On Aug 23 15:56:00, s...@spacehopper.org wrote:
> On 2019-08-23, Jan Stary <h...@stare.cz> wrote:
> > This is current/amd64 on a Dell Latitude E5570 (dmesg below).
> > I am trying to use a USB camera (bought with a microscope,
> > to display the miracles of paramecium life on the laptop).
> >
> > https://www.bresser.de/en/Astronomy/Accessories/BRESSER-MikrOkular-Full-HD-eyepiece-camera.html
> >
> > uvideo1 at uhub0 port 1 configuration 1 interface 0 "Alcor Micro
> > MikrOkularHD" rev 2.00/0.00 addr 4
> > video1 at uvideo1
> >
> > While video(1) works with the laptop's integrated camera (video0),
> > it doesn't work with this USB camera (video1):
> >
> >   $ doas video -f /dev/video1 -v         
> >   doas (h...@dell.stare.cz) password: 
> >   video: /dev/video1 has no usable YUV encodings
> >
> > The device itself works, in that "doas cat /dev/video1 > /tmp/video.raw"
> > spews out data, presumably frames captured by the camera. I can even
> > play that back with "video -i /tmp/video.raw", but it's garbage,
> > not being in one of the "YUV encodings". file(1) says
> >
> > /tmp/video.raw: JPEG image data, JFIF standard 1.01,
> >     baseline, precision 0, 4360x720
> >
> > so is it some format based on a sequence of jpges?
> > (Please excuse my video ignorance.)
> 
> MJPEG? that's possible.
> 
> Try some of these:

Trying again after an upgrade

> ffplay -f video4linux2 /dev/video0

works, i.e. displays a 640x480 window of what the camera sees,
and says

    Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 1590871894.699098, bitrate: N/A
    Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, 
bt470bg/unknown/unknown), 640x480 [SAR 1:1 DAR 4:3], 30 fps, 30 tbr, 1000k tbn, 
1000k tbc

> mplayer tv:// 

works, and says

Playing tv://.
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschew...@zpr.uni-koeln.de>
 comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was 
used instead.
Selected device: MikrOkularHD
 Capabilities:  video capture  read/write  streaming
 supported norms:
 inputs: 0 = Camera Terminal;
 Current input: 0
 Current format: MJPEG
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Inappropriate ioctl for device
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: ioctl set mute failed: Invalid argument
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 58.54.100 (external)
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
==========================================================================
Audio: no sound
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x26c8b018]bicubic scaler, from yuv422p to yuyv422 using MMXEXT
[swscaler @ 0x26c8b018]using unscaled yuv422p -> yuyv422 special converter
VO: [xv] 640x480 => 640x480 Packed YUY2  [fs]
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 640x480 => 640x480 Packed YUY2  [fs]
V:   0.0  22/ 22 ??% ??% ??,?% 0 0 J
v4l2: ioctl set mute failed: Invalid argument


I don't know what the VIDIOC_G_STD ioctl is
and if there is anything being missed using VIDIOC_G_PARM instead.

> mpv tv://

No protocol handler found to open URL tv://
The protocol is either unsupported, or was disabled at compile-time.
Exiting... (Errors when loading file)

> If you want to record, and ffplay works,
> you should at least be able to use ffmpeg
> and write a file with a standard container format.

Yes. Thanks again for the tips.

To understand the original problem: video(1) supports certain encodings,
namely uyvy, yuy2 and yv12; the mjpeg encoding this camera is using
just isn't one of those. That's what the

        USB camera has no usable YUV encodings

error message means, right? So my original problem
is not with the camera, it's just that video(1)
does not support its emcoding. (Luckily, ffplay etc,
being more fully-fledged video programs, do support mjpeg.)


        Jan

Reply via email to