▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Video-chat with your Oscilloscope. Seriously.
I own a Rigol DS1054Z Oscilloscope and needed to capture the screen for a project.
I found articles from theimpossiblecode and hackaday with instructions for capturing still images (screenshots) of the scope, but I need video!
First connect the scope to your network with an ethernet cable.
Next enter the Utility > IO Setting > LAN Conf.
menu and set a static ip address. For my network I choose
192.168.0.10
.
Check you can connect to the scope from your computer.
$ ping 192.168.0.10
Install the required software for your distribution.
$ sudo apt install v4l2loopback-dkms v4l2loopback-utils ffmpeg imagemagick
Finally, enable v4l2loopback
and set the framerate.
$ sudo modprobe v4l2loopback $ v4l2loopback-ctl set-fps 24 /dev/video1
Ok, here’s the good part. Run this command:
while true; do| \
mogrify -format jpg :display:data?' | \
echo '| \
netcat -q 0 192.168.0.10 5555 | \
tail -c +12 : -f v4l2 -vcodec rawvideo -pix_fmt yuv420p /dev/video1
ffmpeg -re -i pipe done
Here’s what that does:
5555
.:display:data?
is sent. This requests the
current display data (screenshot) from the scope. The screenshot is
returned as a bitmap with a 12 byte header.imagemagick
“mogrify”
program to convert the bitmap to a jpg
./dev/video1
.Framerate? netcat
is grabbing frames as fast as the
scope can send them, but each frame is 1.2MB
! For 30fps
video this would take 1.2M*30= 36MB/s = 288 mbps
! The
ethernet port on this scope is 100mbps so the output video is limited to
~10 fps 1.2M*10= 12MB/s = 96 mbps
under perfect network
conditions.
That said - if you’re ok with 10 fps video. Good news! This device is recognized as a regular video device. You can treat it like a webcam! Usable with OBS, heck you can even video-chat with your O-scope.
Site generated 2024-09-20