Last active
November 29, 2021 06:58
-
-
Save baskeboler/3538b61a0d4319c26d9ad291cc0d8b37 to your computer and use it in GitHub Desktop.
Generate karaoke video with looping background animation, audio track and ASS subtitles
This file contains hidden or 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
#!/usr/bin/env fish | |
# variant of the script making use of hw acceleration with nvidia gpu | |
set progname "generate_karaoke_vid_nvenc.fish"; | |
set audio_file $argv[1]; | |
set ass_file $argv[2]; | |
set bg_animation_file $argv[3]; | |
set output_file $argv[4]; | |
function help | |
echo "usage: $progname <audio> <ass> <background video> <output>" | |
end | |
function generate | |
ffmpeg -y -hwaccel cuda -stream_loop -1 -an -i $bg_animation_file -i $audio_file -acodec copy -vf ass=$ass_file -c:v nvenc -crf 28 -shortest $output_file | |
end | |
generate | |
or help |
This file contains hidden or 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
#!/usr/bin/env fish | |
set progname "generate_karaoke_vid.fish"; | |
set audio_file $argv[1]; | |
set ass_file $argv[2]; | |
set bg_animation_file $argv[3]; | |
set output_file $argv[4]; | |
function help | |
echo "usage: $progname <audio> <ass> <background video> <output>" | |
end | |
function generate | |
# ffmpeg -y -stream_loop -1 -an -i $bg_animation_file -i $audio_file -acodec copy -vf ass=$ass_file -c:v libx265 -shortest $output_file | |
ffmpeg -y -stream_loop -1 -an -i $bg_animation_file -i $audio_file -acodec copy -vf ass=$ass_file -c:v libx264 -tune animation -crf 28 -shortest $output_file | |
end | |
generate | |
or help | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
added a modified version of the script that makes use of hw acceleration for nvidia gpus