Created
May 15, 2019 17:08
-
-
Save luxedo/81e092a9e0819ac424812543c4c19ceb to your computer and use it in GitHub Desktop.
Outputs the maximum resolution of `/dev/video0`
This file contains 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
v4l2-ctl -d /dev/video0 --list-formats-ext | grep Size | sed 's/.*[^0-9]\([0-9]\+x[0-9]\+\)[^0-9]\?.*/\1/' | sort | uniq |python3 -c "import fileinput;res = [line.split('x') for line in fileinput.input()];res = [(int(r[0]), int(r[1]), int(r[0])*int(r[1])) for r in res];res=sorted(res, key=lambda x: -x[2]);print(res[0][0:2])" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment