-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add utils. Adjust .default in ckin for brown player controls
- Loading branch information
Showing
4 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# Audio + vidéo fade out at the end of mp4 files | ||
|
||
# 2015-09-09 19:07:17.0 +0200 / Gilles Quenot | ||
# tweaked by twobob 2020 | ||
|
||
# length of the fade out | ||
fade_duration=3 # seconds | ||
|
||
if [[ ! $2 ]]; then | ||
cat<<EOF | ||
Usage: | ||
${0##*/} <input mp4> <output mp4> | ||
EOF | ||
exit 1 | ||
fi | ||
|
||
if [[ -f "$2" ]] ; then | ||
echo "$2 already exists. Exiting." | ||
exit 1 | ||
fi | ||
|
||
|
||
for x in bc awk ffprobe ffmpeg; do | ||
if ! type &>/dev/null $x; then | ||
echo >&2 "$x should be installed" | ||
((err++)) | ||
fi | ||
done | ||
|
||
((err > 0)) && exit 1 | ||
|
||
duration=$(ffprobe -select_streams v -show_streams "$1" 2>/dev/null | | ||
awk -F= '$1 == "duration"{print $2}') | ||
final_cut=$(bc -l <<< "$duration - $fade_duration") | ||
ffmpeg -n -i "$1" \ | ||
-filter:v "fade=out:st=$final_cut:d=$fade_duration" \ | ||
-af "afade=t=out:st=$final_cut:d=$fade_duration" \ | ||
-c:v libx264 -c:a aac -strict experimental -shortest -pix_fmt yuv420p -preset slower "$2" |