You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was experimenting with custom ffmpeg commands and found a safe option which merges cuts very precisely, even when keyframe cuts are not used. The way it works, it fades the video from cut to cut to the next viable keyframe instead of leaving a black screen gap.
This is my bash script. Note the -safe 0 parameter, it seems to be the key for a flawless merge of raw cuts:
#!/bin/bash
output="output_combined.mkv"# Create a file list for ffmpeg
file_list="file_list.txt">$file_list# Add all sequential video files in the current directory to the list, sorted alphabeticallyforfin*.m*;doif [ -e"$f" ];thenecho"file '$(pwd)/$f'">>$file_listfidone# Check if the file list is not emptyif [ -s$file_list ];then# Combine video files
ffmpeg -f concat -safe 0 -i $file_list -c:v copy -c:a copy "$output"elseecho"No files found to process."fi# Clean up
rm $file_list
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was experimenting with custom ffmpeg commands and found a safe option which merges cuts very precisely, even when keyframe cuts are not used. The way it works, it fades the video from cut to cut to the next viable keyframe instead of leaving a black screen gap.
This is my bash script. Note the
-safe 0
parameter, it seems to be the key for a flawless merge of raw cuts:Beta Was this translation helpful? Give feedback.
All reactions