Skip to content

Commit 29872ad

Browse files
committed
Improve scripts (Thanks kevors)
Improve scripts (Thanks kevors) Signed-off-by: Bensuperpc <[email protected]>
1 parent 0f952a2 commit 29872ad

File tree

6 files changed

+20
-7
lines changed

6 files changed

+20
-7
lines changed

video/add-video-logo.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ set -euo pipefail
2424
type ffmpeg >/dev/null 2>&1 || { echo "ffmpeg could not be found" >&2; exit 1; }
2525

2626
if (( $# == 5 )); then
27-
ffmpeg -i "$1" -i "$2" -filter_complex "overlay='$3':'$4'" "$5" -c:v libx264 -crf 18 -bf 2 -profile:v high -c:a copy
27+
ffmpeg -i "$1" -i "$2" -filter_complex "overlay='$3':'$4'" "$5" \
28+
-c:v libx264 -crf 18 -bf 2 -profile:v high -c:a copy
2829
else
2930
echo "Usage: ${0##*/} <input video> <logo> <overlay X (from from the top-left)> <overlay Y (from from the top-left)> <output>"
3031
exit 1

video/add-video-watermark.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ set -euo pipefail
2424
type ffmpeg >/dev/null 2>&1 || { echo "ffmpeg could not be found" >&2; exit 1; }
2525

2626
if (( $# == 3 )); then
27-
ffmpeg -i "$1" -vf "drawtext=text='$2':[email protected]:fontsize=26:box=1:[email protected]:boxborderw=5:x=(w-text_w)/1.0625:y=(h-text_h)/1.0625" -c:v libx264 -crf 18 -preset slow -pix_fmt yuv420p -bf 2 -profile:v high -c:a copy "$3"
27+
ffmpeg -i "$1" -vf "drawtext=text='$2':[email protected]:fontsize=26: \
28+
box=1:[email protected]:boxborderw=5:x=(w-text_w)/1.0625:y=(h-text_h)/1.0625" \
29+
-c:v libx264 -crf 18 -preset slow -pix_fmt yuv420p \
30+
-bf 2 -profile:v high -c:a copy "$3"
2831
else
2932
echo "Usage: ${0##*/} <input video> <text> <output>"
3033
exit 1

video/gource-h265.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set -euo pipefail
1111
#// //
1212
#// Script, 2021 //
1313
#// Created: 31, July, 2021 //
14-
#// Modified: 31, July, 2021 //
14+
#// Modified: 03, August, 2021 //
1515
#// file: https://gist.github.com/jhamfler/cb21414d70696ba4a8957db80f186374 //
1616
#// - //
1717
#// Source: - //
@@ -22,7 +22,10 @@ set -euo pipefail
2222

2323
# --highlight-users
2424
if (( $# == 1 )); then
25-
gource --multi-sampling --output-framerate 60 --seconds-per-day 3.0 --auto-skip-seconds 0.2 ./ -1920x1080 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx265 -preset slow -pix_fmt yuv420p -crf 21 -bf 0 "$1"
25+
gource --multi-sampling --output-framerate 60 --seconds-per-day 3.0 \
26+
--auto-skip-seconds 0.2 ./ -1920x1080 -o - | ffmpeg -y -r 60 \
27+
-f image2pipe -vcodec ppm -i - -vcodec libx265 -preset slow \
28+
-pix_fmt yuv420p -crf 21 -bf 0 "$1"
2629
else
2730
echo "Usage: ${0##*/} <ouput file>"
2831
exit 1

video/gource-nvenc.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ set -euo pipefail
2222

2323
if (( $# == 1 )); then
2424
#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
25-
gource --multi-sampling --output-framerate 60 --seconds-per-day 1.0 --auto-skip-seconds 0.2 ./ -1920x1080 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec hevc_nvenc -rc vbr_hq -cq 6 "$1"
25+
gource --multi-sampling --output-framerate 60 --seconds-per-day 1.0 \
26+
--auto-skip-seconds 0.2 ./ -1920x1080 -o - | ffmpeg -y -r 60 \
27+
-f image2pipe -vcodec ppm -i - -vcodec hevc_nvenc -rc vbr_hq -cq 6 "$1"
2628
else
2729
echo "Usage: ${0##*/} <ouput file>"
2830
exit 1

video/youtube-dl-playlist-audio.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ then
2626
exit 1
2727
fi
2828
# --write-description
29-
youtube-dl --get-id "$1" | xargs -I '{}' -P 4 youtube-dl --write-auto-sub --continue --embed-thumbnail --ignore-errors -f bestaudio --audio-format best --extract-audio --add-metadata -o "%(title)s-%(id)s.%(ext)s" 'https://youtube.com/watch?v={}'
29+
youtube-dl --get-id "$1" | xargs -I '{}' -P 4 youtube-dl --write-auto-sub --continue \
30+
--embed-thumbnail --ignore-errors -f bestaudio --audio-format best --extract-audio \
31+
--add-metadata -o "%(title)s-%(id)s.%(ext)s" 'https://youtube.com/watch?v={}'

video/youtube-dl-playlist-full.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ then
2626
exit 1
2727
fi
2828
# --write-description
29-
youtube-dl --get-id "$1" | xargs -I '{}' -P 4 youtube-dl --write-auto-sub --continue --embed-thumbnail --ignore-errors -f best --add-metadata -o "%(title)s-%(id)s.%(ext)s" 'https://youtube.com/watch?v={}'
29+
youtube-dl --get-id "$1" | xargs -I '{}' -P 4 youtube-dl --write-auto-sub --continue \
30+
--embed-thumbnail --ignore-errors -f best --add-metadata \
31+
-o "%(title)s-%(id)s.%(ext)s" 'https://youtube.com/watch?v={}'

0 commit comments

Comments
 (0)