Re: USB camera has "no usable YUV encodings"

2020-05-30 Thread Jan Stary
On Aug 23 15:56:00, s...@spacehopper.org wrote:
> On 2019-08-23, Jan Stary  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 
 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



Re: USB camera has "no usable YUV encodings"

2020-05-30 Thread Jan Stary
On Aug 23 10:49:41, 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

For the archives, this is the USB camera ataching with UVIDEO_DEBUG.
In particular, the format seems to be MJPEG as Stuart suggested.

Jan


May 30 14:00:21 mb32 /bsd: uvideo1 at uhub0 port 3 configuration 1 interface 0 
"Alcor Micro MikrOkularHD" rev 2.00/0.00 addr 3
May 30 14:00:21 mb32 /bsd: bLength=9
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x02 (UDESC_CONFIG)
May 30 14:00:21 mb32 /bsd: |
May 30 14:00:21 mb32 /bsd: bLength=9
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x02
May 30 14:00:21 mb32 /bsd: wTotalLength=311
May 30 14:00:21 mb32 /bsd: bNumInterface=0x02
May 30 14:00:21 mb32 /bsd: bConfigurationValue=0x01
May 30 14:00:21 mb32 /bsd: iConfiguration=0x00
May 30 14:00:21 mb32 /bsd: bmAttributes=0x80
May 30 14:00:21 mb32 /bsd: bMaxPower=0x64
May 30 14:00:21 mb32 /bsd: bMaxPower=0x64
May 30 14:00:21 mb32 /bsd: bLength=8
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x0b (UDESC_IFACE_ASSOC)
May 30 14:00:21 mb32 /bsd: |
May 30 14:00:21 mb32 /bsd: bLength=8
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x0b
May 30 14:00:21 mb32 /bsd: bFirstInterface=0x00
May 30 14:00:21 mb32 /bsd: bInterfaceCount=2
May 30 14:00:21 mb32 /bsd: bFunctionClass=0x0e
May 30 14:00:21 mb32 /bsd: bFunctionSubClass=0x03
May 30 14:00:21 mb32 /bsd: bFunctionProtocol=0x00
May 30 14:00:21 mb32 /bsd: iFunction=0x04
May 30 14:00:21 mb32 /bsd: iFunction=0x04
May 30 14:00:21 mb32 /bsd: bLength=9
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x04 (UDESC_INTERFACE)
May 30 14:00:21 mb32 /bsd: |
May 30 14:00:21 mb32 /bsd: bLength=9
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x04
May 30 14:00:21 mb32 /bsd: bInterfaceNumber=0x00
May 30 14:00:21 mb32 /bsd: bAlternateSetting=0x00
May 30 14:00:21 mb32 /bsd: bNumEndpoints=1
May 30 14:00:21 mb32 /bsd: bInterfaceClass=0x0e
May 30 14:00:21 mb32 /bsd: bInterfaceSubClass=0x01
May 30 14:00:21 mb32 /bsd: bInterfaceProtocol=0x00
May 30 14:00:21 mb32 /bsd: iInterface=0x04
May 30 14:00:21 mb32 /bsd: iInterface=0x04
May 30 14:00:21 mb32 /bsd: bLength=13
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x24 (CS_INTERFACE)
May 30 14:00:21 mb32 /bsd: bDescriptorSubtype=0x01 (UDESCSUB_VC_HEADER)
May 30 14:00:21 mb32 /bsd: |
May 30 14:00:21 mb32 /bsd: bLength=13
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x24
May 30 14:00:21 mb32 /bsd: bDescriptorSubtype=0x01
May 30 14:00:21 mb32 /bsd: bcdUVC=0x0100
May 30 14:00:21 mb32 /bsd: wTotalLength=79
May 30 14:00:21 mb32 /bsd: dwClockFrequency=3000
May 30 14:00:21 mb32 /bsd: bInCollection=0x01
May 30 14:00:21 mb32 /bsd: bInCollection=0x01
May 30 14:00:21 mb32 /bsd: bLength=28
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x24 (CS_INTERFACE)
May 30 14:00:21 mb32 /bsd: bDescriptorSubtype=0x06 (UDESCSUB_VC_EXTENSION_UNIT)
May 30 14:00:21 mb32 /bsd: |
May 30 14:00:21 mb32 /bsd: bLength=28
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x24
May 30 14:00:21 mb32 /bsd: bDescriptorSubtype=0x06
May 30 14:00:21 mb32 /bsd: bUnitID=0x06
May 30 14:00:21 mb32 /bsd: guidExtensionCode=0xb0d0bb68a461834b90b7a6215f3c4f70
May 30 14:00:21 mb32 /bsd: bNumControls=0x18
May 30 14:00:21 mb32 /bsd: bNrInPins=0x01
May 30 14:00:21 mb32 /bsd: bNrInPins=0x01
May 30 14:00:21 mb32 /bsd: bLength=18
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x24 (CS_INTERFACE)
May 30 14:00:21 mb32 /bsd: bDescriptorSubtype=0x02 (UDESCSUB_VC_INPUT_TERMINAL)
May 30 14:00:21 mb32 /bsd: |
May 30 14:00:21 mb32 /bsd: bLength=18
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x24
May 30 14:00:21 mb32 /bsd: bDescriptorSubtype=0x02
May 30 14:00:21 mb32 /bsd: bTerminalID=0x01
May 30 14:00:21 mb32 /bsd: wTerminalType=0x0201
May 30 14:00:21 mb32 /bsd: bAssocTerminal=0x00
May 30 14:00:21 mb32 /bsd: iTerminal=0x00
May 30 14:00:21 mb32 /bsd: iTerminal=0x00
May 30 14:00:21 mb32 /bsd: bLength=11
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x24 (CS_INTERFACE)
May 30 14:00:21 mb32 /bsd: bDescriptorSubtype=0x05 (UDESCSUB_VC_PROCESSING_UNIT)
May 30 14:00:21 mb32 /bsd: |
May 30 14:00:21 mb32 /bsd: bLength=11
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x24
May 30 14:00:21 mb32 /bsd: bDescriptorSubtype=0x05
May 30 14:00:21 mb32 /bsd: bUnitID=0x02
May 30 14:00:21 mb32 /bsd: bSourceID=0x01
May 30 14:00:21 mb32 /bsd: wMaxMultiplier=0
May 30 14:00:21 mb32 /bsd: bControlSize=2
May 30 14:00:21 mb32 /bsd: bmControls=0xff37
May 30 14:00:21 mb32 /bsd: iProcessing=0x00
May 30 14:00:21 mb32 /bsd: bmVideoStandards=0x09
May 30 14:00:21 mb32 /bsd: bmVideoStandards=0x09
May 30 14:00:21 mb32 /bsd: bLength=9
May 30 14:00:21 mb32 /bsd: bDescriptorType=0x24 (CS_INTERFACE)
May 30 14:00:21 mb32 /bsd: bDescriptorSubtype=0x03 (UDESCSU

Re: USB camera has "no usable YUV encodings"

2019-08-25 Thread Jan Stary
> On Aug 23 15:56:00, s...@spacehopper.org wrote:
> > > so is it some format based on a sequence of jpges?
> > MJPEG? that's possible.

> > Try some of these:
> > mplayer tv:// 
> 
> Works, looks like video(1), but full-screen
> (which is how my mplayer is configured).
> 
> $ mplayer -tv device=/dev/video1 tv://
> MPlayer SVN-r38138 (C) 2000-2019 MPlayer Team
> 
> Playing tv://.
> TV file format detected.
> Selected driver: v4l2
>  name: Video 4 Linux 2 input
>  author: Martin Olschewski 
>  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 mute failed: Invalid argument
> v4l2: 0 frames successfully processed, 0 frames dropped.
> 
> It does not play, but it recognizes the device
> and apparently, it is a MJPEG stream. Thanks.

Hm, now the same command does play,
and there is yeast on my monitor. Thanks.

mplayer auto-recognizes the mjpeg format,
but reports a lot of frame-decoding errors (see below).

Jan


hans@dell:~$  mplayer -tv device=/dev/video1 tv://
MPlayer SVN-r38138 (C) 2000-2019 MPlayer Team

Playing tv://.
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski 
 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...
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ignoring
[mjpeg @ 0x1db8899f61e0]Found EOI before any SOF, ig

Re: USB camera has "no usable YUV encodings"

2019-08-24 Thread Olivier Antoine
Hi,

I've this kind of message in this bug:
https://marc.info/?l=openbsd-bugs&m=156528542405039

Maybe related?

Cheers,

On Fri, Aug 23, 2019 at 8:45 PM Jan Stary  wrote:
>
> > Thanks for the tips. Here is what they do
> > on video1 (the USB microscope camera).
>
> During these tests, this appeared in the messages:
>
> uvideo1 at uhub0 port 1 configuration 1 interface 0 "Alcor Micro 
> MikrOkularHD" rev 2.00/0.00 addr 4
> video1 at uvideo1
> uvideo1: could not open VS pipe: IOERROR
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
> uvideo1: could not SET probe request: TIMEOUT
> xhci0: wrong trb index (4134157312) max is 255
>
> Can somebody please advice on what these mean?
>
> Jan
>



Re: USB camera has "no usable YUV encodings"

2019-08-23 Thread Jan Stary
> Thanks for the tips. Here is what they do
> on video1 (the USB microscope camera).

During these tests, this appeared in the messages:

uvideo1 at uhub0 port 1 configuration 1 interface 0 "Alcor Micro MikrOkularHD" 
rev 2.00/0.00 addr 4
video1 at uvideo1
uvideo1: could not open VS pipe: IOERROR
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255
uvideo1: could not SET probe request: TIMEOUT
xhci0: wrong trb index (4134157312) max is 255

Can somebody please advice on what these mean?

Jan



Re: USB camera has "no usable YUV encodings"

2019-08-23 Thread Jan Stary
On Aug 23 15:38:17, m...@patrick-wildt.de wrote:
> Try using ffmpeg on /dev/video1

On Aug 23 15:56:00, s...@spacehopper.org wrote:
> >   $ 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:

Thanks for the tips. Here is what they do
on video0 (the built-in laptop webcam) and
on video1 (the USB microscope camera).

> ffplay -f video4linux2 /dev/video0

Works, even without the -f video4linux2 (which seems to be default);
looks much like what video(1) does.

(Is -f video4linux a catch-all codec
to recognize any format it knows?)

$ ffplay -f video4linux2 /dev/video1
[...]
[video4linux2,v4l2 @ 0x1f74a6354800] Cannot find a proper format for
codec 'none' (id 0), pixel format 'none' (id -1)
Assertion *codec_id != AV_CODEC_ID_NONE failed at libavdevice/v4l2.c:815
Abort trap (core dumped) 

> gst-launch-1.0 v4l2src \! xvimagesink

I have libv4l-1.16.6 and gstreamer-plugins-good-0.10.31p25v0
- is there something else I need to run this?

> mplayer tv:// 

Works, looks like video(1), but full-screen
(which is how my mplayer is configured).

$ mplayer -tv device=/dev/video1 tv://
MPlayer SVN-r38138 (C) 2000-2019 MPlayer Team

Playing tv://.
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski 
 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 mute failed: Invalid argument
v4l2: 0 frames successfully processed, 0 frames dropped.

It does not play, but it recognizes the device
and apparently, it is a MJPEG stream. Thanks.

> mpv tv://

Displays 640x480 worth of garbage.

Playing: tv://
[tv] Selected driver: v4l2
[tv]  name: Video 4 Linux 2 input
[tv] your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was 
used instead.
[tv] Selected device: Integrated_Webcam_HD
[tv]  Capabilities:  video capture  read/write  streaming
[tv]  supported norms:
[tv]  inputs: 0 = Camera Terminal;
[tv]  Current input: 0
[tv]  Current format: RGB24
[tv] tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
[tv] ioctl enum norm failed: Inappropriate ioctl for device
[tv] Error: Cannot set norm!
[tv] Selected input hasn't got a tuner!
[tv] ioctl set mute failed: Invalid argument
(+) Video --vid=1 (rawvideo 640x480 30.000fps)
[gpu] 640x480 yuv420p


$ mpv  --tv-device=/dev/video1 tv:// 
Playing: tv://
[tv] Selected driver: v4l2
[tv]  name: Video 4 Linux 2 input
libv4l2: error setting pixformat: Invalid argument
[tv] your device driver does not support VIDIOC_G_STD ioctl,
VIDIOC_G_PARM was used instead.
[tv] Selected device: MikrOkularHD
[tv]  Capabilities:  video capture  read/write  streaming
[tv]  supported norms:
[tv]  inputs: 0 = Camera Terminal;
[tv]  Current input: 0
[tv]  Current format: MJPEG
libv4l2: error setting pixformat: Invalid argument
[tv] ioctl set format failed: Invalid argument
[tv] ioctl set mute failed: Invalid argument
[tv] 0 frames successfully processed, 0 frames dropped


Knowing I have a mjpeg stream, I will try
to massage the cmdlines some more.

Thanks again for the tips,

Jan



Re: USB camera has "no usable YUV encodings"

2019-08-23 Thread Stuart Henderson
On 2019-08-23, Jan Stary  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:

ffplay -f video4linux2 /dev/video0
gst-launch-1.0 v4l2src \! xvimagesink
mplayer tv:// 
mpv tv://

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.




USB camera has "no usable YUV encodings"

2019-08-23 Thread Jan Stary
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.)

The specification says "UVC" standard, which by
https://en.wikipedia.org/wiki/USB_video_device_class
means would support _some_ UVC-compliant format.

Am I out f luck? Is there a way to capture what this camera sees,
beside video(1), in some "raw" format? Something _is_ comming out.

This is the result of "doas cat /dev/video1 > /tmp/video.raw":
http://stare.cz/.tmp/video.raw

TIA for any hint.

Jan


OpenBSD 6.6-beta (GENERIC.MP) #0: Mon Aug 19 17:13:12 CEST 2019
h...@dell.stare.cz:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 16810340352 (16031MB)
avail mem = 16288194560 (15533MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xeac10 (107 entries)
bios0: vendor Dell Inc. version "1.5.0" date 04/22/2016
bios0: Dell Inc. Latitude E5570
acpi0 at bios0: ACPI 5.0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT FIDT MCFG HPET SSDT LPIT SSDT SSDT SSDT DBGP 
DBG2 SSDT UEFI SSDT SSDT SLIC ASF!
acpi0: wakeup devices PEG0(S4) PEGP(S4) PEG1(S4) PEGP(S4) PEG2(S4) PEGP(S4) 
RP09(S4) PXSX(S4) RP10(S4) PXSX(S4) RP11(S4) PXSX(S4) RP12(S4) PXSX(S4) 
RP13(S4) PXSX(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5-6440HQ CPU @ 2.60GHz, 2295.51 MHz, 06-5e-03
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu0: 256KB 64b/line 8-way L2 cache
tsc_timecounter_init: TSC skew=0 observed drift=0
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 24MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
TSC skew=4
cpu1: Intel(R) Core(TM) i5-6440HQ CPU @ 2.60GHz, 2294.67 MHz, 06-5e-03
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu1: 256KB 64b/line 8-way L2 cache
tsc_timecounter_init: TSC skew=4 observed drift=0
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
TSC skew=1
cpu2: Intel(R) Core(TM) i5-6440HQ CPU @ 2.60GHz, 2294.67 MHz, 06-5e-03
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu2: 256KB 64b/line 8-way L2 cache
tsc_timecounter_init: TSC skew=1 observed drift=0
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 6 (application processor)
TSC skew=-80
cpu3: Intel(R) Core(TM) i5-6440HQ CPU @ 2.60GHz, 2294.67 MHz, 06-5e-03
cpu3: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PS