Answers.Body: <p>The simplest way is</p>
  <pre><code>ffmpeg  -loop 1  -t 10  -i input.jpg  output.mp4
  </code></pre>
  <hr />
  <p><em>The explanation and additions:</em></p>
  <p>Your input file (an image) will go through the default <code>image2</code> demuxer, which makes a video stream from it.</p>
  <ol>
  <li><p>By default, this video stream will contain <strong>only 1 frame</strong> (the input picture), and its framerate will be <strong>25 FPS</strong> (frames per second), so the duration of this stream will be only 40 miliseconds (= 1/25 s).</p>
  <p>To repeat your input image for obtaining more frames, I used the options <code>-loop 1</code>:</p>
  <ul>
  <li><code>-loop 1</code>: The number <code>1</code> means <strong>true</strong> for <em>infinite looping</em>, i.e. for repeating your input picture “infinitely” many times to obtain next and next frame in the case of need.</li>
  </ul>
  </li>
  <li><p>You need to <em>limit the number of generated frames</em> (otherwise your <code>ffmpeg</code> command will run <em>forever</em>).</p>
  <p>As you want the 10-second video, I used the <code>-t 10</code> option to limit the number of generated frames indirectly by the duration of the target video.</p>
  <pre><code>ffmpeg  -loop 1  -t 10  -i input.jpg  output.mp4
  </code></pre>
  </li>
  <li><p>If you are <em>not</em> satisfied with the default framerate (25 fps), you may use the <code>-framerate</code> option, for example</p>
  <pre><code>ffmpeg  -loop 1  -framerate 15  -t 10  -i input.jpg  output.mp4
  </code></pre>
  </li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-14T15:00:27.287Z
Answers.LastActivityDate: 2023-05-18T19:39:13.407Z
Answers.LastEditDate: 2023-05-18T19:39:13.407Z
Answers.UserDisplayName: MarianD
Answers.Body: <p>found here: <a href="https://talotics.com/post/videos/ffmpeg-add-call-to-action-image-after/" rel="nofollow noreferrer">https://talotics.com/post/videos/ffmpeg-add-call-to-action-image-after/</a></p>
  <p><b>Create a 5 second video from a png as follows:</b></p>
  <pre><code>ffmpeg -loop 1 -i image.png -pix_fmt yuv420p -t 5 promo-image.mp4
  </code></pre>
  <p>This will create a video called {promo-image.mp4} from {image.png} with a duration of {5 seconds}</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-15T19:51:11.800Z
Answers.LastActivityDate: 2021-01-15T19:51:11.800Z
Answers.UserDisplayName: kevin
Body: <p>I have a 952×600 JPEG image, generated by a PHP script. I want to create another PHP script that uses <code>ffmpeg</code>, which converts that JPEG image to a MP4 video, which has only 1 frame that lasts for 10 seconds.</p>
  <p>Which options should I provide to FFmpeg, if the input JPEG is called <code>input.jpeg</code> and the video <code>output.mp4</code>?</p>
  
Tags: <ffmpeg><mp4><script>
Title: FFmpeg convert 1 JPEG frame to 10 sec video
UserDisplayName: Max Cruer
ThreadText: # FFmpeg convert 1 JPEG frame to 10 sec video
  
  (Asked by: username_0 on 2021-01-14)
  
  I have a 952×600 JPEG image, generated by a PHP script. I want to create another PHP script that uses `ffmpeg`, which converts that JPEG image to a MP4 video, which has only 1 frame that lasts for 10 seconds.
  
  Which options should I provide to FFmpeg, if the input JPEG is called `input.jpeg` and the video `output.mp4`?
  
  **Tags:** ffmpeg, mp4, script
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-02-14. Score: 2 | Accepted answer
  
  The simplest way is
  
  ```
  ffmpeg  -loop 1  -t 10  -i input.jpg  output.mp4
  
  ```
  
  ---
  
  *The explanation and additions:*
  
  Your input file (an image) will go through the default `image2` demuxer, which makes a video stream from it.
  
  1. By default, this video stream will contain **only 1 frame** (the input picture), and its framerate will be **25 FPS** (frames per second), so the duration of this stream will be only 40 miliseconds (= 1/25 s).
  
     To repeat your input image for obtaining more frames, I used the options `-loop 1`:
  
     * `-loop 1`: The number `1` means **true** for *infinite looping*, i.e. for repeating your input picture “infinitely” many times to obtain next and next frame in the case of need.
  2. You need to *limit the number of generated frames* (otherwise your `ffmpeg` command will run *forever*).
  
     As you want the 10-second video, I used the `-t 10` option to limit the number of generated frames indirectly by the duration of the target video.
  
     ```
     ffmpeg  -loop 1  -t 10  -i input.jpg  output.mp4
  
     ```
  3. If you are *not* satisfied with the default framerate (25 fps), you may use the `-framerate` option, for example
  
     ```
     ffmpeg  -loop 1  -framerate 15  -t 10  -i input.jpg  output.mp4
  
     ```
  
  
  ---
  
  ### Answer by username_2 on 2021-01-15. Score: 0
  
  found here: <https://talotics.com/post/videos/ffmpeg-add-call-to-action-image-after/>
  
  **Create a 5 second video from a png as follows:**
  
  ```
  ffmpeg -loop 1 -i image.png -pix_fmt yuv420p -t 5 promo-image.mp4
  
  ```
  
  This will create a video called {promo-image.mp4} from {image.png} with a duration of {5 seconds}
  
  
  ---
  
  