Concat Video using FFmpeg

项月亮
1 min readJun 10, 2019

--

For MPEG format video

ffmpeg -i "concat:input1.mpg|input2.mpg|input3.mpg" -c copy output.mpg

For videos which belongs to non-MPEG format containers but uses MPEG encoder like MPEG4, H.264. Firstly package these videos to TS fomcat container, than concat TS videos to one original format video.

ffmpeg -i input1.flv -c copy -bsf:v h264_mp4toannexb -f mpegts input1.ts
ffmpeg -i input2.flv -c copy -bsf:v h264_mp4toannexb -f mpegts input2.ts
ffmpeg -i "concat:input1.ts|input2.ts|input3.ts" -c copy -bsf:a aac_adtstoasc -movflags +faststart output.mp4

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response