Answers.Body: <p>Let's say the framerate of the MP4s is 30, then you would use</p>
  
  <pre><code>ffmpeg -i body.mp3
         -framerate 30 -loop 1 -t 17.56 -i 000000.PNG
         -i 01.mp4
         -framerate 30 -loop 1 -t 6.12  -i 100074.PNG
         -i 02.mp4
         -framerate 30 -loop 1 -t 7.84  -i 200074.PNG
         -i 03.mp4
         -framerate 30 -loop 1 -t 11.88 -i 300074.PNG
  -filter_complex "[1][2][3][4][5][6][7]concat=n=7:v=1:a=0[v]"
  -map "[v]" -map 0:a -pix_fmt yuv420p out.mp4
  </code></pre>
  
  <p>(All in one line; use single-quotes if you're on linux/OSX)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-20T17:34:36.830Z
Answers.Text: you are a life saver.. thank you very much!
Answers.UserDisplayName: Testaccount
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-22T04:11:56.223Z
Answers.Text: Could you please explain what the -filter_complex and -map does? 
  
  I'm trying to add more inputs(1-8 .mp4 and PNGs) to the above script and it won't encode the newly added inputs.
Answers.UserDisplayName: Testaccount
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-20T14:03:16.490Z
Answers.LastActivityDate: 2019-08-20T14:03:16.490Z
Answers.UserDisplayName: Gyan
Body: <p>I am trying to make a video with multiple input files. 
  I have a bunch of PNG files and mp4 files and I want to create a video for the duration of my audio file <code>body.mp3</code> </p>
  
  <p>The video should be made using multiple inputs. </p>
  
  <ol>
  <li>file <code>000000.PNG</code> for duration 17.56</li>
  <li>file <code>01.mp4</code> (duration ~4.0)</li>
  <li>file <code>100074.PNG</code> for duration 6.12</li>
  <li>file <code>02.mp4</code> (duration ~4.0)</li>
  <li>file <code>200074.PNG</code> for duration 7.84</li>
  <li>file <code>03.mp4</code> (duration ~4.0)</li>
  <li>file <code>300074.PNG</code> for duration 11.88</li>
  </ol>
  
  <p>The total video will have only one audio from <code>body.mp3</code>. Assuming <code>body.mp3</code> duration is equal to all the inputs duration combined (+/- 2.0) </p>
  
  <p>Could you please show me how to achieve this? </p>
  
  <p>Edit: Same resolution for all the input files and same frame rate in all the <code>*.mp4</code> files. Some times, I may have <code>04.mp4</code> and <code>400074.PNG</code> also.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-20T05:32:43.450Z
Comments.Text: Same resolution in all inputs? Same framerate in all MP4s?
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-20T12:50:21.760Z
Comments.Text: @Gyan Yeah... same resolution for all the inputs and framerate in all the MP4s. I've edited my question to reflect this.
Comments.UserDisplayName: Testaccount
Tags: <ffmpeg>
Title: ffmpeg: make a video with multiple input files and formats
UserDisplayName: Testaccount
ThreadText: # ffmpeg: make a video with multiple input files and formats
  
  (Asked by: username_0 on 2019-08-20)
  
  I am trying to make a video with multiple input files.
  I have a bunch of PNG files and mp4 files and I want to create a video for the duration of my audio file `body.mp3`
  
  The video should be made using multiple inputs.
  
  1. file `000000.PNG` for duration 17.56
  2. file `01.mp4` (duration ~4.0)
  3. file `100074.PNG` for duration 6.12
  4. file `02.mp4` (duration ~4.0)
  5. file `200074.PNG` for duration 7.84
  6. file `03.mp4` (duration ~4.0)
  7. file `300074.PNG` for duration 11.88
  
  The total video will have only one audio from `body.mp3`. Assuming `body.mp3` duration is equal to all the inputs duration combined (+/- 2.0)
  
  Could you please show me how to achieve this?
  
  Edit: Same resolution for all the input files and same frame rate in all the `*.mp4` files. Some times, I may have `04.mp4` and `400074.PNG` also.
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: Same resolution in all inputs? Same framerate in all MP4s?  
  > **username_0**: @username_1 Yeah... same resolution for all the inputs and framerate in all the MP4s. I've edited my question to reflect this.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-08-20. Score: 3 | Accepted answer
  
  Let's say the framerate of the MP4s is 30, then you would use
  
  ```
  ffmpeg -i body.mp3
         -framerate 30 -loop 1 -t 17.56 -i 000000.PNG
         -i 01.mp4
         -framerate 30 -loop 1 -t 6.12  -i 100074.PNG
         -i 02.mp4
         -framerate 30 -loop 1 -t 7.84  -i 200074.PNG
         -i 03.mp4
         -framerate 30 -loop 1 -t 11.88 -i 300074.PNG
  -filter_complex "[1][2][3][4][5][6][7]concat=n=7:v=1:a=0[v]"
  -map "[v]" -map 0:a -pix_fmt yuv420p out.mp4
  
  ```
  
  (All in one line; use single-quotes if you're on linux/OSX)
  
  > **Comments:**
  > **username_0**: you are a life saver.. thank you very much!  
  > **username_0**: Could you please explain what the -filter_complex and -map does?   I'm trying to add more inputs(1-8 .mp4 and PNGs) to the above script and it won't encode the newly added inputs.  
  
  ---
  
  