Skip to content

Commit 4030455

Browse files
committed
Improve gource and FFMPEG scripts
Improve gource and FFMPEG scripts Signed-off-by: Bensuperpc <[email protected]>
1 parent d223813 commit 4030455

File tree

5 files changed

+52
-13
lines changed

5 files changed

+52
-13
lines changed

Commands.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ For encoding, creating, recording or downloading videos
146146
- [`gource-nvenc`](#gource-nvenc)
147147
- [`gource-h265`](#gource-h265)
148148
- [`h265-nvenc`](#h265-nvenc)
149+
- [`merge-audio-video`](#merge-audio-video)
149150
- [`youtube-dl-playlist-full`](#youtube-dl-playlist-full)
150151
- [`youtube-dl-playlist-audio`](#youtube-dl-playlist-audio)
151152
- [`add-video-watermark`](#add-video-watermark)
@@ -770,6 +771,15 @@ Split video in part of x time
770771
$ split-video <input video> <time (00:20:00 for parts of 20 minutes)>
771772
```
772773

774+
### merge-audio-video
775+
776+
Merge video and audio (shortest)
777+
778+
```bash
779+
$ merge-audio-video <input video> <input audio> <output video>
780+
```
781+
782+
773783
### screen-capture
774784

775785
Screen capture (Video only) with ffmpeg and x11grab

video/gource-h265.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#// //
1111
#// Script, 2021 //
1212
#// Created: 31, July, 2021 //
13-
#// Modified: 03, August, 2021 //
13+
#// Modified: 27, September, 2021 //
1414
#// file: https://gist.github.com/jhamfler/cb21414d70696ba4a8957db80f186374 //
1515
#// - //
1616
#// Source: - //
@@ -19,12 +19,13 @@
1919
#// //
2020
#//////////////////////////////////////////////////////////////
2121

22-
# --highlight-users
2322
if (( $# == 1 )); then
24-
gource --multi-sampling --output-framerate 60 --seconds-per-day 3.0 \
25-
--auto-skip-seconds 0.2 ./ -1920x1080 -o - | ffmpeg -y -r 60 \
26-
-f image2pipe -vcodec ppm -i - -vcodec libx265 -preset slow \
27-
-pix_fmt yuv420p -crf 21 -bf 0 "$1"
23+
# -2560x1440 # If not --fullscreen --date-format "%Y-%m-%d" --elasticity 0.1 --max-user-speed 500
24+
gource --fullscreen --disable-input --multi-sampling --output-framerate 60 --seconds-per-day 0.3 \
25+
--hide mouse --filename-time 5 --max-files 0 --bloom-multiplier 0.8 --highlight-users --file-extension-fallback --path . \
26+
--auto-skip-seconds 0.9 --background-colour 000000 --key --stop-at-end --title "git" --output-ppm-stream - | ffmpeg -y -r 60 \
27+
-f image2pipe -vcodec ppm -i - -vcodec libx265 -preset medium \
28+
-pix_fmt yuv420p -crf 18 -bf 0 "$1"
2829
else
2930
echo "Usage: ${0##*/} <ouput file>"
3031
exit 1

video/gource-nvenc.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@
1010
#// //
1111
#// Script, 2020 //
1212
#// Created: 21, November, 2020 //
13-
#// Modified: 24, July, 2021 //
13+
#// Modified: 27, September, 2021 //
1414
#// file: - //
1515
#// - //
16-
#// Source: - //
16+
#// Source: https://gist.github.com/rafi/365926 //
1717
#// OS: ALL //
1818
#// CPU: ALL //
1919
#// //
2020
#//////////////////////////////////////////////////////////////
2121

2222
if (( $# == 1 )); then
23-
#gource --multi-sampling --output-framerate 60 --seconds-per-day 2.0 --auto-skip-seconds 0.1 ./ -1920x1080 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec hevc_nvenc -preset slow -b:v 64M -maxrate 96M -bufsize 384M $1
24-
gource --multi-sampling --output-framerate 60 --seconds-per-day 1.0 \
25-
--auto-skip-seconds 0.2 ./ -2560x1440 -o - | ffmpeg -y -r 60 \
26-
-f image2pipe -vcodec ppm -i - -vcodec hevc_nvenc -preset:v p7 -tune:v hq -rc:v vbr -cq:v 18 -b:v 0 -minrate:v 5M -maxrate:v 30M -bufsize:v 120M "$1"
23+
# -2560x1440 # If not --fullscreen --date-format "%Y-%m-%d" --elasticity 0.1 --max-user-speed 500
24+
gource --fullscreen --disable-input --multi-sampling --output-framerate 60 --seconds-per-day 0.1 \
25+
--hide mouse --filename-time 5 --max-files 0 --bloom-multiplier 0.8 --highlight-users --file-extension-fallback --path . \
26+
--auto-skip-seconds 0.1 --background-colour 000000 --key --stop-at-end --title "https://github.com/dockcross/dockcross" --output-ppm-stream - | ffmpeg -y -r 60 \
27+
-f image2pipe -vcodec ppm -i - -vcodec hevc_nvenc -preset:v p7 -tune:v hq -rc:v vbr -cq:v 18 -b:v 0 -minrate:v 5M -maxrate:v 60M -bufsize:v 300M "$1"
2728
else
2829
echo "Usage: ${0##*/} <ouput file>"
2930
exit 1

video/merge-audio-video.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
#//////////////////////////////////////////////////////////////
3+
#// ____ //
4+
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
5+
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
6+
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
7+
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
8+
#// |_| |_| //
9+
#//////////////////////////////////////////////////////////////
10+
#// //
11+
#// Script, 2021 //
12+
#// Created: 27, September, 2021 //
13+
#// Modified: 27, September, 2021 //
14+
#// file: - //
15+
#// - //
16+
#// Source: //
17+
#// OS: ALL //
18+
#// CPU: ALL //
19+
#// //
20+
#//////////////////////////////////////////////////////////////
21+
22+
if (( $# == 3 )); then
23+
ffmpeg -i "$1" -i "$2" -shortest -c copy "$3"
24+
else
25+
echo "Usage: ${0##*/} <input video> <input audio> <output video>"
26+
exit 1
27+
fi

0 commit comments

Comments
 (0)