Skip to content

Commit 31afaec

Browse files
committed
Add ffmpeg scripts
Add ffmpeg scripts Signed-off-by: Bensuperpc <[email protected]>
1 parent 089f078 commit 31afaec

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed

video/screen-capture-h265.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
#//////////////////////////////////////////////////////////////
4+
#// ____ //
5+
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
6+
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
7+
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
8+
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
9+
#// |_| |_| //
10+
#//////////////////////////////////////////////////////////////
11+
#// //
12+
#// Script, 2021 //
13+
#// Created: 31, July, 2021 //
14+
#// Modified: 31, July, 2021 //
15+
#// file: - //
16+
#// - //
17+
#// Source: https://unix.stackexchange.com/a/334148/359833 //
18+
#// OS: ALL //
19+
#// CPU: ALL //
20+
#// //
21+
#//////////////////////////////////////////////////////////////
22+
23+
24+
type ffmpeg >/dev/null 2>&1 || { echo "ffmpeg could not be found" >&2; exit 1; }
25+
26+
if (( $# == 1 )); then
27+
ffmpeg -f x11grab -video_size 1920x1080 -framerate 60 -i :0 \
28+
-vcodec libx265 -preset ultrafast -qp 0 -pix_fmt yuv444p \
29+
"$1"
30+
else
31+
echo "Usage: ${0##*/} <output file>"
32+
exit 1
33+
fi
34+

video/screen-capture-webcam.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
#//////////////////////////////////////////////////////////////
4+
#// ____ //
5+
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
6+
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
7+
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
8+
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
9+
#// |_| |_| //
10+
#//////////////////////////////////////////////////////////////
11+
#// //
12+
#// Script, 2021 //
13+
#// Created: 31, July, 2021 //
14+
#// Modified: 31, July, 2021 //
15+
#// file: - //
16+
#// - //
17+
#// Source: https://unix.stackexchange.com/a/334148/359833 //
18+
#// OS: ALL //
19+
#// CPU: ALL //
20+
#// //
21+
#//////////////////////////////////////////////////////////////
22+
23+
24+
type ffmpeg >/dev/null 2>&1 || { echo "ffmpeg could not be found" >&2; exit 1; }
25+
26+
if (( $# == 1 )); then
27+
ffmpeg -f x11grab -thread_queue_size 64 -video_size 1920x1080 -framerate 60 -i :0 \
28+
-f v4l2 -thread_queue_size 64 -video_size 720x480 -framerate 30 -i /dev/video0 \
29+
-filter_complex 'overlay=main_w-overlay_w:main_h-overlay_h:format=yuv444' \
30+
-vcodec libx264 -preset ultrafast -qp 0 -pix_fmt yuv444p \
31+
"$1"
32+
else
33+
echo "Usage: ${0##*/} <output file>"
34+
exit 1
35+
fi
36+

video/screen-capture.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
#//////////////////////////////////////////////////////////////
4+
#// ____ //
5+
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
6+
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
7+
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
8+
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
9+
#// |_| |_| //
10+
#//////////////////////////////////////////////////////////////
11+
#// //
12+
#// Script, 2021 //
13+
#// Created: 31, July, 2021 //
14+
#// Modified: 31, July, 2021 //
15+
#// file: - //
16+
#// - //
17+
#// Source: https://unix.stackexchange.com/a/334148/359833 //
18+
#// OS: ALL //
19+
#// CPU: ALL //
20+
#// //
21+
#//////////////////////////////////////////////////////////////
22+
23+
24+
type ffmpeg >/dev/null 2>&1 || { echo "ffmpeg could not be found" >&2; exit 1; }
25+
26+
if (( $# == 1 )); then
27+
ffmpeg -f x11grab -video_size 1920x1080 -framerate 60 -i :0 \
28+
-vcodec libx264 -preset ultrafast -qp 0 -pix_fmt yuv444p \
29+
"$1"
30+
else
31+
echo "Usage: ${0##*/} <output file>"
32+
exit 1
33+
fi
34+

0 commit comments

Comments
 (0)