Skip to content

Instantly share code, notes, and snippets.

@nazfox
Last active August 14, 2022 06:40
Show Gist options
  • Save nazfox/41dc8006725db64c1a379dbc4b825d1b to your computer and use it in GitHub Desktop.
Save nazfox/41dc8006725db64c1a379dbc4b825d1b to your computer and use it in GitHub Desktop.
Play Blu-ray using HDMI Capture Device
#!/bin/bash
# video device list: `v4l2-ctl --list-devices`
# audio device list: `pacmd list short sources`
video_device='your video device name'
audio_device='your audio device name'
video_device_path=$(v4l2-ctl --list-devices | grep -A1 "$video_device" | tail -n1 | sed 's/^[ \t]*//')
no_inputs='--no-osc --no-input-builtin-bindings --no-input-terminal'
hw_acc='--hwdec=nvdec-copy --vo=gpu --profile=gpu-hq'
pacmd load-module module-loopback source=$audio_device
trap 'pacmd unload-module module-loopback' EXIT
mpv av://v4l2:$video_device_path $no_inputs $hw_acc --profile=low-latency --untimed >/dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment