Answers.Body: <p><code>-framerate</code> is an input option for image sequence input, so it goes before that input.</p>
  
  <p>Here's the combined command:</p>
  
  <p><code>ffmpeg -framerate 30 -i edited%05d.png -i in.webm -c:v libvpx-vp9 -pix_fmt yuva420p -lossless 1 -c:a copy out.webm</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-05T08:22:01.003Z
Answers.LastActivityDate: 2019-11-05T08:22:01.003Z
Answers.UserDisplayName: Gyan
Body: <p>To my understanding, if you have only one video input, its native framerate should be used by default if <code>-framerate</code> isn't explicitly defined. For example:</p>
  
  <pre><code>ffmpeg -i in.webm ./frames/image%05d.png
  </code></pre>
  
  <p>will extract an image sequence from a video using its native framerate. For a 5.4 second video with a native 30 fps, that means 162 frames will be extracted.</p>
  
  <p>Now, I have a video with audio. I extracted an image sequence from it as above. After doing some edits to each frame, I want to join the edited image sequence back together, using the original framerate, and add the audio stream back in.</p>
  
  <p>Right now I am able to do this over multiple steps:</p>
  
  <ol>
  <li><p>Manually get the original video's framerate</p>
  
  <p><code>ffprobe -v 0 -of csv=p=0 -select_streams v:0 -show_entries stream=r_frame_rate in.webm</code></p>
  
  <p>Let's say the output is <code>30/1</code></p></li>
  <li><p>Merge the edited image sequence back into a video, using a hard-coded framerate</p>
  
  <p><code>ffmpeg -i edited%05d.png -framerate 30 -c:v libvpx-vp9 -pix_fmt yuva420p -lossless 1 out.webm</code></p></li>
  <li><p>Merge the original video's audio stream into the new video</p>
  
  <p><code>ffmpeg -i in.webm -i out.webm -map 0:a:0 -map 1:v:0 -c copy final.webm</code></p></li>
  </ol>
  
  <p>The exact code is roughly like that. In any case, I definitely had a working version last night.</p>
  
  <p>Originally, I had tried to do everything in one step: generally speaking, the two <code>ffmpeg</code> commands above merged into one, but without <code>-framerate</code>, since I assumed based on research that the input video's framerate should carry over.</p>
  
  <p>However, that did not happen. After analysing the output, it seems to me that ffmpeg failed to detect the input video's framerate, so the output video was assigned a default 25 fps instead. How can I resolve this, so that the output video is automatically assigned the framerate from one of the input videos?</p>
  
Tags: <ffmpeg>
Title: How do I assign an input video's framerate to the output video when multiple input arguments are present?
UserDisplayName: thegreatjedi
ThreadText: # How do I assign an input video's framerate to the output video when multiple input arguments are present?
  
  (Asked by: username_0 on 2019-11-05)
  
  To my understanding, if you have only one video input, its native framerate should be used by default if `-framerate` isn't explicitly defined. For example:
  
  ```
  ffmpeg -i in.webm ./frames/image%05d.png
  
  ```
  
  will extract an image sequence from a video using its native framerate. For a 5.4 second video with a native 30 fps, that means 162 frames will be extracted.
  
  Now, I have a video with audio. I extracted an image sequence from it as above. After doing some edits to each frame, I want to join the edited image sequence back together, using the original framerate, and add the audio stream back in.
  
  Right now I am able to do this over multiple steps:
  
  1. Manually get the original video's framerate
  
     `ffprobe -v 0 -of csv=p=0 -select_streams v:0 -show_entries stream=r_frame_rate in.webm`
  
     Let's say the output is `30/1`
  2. Merge the edited image sequence back into a video, using a hard-coded framerate
  
     `ffmpeg -i edited%05d.png -framerate 30 -c:v libvpx-vp9 -pix_fmt yuva420p -lossless 1 out.webm`
  3. Merge the original video's audio stream into the new video
  
     `ffmpeg -i in.webm -i out.webm -map 0:a:0 -map 1:v:0 -c copy final.webm`
  
  The exact code is roughly like that. In any case, I definitely had a working version last night.
  
  Originally, I had tried to do everything in one step: generally speaking, the two `ffmpeg` commands above merged into one, but without `-framerate`, since I assumed based on research that the input video's framerate should carry over.
  
  However, that did not happen. After analysing the output, it seems to me that ffmpeg failed to detect the input video's framerate, so the output video was assigned a default 25 fps instead. How can I resolve this, so that the output video is automatically assigned the framerate from one of the input videos?
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-11-05. Score: 1
  
  `-framerate` is an input option for image sequence input, so it goes before that input.
  
  Here's the combined command:
  
  `ffmpeg -framerate 30 -i edited%05d.png -i in.webm -c:v libvpx-vp9 -pix_fmt yuva420p -lossless 1 -c:a copy out.webm`
  
  
  ---
  
  