System: Rock64 1GB, FreeBSD 13.0 Release
What I'm trying to do:
Use ffmpeg to pull a single image from a usb webcam and write it too a directory.
Software:
libv4l-1.23.0
v4l-utils-1.23.0
v4l_compat-1.23.0
ffmpeg-4.4.2
webcamd-5.17.1.0
The Issue:
I can use the same USB camera from my other FreeBSD box(my laptop) running 13.0 Stable. I'm also using the same version of all the software with the same configuration options and it works. The setup on the Rock64 however produces broken images with mostly solid green images and a slice of what the image should be at the top. The ffmpeg options I use on the command line are both the same on both systems.
I'm looking for a solution and more information on what might be causing the issue. My best guess at this point is that for some reason the camera usb resets? causing it to default back to the yuvj422p pixel format hence the mostly green image.
Here is a image I captured from the usb webcam on the ROCK64 using
What I've tried:
output-shows-green-screen-only
ffmpeg-images-are-green
Displaying-green-color-video
corrupt-frame-from
Output:
What I'm trying to do:
Use ffmpeg to pull a single image from a usb webcam and write it too a directory.
Software:
libv4l-1.23.0
v4l-utils-1.23.0
v4l_compat-1.23.0
ffmpeg-4.4.2
webcamd-5.17.1.0
The Issue:
I can use the same USB camera from my other FreeBSD box(my laptop) running 13.0 Stable. I'm also using the same version of all the software with the same configuration options and it works. The setup on the Rock64 however produces broken images with mostly solid green images and a slice of what the image should be at the top. The ffmpeg options I use on the command line are both the same on both systems.
I'm looking for a solution and more information on what might be causing the issue. My best guess at this point is that for some reason the camera usb resets? causing it to default back to the yuvj422p pixel format hence the mostly green image.
Here is a image I captured from the usb webcam on the ROCK64 using
ffmpeg -y -f v4l2 -vcodec mjpeg -s 1280x720 -i /dev/video0 -frames:v 1 -f singlejpeg ./frame.jpeg
What I've tried:
- rebooting
- manually running webcamd
- changing the v4l2-ctl settings to change the resolution and a few other settings
- using usbconfig to force power on just in case.
- Trying every ffmpeg option I can think of or find in the documentation
- building webcamd and ffmpeg ports to ensure the same config as my laptop setup.
- Searching other forms for people with a similar issues
output-shows-green-screen-only
ffmpeg-images-are-green
Displaying-green-color-video
corrupt-frame-from
Output:
usbconfig
Code:
ugen3.1: <Generic EHCI root HUB> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen2.1: <DWCOTG OTG Root HUB> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.1: <Synopsys XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen4.1: <Generic OHCI root HUB> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen2.2: <HD USB Camera HD USB Camera> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen4.2: <vendor 0x1a86 USB Serial> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (98mA)
ugen0.2: <Innostor PenDrive> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (76mA)
dmesg | grep usb
Code:
usbus0: trying to attach
usbus0 on xhci0
usbus2 on dwcotg0
usbus3: EHCI version 1.0
usbus3 on ehci0
usbus4 on ohci0
usbus0: 5.0Gbps Super Speed USB v3.0
usbus2: 480Mbps High Speed USB v2.0
usbus3: 480Mbps High Speed USB v2.0
usbus4: 12Mbps Full Speed USB v1.0
ugen3.1: <Generic EHCI root HUB> at usbus3
uhub0 on usbus3
uhub0: <Generic EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus3
ugen2.1: <DWCOTG OTG Root HUB> at usbus2
uhub1 on usbus2
uhub1: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
ugen0.1: <Synopsys XHCI root HUB> at usbus0
uhub2 on usbus0
uhub2: <Synopsys XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
ugen4.1: <Generic OHCI root HUB> at usbus4
uhub3 on usbus4
uhub3: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus4
ugen2.2: <HD USB Camera HD USB Camera> at usbus2
ugen4.2: <vendor 0x1a86 USB Serial> at usbus4
usbd_setup_device_desc: getting device descriptor at addr 1 failed, USB_ERR_IOERROR
ugen0.2: <Innostor PenDrive> at usbus0
umass0: <Innostor PenDrive, class 0/0, rev 3.10/0.01, addr 1> on usbus0
uchcom0: <vendor 0x1a86 USB Serial, rev 1.10/2.64, addr 2> on usbus4
sysrc | grep cam
Code:
webcamd_device_0_name: HD USB Camera HD USB Camera
webcamd_enable: YES
kldstat
Code:
Id Refs Address Size Name
1 16 0xffff000000000000 12092d8 kernel
2 1 0xffff00000120a000 25808 umodem.ko
3 3 0xffff000001230000 28698 ucom.ko
4 1 0xffff000001259000 298d0 cuse.ko
5 1 0xffff0000cb400000 22000 dwwdt.ko
6 1 0xffff0000cb422000 24000 uchcom.ko
7 1 0xffff0000cb446000 22000 mac_ntpd.ko
v4l2-ctl --all
Code:
Driver Info:
Driver name : uvcvideo
Card type : HD USB Camera: HD USB Camera
Bus info : usb-/dev/usb-/dev/usb
Driver version : 5.17.0
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 1280/720
Pixel Format : 'MJPG' (Motion-JPEG)
Field : None
Bytes per Line : 0
Size Image : 1843789
Colorspace : sRGB
Transfer Function : Rec. 709
YCbCr/HSV Encoding: ITU-R 601
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1280, Height 720
Default : Left 0, Top 0, Width 1280, Height 720
Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height 720, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height 720, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 60.000 (60/1)
Read buffers : 0
User Controls
brightness 0x00980900 (int) : min=-64 max=64 step=1 default=0 value=0
contrast 0x00980901 (int) : min=0 max=64 step=1 default=32 value=32
saturation 0x00980902 (int) : min=0 max=128 step=1 default=60 value=60
hue 0x00980903 (int) : min=-40 max=40 step=1 default=0 value=0
white_balance_automatic 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=72 max=500 step=1 default=100 value=100
gain 0x00980913 (int) : min=0 max=100 step=1 default=0 value=0
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=1 (50 Hz)
0: Disabled
1: 50 Hz
2: 60 Hz
white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=1 default=4600 value=4600 flags=inactive
sharpness 0x0098091b (int) : min=0 max=6 step=1 default=2 value=2
backlight_compensation 0x0098091c (int) : min=0 max=2 step=1 default=1 value=1
Camera Controls
auto_exposure 0x009a0901 (menu) : min=0 max=3 default=3 value=3 (Aperture Priority Mode)
1: Manual Mode
3: Aperture Priority Mode
exposure_time_absolute 0x009a0902 (int) : min=1 max=5000 step=1 default=157 value=157 flags=inactive
exposure_dynamic_framerate 0x009a0903 (bool) : default=0 value=1