Skip to content

Instantly share code, notes, and snippets.

@ihartwig
Last active March 4, 2025 02:53
Show Gist options
  • Select an option

  • Save ihartwig/954dd070614843b35846ec6337b5fa3c to your computer and use it in GitHub Desktop.

Select an option

Save ihartwig/954dd070614843b35846ec6337b5fa3c to your computer and use it in GitHub Desktop.
HDMI Screencapture to USB Drive
network:
version: 2
renderer: networkd
ethernets:
#all-eth-interfaces:
# match:
# name: "e*"
# dhcp4: yes
# dhcp6: yes
# ipv6-privacy: yes # Enabled by default on most current systems, but networkd currently doesn't enable IPv6 privacy by default, see https://man.archlinux.org/man/systemd.network.5
end0:
addresses: [192.168.69.69/24]
dhcp4: yes
dhcp6: yes
ipv6-privacy: yes

HDMI Screencapture to USB Drive

Using an Odroid C4 SBC, capture the video stream from an HDMI to USB capture device to as USB drive for later review. This setup may also work on other platforms.

SBC: Odroid C4 OS: Armbian 25.2.1 Minimal

robotics@odroidc4:~$ v4l2-ctl -D -d /dev/video2
Driver Info:
	Driver name      : uvcvideo
	Card type        : usb video: usb video
	Bus info         : usb-xhci-hcd.1.auto-1.2
	Driver version   : 6.12.13
	Capabilities     : 0x84a00001
		Video Capture
		Metadata Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x04a00000
		Metadata Capture
		Streaming
		Extended Pix Format
Media Driver Info:
	Driver name      : uvcvideo
	Model            : usb video: usb video
	Serial           : 
	Bus info         : usb-xhci-hcd.1.auto-1.2
	Media version    : 6.12.13
	Hardware revision: 0x00002100 (8448)
	Driver version   : 6.12.13
Interface Info:
	ID               : 0x03000005
	Type             : V4L Video
Entity Info:
	ID               : 0x00000004 (4)
	Name             : usb video: usb video
	Function         : V4L2 I/O

robotics@odroidc4:~$ ffmpeg -f v4l2 -list_formats all -i /dev/video1
ffmpeg version 5.1.6-0+deb12u1 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
[video4linux2,v4l2 @ 0xaaaae47f28f0] Compressed:       mjpeg :          Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480
[video4linux2,v4l2 @ 0xaaaae47f28f0] Raw       :     yuyv422 :           YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480
/dev/video1: Immediate exit requested

robotics@odroidc4:~$ ffmpeg -hide_banner -f v4l2 -framerate 30 -input_format mjpeg -video_size 1920x1080 -i /dev/video1 -c:v copy -t 15 -f mjpeg cap_video1.mjpeg

Packages to Install

  • v4l-utils
  • ffmpeg

Static Networking Config

Recent versions of Armbian use netplan by default for network configuation. To give the ethernet port both a dhcp address (when available) and a static ip address (to make direct-connect easier) comment out the all-ethernet-interfaces block and assign both a static address and dhcp4: yes to the end0 interface in /etc/netplan/10-dhcp-all-interfaces.yaml.

Also delete the default /etc/netplan/20-eth-fixed-mac.yaml file with a different MAC address.

todo: system service file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment