3 ms·
FWIW, below is a bash script I've used for generating ffmpeg cuts, based off of a pretty useful stackoverflow suggestion. Input to the script is a file consist
by capitainenemo 2y ago
FWIW, below is a bash script I've used for generating ffmpeg cuts, based off of a pretty useful stackoverflow suggestion. Input to the script is a file consisting of start/end times in seconds, one set per line. If the video has no sound, it looks pretty much the same, just without the atrim/outa parts.
C=0;echo -n "-filter_complex '";
while read f;do
A=($f);echo -n "[0:v]trim=start=${A[0]}:end=${A[1]},setpts=PTS-STARTPTS[${C}v];[0:a]atrim=start=${A[0]}:end=${A[1]},asetpts=PTS-STARTPTS[${C}a];";C=$((C+1));
done <$1
for i in `seq 0 $((C-1))`;do echo -n "[${i}v][${i}a]";done
echo -n "concat=n=$((C)):v=1:a=1[outv][outa]'"
echo ' -map "[outv]" -map "[outa]"'
- mjevans 2y agoWhere's the -c copy or -c:v copy -c:a copy ?
- capitainenemo 2y agoBelated reply. You can't use copy with filter complex which does a decode, however, like the people in the stackoverflow thread I got the suggestion from, I was getting inconsistent audio/video clipping/syncing without a full decode. Personally I don't see a significant quality hit if you're careful with the encode