Last active
May 23, 2023 15:31
-
-
Save andrewhodel/a2854df02a5ab06967b5223f5b0a44b6 to your computer and use it in GitHub Desktop.
Revisions
-
andrewhodel revised this gist
May 21, 2023 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ ffmpeg -i one.mp4 -i electricity-zap.mp3 -map 0:v -map 1:a -c:v copy test.mp4 ffmpeg -stream_loop 500 -i test.mp4 -c copy 500_loops.mp4 # add multiple audio files to video at defined millisecond times of the video file ffmpeg -y -i video.mp4 -i 002.ogg.mp3 -i 003.ogg.mp3 -i 004.ogg.mp3 -filter_complex "[1]adelay=1000:all=1[s1];[2]adelay=2500:all=1[s2];[3]adelay=4000:all=1[s3];[s1][s2][s3]amix=inputs=3:normalize=false[a]" -map 0:v -map "[a]" -preset ultrafast video_with_audio.mp4 # add one audio file multiple times to video at defined millisecond times of the video file ffmpeg -y -i video.mp4 -i 002.ogg.mp3 -filter_complex "[1]adelay=1000:all=1[s1];[1]adelay=2500:all=1[s2];[1]adelay=4000:all=1[s3];[s1][s2][s3]amix=inputs=3:normalize=false[a]" -map 0:v -map "[a]" -preset ultrafast video_with_audio.mp4 -
andrewhodel revised this gist
May 21, 2023 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,4 @@ ffmpeg -stream_loop 500 -i test.mp4 -c copy 500_loops.mp4 ffmpeg -y -i video.mp4 -i 002.ogg.mp3 -i 003.ogg.mp3 -i 004.ogg.mp3 -filter_complex "[1]adelay=1000:all=1[s1];[2]adelay=2500:all=1[s2];[3]adelay=4000:all=1[s3];[s1][s2][s3]amix=3[a]" -map 0:v -map "[a]" -preset ultrafast video_with_audio.mp4 # add one audio file multiple times to video at defined millisecond times of the video file ffmpeg -y -i video.mp4 -i 002.ogg.mp3 -filter_complex "[1]adelay=1000:all=1[s1];[1]adelay=2500:all=1[s2];[1]adelay=4000:all=1[s3];[s1][s2][s3]amix=3[a]" -map 0:v -map "[a]" -preset ultrafast video_with_audio.mp4 -
andrewhodel revised this gist
May 21, 2023 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,4 +17,6 @@ ffmpeg -stream_loop 500 -i test.mp4 -c copy 500_loops.mp4 ffmpeg -y -i video.mp4 -i 002.ogg.mp3 -i 003.ogg.mp3 -i 004.ogg.mp3 -filter_complex "[1]adelay=1000:all=1[s1];[2]adelay=2500:all=1[s2];[3]adelay=4000:all=1[s3];[s1][s2][s3]amix=3[a]" -map 0:v -map "[a]" -preset ultrafast video_with_audio.mp4 # add one audio file multiple times to video at defined millisecond times of the video file ffmpeg -y -i video.mp4 -i 002.ogg.mp3 -filter_complex "[1]adelay=1000:all=1[s1];[1]adelay=2500:all=1[s2];[1]adelay=4000:all=1[s3];[s1][s2][s3]amix=3[a]" -map 0:v -map "[a]" -preset ultrafast video_with_audio.mp4 # if you add more than 10 using either of the previous two commands, use multiple ffmpeg commands and 10 per or it will create a file with no sound -
andrewhodel revised this gist
May 21, 2023 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,4 +14,7 @@ ffmpeg -i one.mp4 -i electricity-zap.mp3 -map 0:v -map 1:a -c:v copy test.mp4 ffmpeg -stream_loop 500 -i test.mp4 -c copy 500_loops.mp4 # add multiple audio files to video at defined millisecond times of the video file ffmpeg -y -i video.mp4 -i 002.ogg.mp3 -i 003.ogg.mp3 -i 004.ogg.mp3 -filter_complex "[1]adelay=1000:all=1[s1];[2]adelay=2500:all=1[s2];[3]adelay=4000:all=1[s3];[s1][s2][s3]amix=3[a]" -map 0:v -map "[a]" -preset ultrafast video_with_audio.mp4 # add one audio file multiple times to video at defined millisecond times of the video file ffmpeg -y -i video.mp4 -i 002.ogg.mp3 -filter_complex "[1]adelay=1000:all=1[s1];[1]adelay=2500:all=1[s2];[1]adelay=4000:all=1[s3];[s1][s2][s3]amix=3[a]" -map 0:v -map "[a]" -preset ultrafast video_with_audio.mp4 -
andrewhodel revised this gist
May 21, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,4 +14,4 @@ ffmpeg -i one.mp4 -i electricity-zap.mp3 -map 0:v -map 1:a -c:v copy test.mp4 ffmpeg -stream_loop 500 -i test.mp4 -c copy 500_loops.mp4 # add multiple audio files to video at defined millisecond times of the video file ffmpeg -y -i video.mp4 -i 002.ogg.mp3 -i 003.ogg.mp3 -i 004.ogg.mp3 -filter_complex "[1]adelay=1000:all=1[s1];[2]adelay=2500:all=1[s2];[3]adelay=4000:all=1[s3];[s1][s2][s3]amix=3[a]" -map 0:v -map "[a]" -preset ultrafast video_with_audio.mp4 -
andrewhodel revised this gist
May 21, 2023 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,4 +11,7 @@ ffmpeg -i one.mp4 -i electricity-zap.mp3 -filter_complex "[1:0]apad" -shortest t ffmpeg -i one.mp4 -i electricity-zap.mp3 -map 0:v -map 1:a -c:v copy test.mp4 # loop a file a number of times into one long file ffmpeg -stream_loop 500 -i test.mp4 -c copy 500_loops.mp4 # add multiple audio files to video at defined millisecond times of the video file ffmpeg -y -i video.mp4 -i 002.ogg.mp3 -i 003.ogg.mp3 -i 004.ogg.mp3 -filter_complex "[1]adelay=1000[s1];[2]adelay=2500[s2];[3]adelay=4000[s3];[s1][s2][s3]amix=3[a]" -map 0:v -map "[a]" -preset ultrafast video_with_audio.mp4 -
andrewhodel revised this gist
May 20, 2023 . 1 changed file with 1 addition and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,4 @@ ffmpeg -i one.mp4 -i electricity-zap.mp3 -filter_complex "[1:0]apad" -shortest t ffmpeg -i one.mp4 -i electricity-zap.mp3 -map 0:v -map 1:a -c:v copy test.mp4 # loop a file a number of times into one long file ffmpeg -stream_loop 500 -i test.mp4 -c copy 500_loops.mp4 -
andrewhodel revised this gist
May 20, 2023 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,10 +8,10 @@ ffmpeg -i one.mp4 -f null /dev/null ffmpeg -i one.mp4 -i electricity-zap.mp3 -filter_complex "[1:0]apad" -shortest test.mp4 # add audio to video file and leave audio length as is, -stream_loop will loop the audio faster than the video with this file ffmpeg -i one.mp4 -i electricity-zap.mp3 -map 0:v -map 1:a -c:v copy test.mp4 # loop a file a number of times into one long file ffmpeg -stream_loop 500 -i test.mp4 -c copy 500_loops.mp4 # loop a file a number of times into one long file and keep valid frame rate, -c copy set the frame rate at 58.1264 fps ffmpeg -stream_loop 500 -i test.mp4 -filter:v fps=60 500_loops.mp4 -
andrewhodel revised this gist
May 20, 2023 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,4 +11,7 @@ ffmpeg -i one.mp4 -i electricity-zap.mp3 -filter_complex "[1:0]apad" -shortest t ffmpeg -i one.mp4 -i electricity-zap.mp3 -map 0:v -map 1:a -c:v copy one_with_audio.mp4 # loop a file a number of times into one long file ffmpeg -stream_loop 500 -i one_with_audio.mp4 -c copy 500_loops.mp4 # loop a file a number of times into one long file and keep valid frame rate, -c copy set the frame rate at 58.1264 fps ffmpeg -stream_loop 500 -i test.mp4 -filter:v fps=60 500_loops.mp4 -
andrewhodel created this gist
May 20, 2023 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # trim video file to a certain range of frames ffmpeg -i render0000-28914.mp4 -vf select="between(n\,0\,61),setpts=PTS-STARTPTS" one.mp4 # display number of frames in a video file ffmpeg -i one.mp4 -f null /dev/null # add audio to video file at the start and extend the audio to the end of the video with silence ffmpeg -i one.mp4 -i electricity-zap.mp3 -filter_complex "[1:0]apad" -shortest test.mp4 # add audio to video file and leave audio length as is, -stream_loop will loop the audio faster than the video with this file ffmpeg -i one.mp4 -i electricity-zap.mp3 -map 0:v -map 1:a -c:v copy one_with_audio.mp4 # loop a file a number of times into one long file ffmpeg -stream_loop 500 -i one_with_audio.mp4 -c copy 500_loops.mp4