Bipack with fewer steps

This commit is contained in:
Matt McWilliams 2021-05-09 16:10:35 -04:00
parent 8e8b96152c
commit ca3afd4b24
1 changed files with 6 additions and 16 deletions

View File

@ -13,7 +13,6 @@ OUTPUT=${4}
MATTE1=matte1.mov MATTE1=matte1.mov
MATTE2=matte2.mov MATTE2=matte2.mov
PASS1=pass1.mov PASS1=pass1.mov
PASS2=pass2.mov
echo "Generating mattes from $MATTE..." echo "Generating mattes from $MATTE..."
@ -29,30 +28,21 @@ ffmpeg -y -i "$A" -i "$MATTE1" \
-shortest \ -shortest \
"$PASS1" "$PASS1"
echo "Applying matte to $B..."
ffmpeg -y -i "$B" -i "$MATTE2" \
-filter_complex 'color=0x000000:size=1280x720,format=rgb24[bla];[bla][0][1]maskedmerge' \
-c:v prores_ks \
-profile:v 4 \
-shortest \
"$PASS2"
echo "Cleaning up tmp matte files..." echo "Cleaning up tmp matte files..."
rm "$MATTE1" rm "$MATTE1"
rm "$MATTE2"
echo "Combining matted layers together into $OUTPUT_FILE..." echo "Combining matted layers together into $OUTPUT_FILE..."
ffmpeg -y -i "$PASS1" -i "$PASS2" \ ffmpeg -y -i "$PASS1" -i "$B" -i "$MATTE2" \
-filter_complex "[0][1]blend=all_mode='lighten'" \ -filter_complex '[0][1][2]maskedmerge' \
-c:v prores_ks \ -c:v prores_ks \
-profile:v 3 \ -profile:v 4 \
-shortest \ -shortest \
"$OUTPUT" "${OUTPUT}"
echo "Cleaning up temp files..." echo "Cleaning up temp files..."
rm "$MATTE2"
rm "$PASS1" rm "$PASS1"
rm "$PASS2"