1

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?

1
  • 1
    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, 2014 at 15:11

2 Answers 2

1

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.

0

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
1
  • Use -map 1:v instead of -map 1 to induct only the video stream from the 2nd file.
    – Gyan
    May 7, 2015 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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