-
Notifications
You must be signed in to change notification settings - Fork 1
/
fhdcapture
executable file
·30 lines (26 loc) · 1.52 KB
/
fhdcapture
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# fhdcapture - capturing picture from FullHD Capture webcam device
## Purpose
# This script launches mplayer that is showing image from usb webcam.
# I am using it with ezcap device and SimpleScreenRecorder at second laptop.
# This way I am able to shot videos otherwise impossible to capture, for example,
# actions in bios setup or in bootloader.
#
# It is needed because vlc has ugly mess with colors while showing picture from ezcap.
# If you know how to fix this, feel free to contact me or open a new issue.
if [[ $1 != "" ]]; then EZCAP_ENUM=$1
else
EZCAP_ENUM=`v4l2-ctl --list-devices | grep -A1 -e "FHD Capture" -e "ezcap U3 capture: ezcap U3 capt" | tail -n1 | egrep -o '[0-9]'`
fi
echo "\$EZCAP_ENUM = $EZCAP_ENUM"
killall mplayer # ensure that we finished previous fhdcapture instance
mplayer -fs tv:// -tv driver=v4l2:device=/dev/video$EZCAP_ENUM:width=1920:height=1080:fps=30:outfmt=yuy2 > /dev/null 2>/dev/null &
sleep 1 # Do not remove. It's needed for wmctrl command to work.
wmctrl -F -r MPlayer -b add,below
wmctrl -F -r MPlayer -N "FHD Capture" # rename window title for convenience
## Usage
# $ fhdcapture
# Mplayer window will be automatically opened in fullscreen mode and go behind all other windows.
# Record it with simplescreenrecorder or obs.
# To exit mplayer fullscreen mode and show title bar, press win + f11 (my own shortcut) or press Alt + F3 to show window actions menu.
# I am launching fhdcapture in yakuake window. To stop Mplayer I close it on taskbar or press Escape after clicking in Mplayer.