ffmpeg - Muxing - Mux the video from input0 and audio from input1

ffmpeg -i <input0> -i <input1> -c copy -map 0:0 -map 1:1 -shortest <output>

NOTE:

  • -c copy copy the streams, not re-encoded, so there will be no quality loss.
  • -map designates one or more input streams as a source for the output file. Each input stream is identified by the input file index.
  • -shortest will cause the output duration to match the duration of the shortest input stream.