Last active
October 30, 2020 13:46
-
-
Save kbingham/be28a67831c26158bdb4ab2a48e707d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Requires 'media-ctl' to parse the media devices | |
| # Requires 'dot' to generate the media-graph png files. | |
| # Identify all V4L2 devices | |
| for v in /sys/class/video4linux/{v4l,video}*; | |
| do | |
| vn=`basename $v` | |
| name=`cat $v/name` | |
| echo $vn: $name | |
| done | sort -V; | |
| # Identify all Media Devices | |
| for m in /sys/bus/media/devices/media*; | |
| do | |
| mn=`basename $m` | |
| model=`cat $m/model` | |
| echo $mn: $model | |
| done | sort -V; | |
| # Print all media graphs | |
| for d in /dev/media* | |
| do | |
| dev=`basename $d` | |
| echo "$d:" | |
| media-ctl -p -d $d | |
| echo "" | |
| media-ctl -d $d --print-dot | dot -Tpng > $dev-graph.png | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment