Skip to content

Instantly share code, notes, and snippets.

@HJunyuan
Created April 26, 2020 16:08
Show Gist options
  • Save HJunyuan/29af2089d10f71b8927710cda7832e6c to your computer and use it in GitHub Desktop.
Save HJunyuan/29af2089d10f71b8927710cda7832e6c to your computer and use it in GitHub Desktop.
How to merge video/audio files with FFmpeg

How to merge video/audio files with FFmpeg

0. Prerequisite

Download FFmpeg from www.ffmpeg.org/download.html

1. Prepare a .txt of all files to be merged

Example:

file '/path/to/file1.wav'
file '/path/to/file2.wav'
file '/path/to/file3.wav'

Automatically generate the input file using Windows command line:

(for %i in (*.wav) do @echo file '%i') > mylist.txt

2. Concatenate using FFmpeg

"C:\path\to\ffmpeg.exe" -f concat -i mylist.txt -c copy output.wav

Original instructions can be found at trac.ffmpeg.org/wiki/Concatenate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment