FFMPEG: How can I combine multiple video files into one and replace audio with new audio file












1















I have a question about ffmpeg
I have many shot mp4 video file and one mp3 audio (example: 1 hour long )
I want to combine random mp4 video file to one output file (length match mp3 length) and replace audio with that mp3 file to one output mp4 file.










share|improve this question





























    1















    I have a question about ffmpeg
    I have many shot mp4 video file and one mp3 audio (example: 1 hour long )
    I want to combine random mp4 video file to one output file (length match mp3 length) and replace audio with that mp3 file to one output mp4 file.










    share|improve this question



























      1












      1








      1


      1






      I have a question about ffmpeg
      I have many shot mp4 video file and one mp3 audio (example: 1 hour long )
      I want to combine random mp4 video file to one output file (length match mp3 length) and replace audio with that mp3 file to one output mp4 file.










      share|improve this question
















      I have a question about ffmpeg
      I have many shot mp4 video file and one mp3 audio (example: 1 hour long )
      I want to combine random mp4 video file to one output file (length match mp3 length) and replace audio with that mp3 file to one output mp4 file.







      audio video ffmpeg






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 18 '16 at 21:23









      RockPaperLizard

      3,096133571




      3,096133571










      asked Jul 18 '16 at 21:05









      Poo VPoo V

      612




      612






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Short answer is yes. Yes you can.



          See https://stackoverflow.com/questions/11779490/how-to-add-a-new-audio-not-mixing-into-a-video-using-ffmpeg



          Specifically The section "To manually choose specific streams"



          Once you combine the video (mp4) files in the order and length you want, you then combine the video (mp4) and audio (mp3) files together and use the -map option to choose the video stream and audio stream you want in the final output. This will then give you the video you want, and the audio from the mp3 file you have



          EDIT



          To answer your comment, you can use the concat command in ffmpeg to combine video's together




          1. Put this in a text file (we will call it list.txt)

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


          2. then ffmpeg -f concat -i list.txt -c copy output.mp4







          share|improve this answer


























          • Tks whale guy :P and a question combine random mp4 sir

            – Poo V
            Jul 18 '16 at 22:11











          • and i have another little question :how to cut out middle of a video use ffmpeg Sir Whale :P

            – Poo V
            Jul 19 '16 at 1:29













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1102444%2fffmpeg-how-can-i-combine-multiple-video-files-into-one-and-replace-audio-with-n%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Short answer is yes. Yes you can.



          See https://stackoverflow.com/questions/11779490/how-to-add-a-new-audio-not-mixing-into-a-video-using-ffmpeg



          Specifically The section "To manually choose specific streams"



          Once you combine the video (mp4) files in the order and length you want, you then combine the video (mp4) and audio (mp3) files together and use the -map option to choose the video stream and audio stream you want in the final output. This will then give you the video you want, and the audio from the mp3 file you have



          EDIT



          To answer your comment, you can use the concat command in ffmpeg to combine video's together




          1. Put this in a text file (we will call it list.txt)

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


          2. then ffmpeg -f concat -i list.txt -c copy output.mp4







          share|improve this answer


























          • Tks whale guy :P and a question combine random mp4 sir

            – Poo V
            Jul 18 '16 at 22:11











          • and i have another little question :how to cut out middle of a video use ffmpeg Sir Whale :P

            – Poo V
            Jul 19 '16 at 1:29


















          0














          Short answer is yes. Yes you can.



          See https://stackoverflow.com/questions/11779490/how-to-add-a-new-audio-not-mixing-into-a-video-using-ffmpeg



          Specifically The section "To manually choose specific streams"



          Once you combine the video (mp4) files in the order and length you want, you then combine the video (mp4) and audio (mp3) files together and use the -map option to choose the video stream and audio stream you want in the final output. This will then give you the video you want, and the audio from the mp3 file you have



          EDIT



          To answer your comment, you can use the concat command in ffmpeg to combine video's together




          1. Put this in a text file (we will call it list.txt)

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


          2. then ffmpeg -f concat -i list.txt -c copy output.mp4







          share|improve this answer


























          • Tks whale guy :P and a question combine random mp4 sir

            – Poo V
            Jul 18 '16 at 22:11











          • and i have another little question :how to cut out middle of a video use ffmpeg Sir Whale :P

            – Poo V
            Jul 19 '16 at 1:29
















          0












          0








          0







          Short answer is yes. Yes you can.



          See https://stackoverflow.com/questions/11779490/how-to-add-a-new-audio-not-mixing-into-a-video-using-ffmpeg



          Specifically The section "To manually choose specific streams"



          Once you combine the video (mp4) files in the order and length you want, you then combine the video (mp4) and audio (mp3) files together and use the -map option to choose the video stream and audio stream you want in the final output. This will then give you the video you want, and the audio from the mp3 file you have



          EDIT



          To answer your comment, you can use the concat command in ffmpeg to combine video's together




          1. Put this in a text file (we will call it list.txt)

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


          2. then ffmpeg -f concat -i list.txt -c copy output.mp4







          share|improve this answer















          Short answer is yes. Yes you can.



          See https://stackoverflow.com/questions/11779490/how-to-add-a-new-audio-not-mixing-into-a-video-using-ffmpeg



          Specifically The section "To manually choose specific streams"



          Once you combine the video (mp4) files in the order and length you want, you then combine the video (mp4) and audio (mp3) files together and use the -map option to choose the video stream and audio stream you want in the final output. This will then give you the video you want, and the audio from the mp3 file you have



          EDIT



          To answer your comment, you can use the concat command in ffmpeg to combine video's together




          1. Put this in a text file (we will call it list.txt)

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


          2. then ffmpeg -f concat -i list.txt -c copy output.mp4








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 23 '17 at 12:41









          Community

          1




          1










          answered Jul 18 '16 at 21:34









          mrwhalemrwhale

          21614




          21614













          • Tks whale guy :P and a question combine random mp4 sir

            – Poo V
            Jul 18 '16 at 22:11











          • and i have another little question :how to cut out middle of a video use ffmpeg Sir Whale :P

            – Poo V
            Jul 19 '16 at 1:29





















          • Tks whale guy :P and a question combine random mp4 sir

            – Poo V
            Jul 18 '16 at 22:11











          • and i have another little question :how to cut out middle of a video use ffmpeg Sir Whale :P

            – Poo V
            Jul 19 '16 at 1:29



















          Tks whale guy :P and a question combine random mp4 sir

          – Poo V
          Jul 18 '16 at 22:11





          Tks whale guy :P and a question combine random mp4 sir

          – Poo V
          Jul 18 '16 at 22:11













          and i have another little question :how to cut out middle of a video use ffmpeg Sir Whale :P

          – Poo V
          Jul 19 '16 at 1:29







          and i have another little question :how to cut out middle of a video use ffmpeg Sir Whale :P

          – Poo V
          Jul 19 '16 at 1:29




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1102444%2fffmpeg-how-can-i-combine-multiple-video-files-into-one-and-replace-audio-with-n%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Index of /

          Tribalistas

          Listed building