His,
this device is an output device, you can connect a monitor to it. Look at the feature list, first point. You will need an input device for hyperion, even if it looks the same this device will not work.
wbr
His,
this device is an output device, you can connect a monitor to it. Look at the feature list, first point. You will need an input device for hyperion, even if it looks the same this device will not work.
wbr
Hi,
IMHO this is not a grabber, it's an external graphic card.
wbr
Hi,
it looks like a Dreamview T1. Do you really want to embark on this journey?
The first thing I would do is get a USB-C breakout board (or two to use original power supply). Then I would flash an ESP32 lying around with WLED to see if it works. 12V and GND from any power supply greater than 2A will be connected to the USB-C breakout board for the strip. Then connect GND and data pin (D+ or D- you have to try) to the ESP32. WLED then still needs to be configured. This could already work. If not, I would try a fast level converter between the data pins on ESP32 and the strip. The usual ones for I2C with simple MOSFETS are too slow. See also https://kno.wled.ge/basics/compatible-hardware/
Good luck.
wbr
Hi,
i don't think you will have to use a bigger power supply, look at the Govee power supply, for Govee Envisual T2 i found 36W, thats 3A at 12V. IMHO, you may use your current power supply. More interesting is signal voltage of your current strip. Is it 3.3V or 5V or something else? Maybe you have to use a level shifter. Another thing to check is the chip type of your strip. For Govee Envisual T2 i found a picture of WS2811. Current FTDI-driver supports APA102, WS2812 and SK6812. I don't know the differences of WS2811 and WS2812. Good luck
wbr
Hi,
maybe you would like to have a look at the newly merged FTDI-LED device driver (https://github.com/hyperion-project/hyperion.ng/pull/1746). You could use an USB-C breakout board to connect the strip.
wbr
Hi Lord-Grey,
thank you, but that's not a priority for me at the moment. Maybe we can take a look at it later.
wbr
Hi Lord-Grey,
thanks. I needed a way to switch between inputs of my UTV007-grabber in the past. I've coded some bash scripts triggered by LIRC. While working on it i realized that i have to read whole config (getconfig), modify the input setting and then write whole config back (setconfig). It was not possible to write back changed settings only, because all other config items where resetted to defaults. But that's not a problem if you know about it.
wbr
Hi Lord-Grey,
i've tried setting some hardcoded values to numerator/denominator, but it looks like one can only set FPS that are supported by the V4L2 device drivers for the given resolution and pixelformat.
See output of v4l2-ctl -d /dev/videoX --list-formats-ext
For my webcam i can't go lower than 15 FPS because that's the minimum FPS supported.
wbr
PS:
For my internal laptop webcam:
v4l2-ctl -d /dev/video0 --set-parm 2
-> Frame rate set to 15.000 fps
= no chance to set lower values than supported
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'YUYV' (YUYV 4:2:2)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 640x360
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 352x288
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
...
Display More
For Raspberry Pi Camera v2.1:
v4l2-ctl -d /dev/video1 --set-parm 2
-> Frame rate set to 2.000 fps
= works if supported
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'YU12' (Planar YUV 4:2:0)
Size: Stepwise 32x32 - 3280x2464 with step 2/2
[1]: 'YUYV' (YUYV 4:2:2)
Size: Stepwise 32x32 - 3280x2464 with step 2/2
[2]: 'RGB3' (24-bit RGB 8-8-8)
Size: Stepwise 32x32 - 3280x2464 with step 2/2
[3]: 'JPEG' (JFIF JPEG, compressed)
Size: Stepwise 32x32 - 3280x2464 with step 2/2
...
Display More
I am really sorry!
Yes, I meant the setconfig subcommand.
Hi,
thank you for the clarification (mistakes happen ).
And also thank you for the extensive revision of the JSON API. I'll play around with it a bit.
Do you know off the top of your head whether you can now use setconfig to change individual settings or whether a complete configuration is still expected?
wbr
If you use the saveconfig command yes
Hi Lord-Grey,
i couldn't find any reference to a "saveconfig" command in JSON-API _Commands_Overview.md, JsonApiCommand.h and all other files. Did you mean "setconfig"?
wbr
Opened PR #1739 at GH. Thread can be closed here.
wbr
Hi,
I came across some code that I think needs review.
Please have a look at https://github.com/hyperion-pr…eo/EncoderThread.cpp#L125
Setting of FlipMode looks messed up. Why is there an exception for BGR24? As far as i know FlipMode is processed in ImageResampler.cpp.
Please have a look. Thanks.
wbr
if (_pixelFormat == PixelFormat::BGR24)
{
if (_flipMode == FlipMode::NO_CHANGE)
_imageResampler.setFlipMode(FlipMode::HORIZONTAL);
else if (_flipMode == FlipMode::HORIZONTAL)
_imageResampler.setFlipMode(FlipMode::NO_CHANGE);
else if (_flipMode == FlipMode::VERTICAL)
_imageResampler.setFlipMode(FlipMode::BOTH);
else if (_flipMode == FlipMode::BOTH)
_imageResampler.setFlipMode(FlipMode::VERTICAL);
}
Image<ColorRgb> image = Image<ColorRgb>();
_imageResampler.processImage(
_localData,
_width,
_height,
_lineLength,
#if defined(ENABLE_V4L2)
_pixelFormat,
#else
PixelFormat::BGR24,
#endif
image
);
Display More
Hi,
how about that:
@@ -81,8 +86,12 @@ V4L2Grabber::V4L2Grabber()
, _noSignalThresholdColor(ColorRgb{0,0,0})
, _standbyActivated(false)
, _signalDetectionEnabled(true)
- , _noSignalDetected(false)
+ , _noSignalDetected(true)
, _noSignalCounter(0)
@@ -1007,6 +1021,10 @@ bool V4L2Grabber::process_image(const void *p, int size)
if ((processFrameIndex % (_fpsSoftwareDecimation + 1) != 0) && (_fpsSoftwareDecimation > 0))
return result;
+ // frame skipping on no-signal detected
+ if (!_noSignalDetected && (processFrameIndex % _fps != 0))
+ return result;
+
#ifdef HAVE_TURBO_JPEG
if (size < _frameByteSize && _pixelFormat != PixelFormat::MJPEG)
#else
Display More
Drops CPU usage from 40% to 3% if no signal detected.
wbr
Hi,
the method shown in my posts is not suitable for real use because network streaming always involves a delay due to buffering.
However, it is definitely suitable for repeated and comprehensible tests of image processing.
wbr
Update for using latest version:
-> unload module if loaded, if it doesn't work reboot
sudo modprobe -r v4l2loopback
-> uninstall package manager version
sudo apt remove v4l2loopback-dkms v4l2loopback-utils
-> install latest version
sudo apt install raspberrypi-kernel-headers
git clone https://github.com/umlaeute/v4l2loopback v4l2loopback
cd v4l2loopback
(make clean on rebuild)
make
sudo make install
sudo depmod -a
cd utils
sudo make install
v4l2loopback-ctl --version
-> run
sudo modprobe v4l2loopback devices=1 video_nr=9 card_label="Virtual-Device9"
sudo v4l2loopback-ctl set-caps /dev/video9 "YU12:720x576@25/1"
ffmpeg -i "rtsp://192.168.32.101:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=660" -f v4l2 /dev/video9
modinfo v4l2loopback
filename: /lib/modules/6.1.21-v7+/extra/v4l2loopback.ko.xz
alias: char-major-10-255
license: GPL
version: 0.13.1-19-g4824538
author: Vasily Levin, IOhannes m zmoelnig <zmoelnig@iem.at>,Stefan Diewald,Anton Novikovet al.
description: V4L2 loopback video device
srcversion: F787587E259AE5311BBD3D5
depends: videodev
name: v4l2loopback
vermagic: 6.1.21-v7+ SMP mod_unload modversions ARMv7 p2v8
parm: debug:debugging level (higher values == more verbose) (int)
parm: max_buffers:how many buffers should be allocated [DEFAULT: 2] (int)
parm: max_openers:how many users can open the loopback device [DEFAULT: 10] (int)
parm: devices:how many devices should be created (int)
parm: video_nr:video device numbers (-1=auto, 0=/dev/video0, etc.) (array of int)
parm: card_label:card labels for each device (array of charp)
parm: exclusive_caps:whether to announce OUTPUT/CAPTURE capabilities exclusively or not [DEFAULT: 0] (array of bool)
parm: max_width:maximum allowed frame width [DEFAULT: 8192] (int)
parm: max_height:maximum allowed frame height [DEFAULT: 8192] (int)
Display More
v4l2-ctl -d /dev/video9 --all
Driver Info:
Driver name : v4l2 loopback
Card type : Virtual-Device9
Bus info : platform:v4l2loopback-009
Driver version : 6.1.21
Capabilities : 0x85200003
Video Capture
Video Output
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x05200003
Video Capture
Video Output
Read/Write
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (loopback: ok)
Video output: 0 (loopback in)
Format Video Capture:
Width/Height : 720/576
Pixel Format : 'YU12' (Planar YUV 4:2:0)
Field : None
Bytes per Line : 720
Size Image : 622080
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Limited Range)
Flags :
Format Video Output:
Width/Height : 720/576
Pixel Format : 'YU12' (Planar YUV 4:2:0)
Field : None
Bytes per Line : 720
Size Image : 622080
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Limited Range)
Flags :
Streaming Parameters Video Capture:
Frames per second: 25.000 (25/1)
Read buffers : 2
Streaming Parameters Video Output:
Frames per second: 25.000 (25/1)
Write buffers : 2
User Controls
keep_format 0x0098f900 (bool) : default=0 value=1
sustain_framerate 0x0098f901 (bool) : default=0 value=1
timeout 0x0098f902 (int) : min=0 max=100000 step=1 default=0 value=0
timeout_image_io 0x0098f903 (button) : flags=write-only, execute-on-write
Display More
Hi,
thanks for this inspiring question.
You can use v4l2loopback and ffmpeg for that.
sudo apt install v4l2loopback-dkms v4l2loopback-utils ffmpeg
-> create a virtual V4L2 device /dev/video9
sudo modprobe v4l2loopback devices=1 video_nr=9 card_label="Virtual-Device9"
-> set capture format for the device
sudo v4l2loopback-ctl set-caps "video/x-raw,format=I420,width=720,height=576,framerate=25/1" /dev/video9
WARNING: This command did freeze on my system, execute this in desktop environment terminal you can close or screen-session over SSH
-> use ffmpeg to get your webcam stream and write it to the device
ffmpeg -i "rtsp://192.168.32.101:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=660" -f v4l2 /dev/video9
I had to make sure no reencoding is needed, my RPi Zero 2W isn't fast enough, so i had to set resolution and pixel-format of the device to the ones of input stream. But if you like you can do reencoding:
ffmpeg -i "rtsp://192.168.32.101:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=660" -s 720x576 -r 25 -pix_fmt yuv420p -f v4l2 /dev/video9
ffmpeg -pix_fmts lists all supported formats. You need to choose a format supported by hyperion.ng and v4l2loopback-ctl. It's a little bit tricky as the names do not match always as you can see below (I420=yuv420p=YU12). For v4l2loopback-ctl they are case sensitive (maybe https://gstreamer.freedesktop.…deotestsrc/?gi-language=c will help).
Good luck.
wbr
Thinner
PS: This is for version 0.12.5 installed on Raspbian Bullseye, in newer versions v4l2loopback-ctl set-caps has changed, i also tried current version from https://github.com/umlaeute/v4l2loopback but didn't succeed yet.
v4l2-ctl -d /dev/video9 --all
Driver Info:
Driver name : v4l2 loopback
Card type : Virtual-Device9
Bus info : platform:v4l2loopback-000
Driver version : 6.1.21
Capabilities : 0x85208003
Video Capture
Video Output
Video Memory-to-Memory
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x05208003
Video Capture
Video Output
Video Memory-to-Memory
Read/Write
Streaming
Extended Pix Format
Priority: 0
Video input : 0 (loopback: ok)
Video output: 0 (loopback in)
Format Video Capture:
Width/Height : 720/576
Pixel Format : 'YU12' (Planar YUV 4:2:0)
Field : None
Bytes per Line : 720
Size Image : 622080
Colorspace : sRGB
Transfer Function : sRGB
YCbCr/HSV Encoding: ITU-R 601
Quantization : Limited Range
Flags :
Format Video Output:
Width/Height : 720/576
Pixel Format : 'YU12' (Planar YUV 4:2:0)
Field : None
Bytes per Line : 720
Size Image : 622080
Colorspace : sRGB
Transfer Function : sRGB
YCbCr/HSV Encoding: ITU-R 601
Quantization : Limited Range
Flags :
Streaming Parameters Video Capture:
Frames per second: 25.000 (25/1)
Read buffers : 2
Streaming Parameters Video Output:
Frames per second: 25.000 (25/1)
Write buffers : 2
User Controls
keep_format 0x0098f900 (bool) : default=0 value=1
sustain_framerate 0x0098f901 (bool) : default=0 value=1
timeout 0x0098f902 (int) : min=0 max=100000 step=1 default=0 value=0
timeout_image_io 0x0098f903 (bool) : default=0 value=0
Display More
@sophie @esprit1711 @all
Wenn ihr wollte, könnt ihr unter dieser Adresse eine modifizierte Version downloaden und die Auflösung bzw. die Bildrate des V4L2 Grabbers über das WebUI einstellen (wenn der PR build fertig ist).
Bin leider noch nicht so weit das es PR fertig wäre. Als nächstes soll eine DropDown Variante im WebUI genutzt werden um das Gerät, die Auflösung und die Bildrate auszuwählen.
Anhand des Videos was ich unten verlinkt habe, kann man gut erkennen das dadurch Ressourcen gespart werden.
Hi, es wäre wirklich super wenn das Setzen der Auflösung es irgendwann in den master branch schafft. Könntest du bei der Gelegenheit gleich noch ein Eingabe-/Auswahlfeld für das Pixelformat einbauen? Der restliche Code ist ja schon da und wird bereits von hyperion-v4l2 verwendet. Dann wäre die Sache rund.
Danke
Thinner
Hi,
ich vermute mal auf deinem RPi3 läuft Buster? Hast du da in den letzten Tagen mal ein Update gemacht? Dabei wurden zumindest bei mir Firefox von 60.9.0esr-1~deb10u1+rpi1 auf 68.4.1esr-1~deb10u1+rpi1 und Chromium von 74.0.3729.157-rpt5 auf 78.0.3904.108-rpt1 geupdatet, was einige Probleme bei mir behoben hat.
Mit den beiden älteren Versionen hatte ich massive Probleme bei der LED-Simulation in hyperion-ng, weil der garbage collector (GC) vom Browser den Speicher nicht freigegeben hat, was zur Folge hatte dass der Pi versucht hat Speicher auszulagern und am Ende stehen geblieben ist. Nachdem ich die ledsim.js überarbeitet hatte, lief es dann stabil. Nach dem Update der Browser vorgestern habe ich den originalen Code nochmal probiert, damit lief es dann auch in den beiden aktuellen Browsern stabil, was bedeutet dass der GC bei beiden überarbeitet wurde.
Vielleicht erklärt das ja dass es jetzt bei dir läuft.
Grüße