Skip to content

Instantly share code, notes, and snippets.

@JupyterJones
Created October 25, 2023 04:23
Show Gist options
  • Save JupyterJones/474f08d44e45d313859afe2bd7549267 to your computer and use it in GitHub Desktop.
Save JupyterJones/474f08d44e45d313859afe2bd7549267 to your computer and use it in GitHub Desktop.
ffmpeg join multiple mp4s
#!/bin/bash
# Define the paths to your input videos
video1='0001.mp4'
video2='0002.mp4'
video3='0003.mp4'
output='real-fish_123.mp4'
# Create a text file to list the input videos
echo "file '$video1'" > input.txt
echo "file '$video2'" >> input.txt
echo "file '$video3'" >> input.txt
# Use FFmpeg to concatenate the videos
ffmpeg -f concat -safe 0 -i input.txt -c:v libx264 -crf 18 -preset veryfast -c:a aac -strict experimental -y "$output"
echo "Video blending completed successfully."
vlc real-fish_123.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment