Video Production Stack Exchange is a question and answer site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sorry if my question is too noobish, this is my first question.

What I have is:

An mp4 movie with a video stream and an audio stream.

What I want in the output:

Is an mp4 file containing: the same video stream + the same audio stream + the same video stream with a lower bit-rate

Can anyone please tell me the appropriate ffmpeg command?

share|improve this question
What are you hoping to accomplish with this? Generally you would make two separate files for this kind of thing since either the client would still have to download both or the server can simply switch between which file it is streaming. – AJ Henderson Apr 10 '14 at 15:11
up vote 2 down vote accepted

Answering the question as asked,

ffmpeg -i input.mp4 -map 0:v -map 0:a -map 0:v \
-c:v:0 copy -c:v:1 libx264 -b:v:1 <lower-bitrate> -c:a copy -movflags +faststart out.mp4

The lower-bitrate version of the video is the third stream. Players typically will play the original video which is the first stream in the output.

share|improve this answer

Not sure off the top of my head how to do it on the fly (with multiple different video codec settings for different video streams going into the same output container).

However, with 2 input files, this should work to mux all streams from multiple input file into a single output file. (parallel streams / multiple "programs", NOT concatenated.)

ffmpeg -i in1.mp4 -i in2.mp4 -map 0 -map 1 -codec copy -movflags +faststart out.mp4
share|improve this answer
Use -map 1:v instead of -map 1 to induct only the video stream from the 2nd file. – Mulvya May 7 '15 at 16:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.