Answers.Body: <p>Use the concat filter to join the image to the video:</p>
  
  <pre><code>ffmpeg -framerate 25 -loop 1 -t 5 -i image.png -t 5 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -i video.mp4 -filter_complex "[2:v]drawtext=text='foo'[main];[0][1][main][2:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" output.mp4
  </code></pre>
  
  <ul>
  <li><p>The image should be the same width and height of the video, so you may have to add the scale, scale2ref, crop, and/or pad filters before concatenation.</p></li>
  <li><p>If the main video has audio then the image needs have audio as well. Generating silent audio with anullsrc as shown in the example can suffice. Make sure to match the channel layout and sample rate of the main input.</p></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-19T18:47:41.890Z
Answers.LastActivityDate: 2019-06-19T18:47:41.890Z
Answers.UserDisplayName: llogan
Body: <p>I currently have a line that makes my video have a watermark in the bottom right corner. </p>
  
  <pre><code>ffmpeg -i video.mp4 -vf drawtext=text=WATERMARKTEXT:x=w-tw-10:y=h-th-10:fontfile=\\Windows\\Fonts\\Montserrat-Regular.ttf:fontsize=32:fontcolor=white -vcodec libx264 -crf 20 -acodec copy output.mp4;
  </code></pre>
  
  <p>What I want to do is add an image file .png or .jpg doesn't really matter and display that before the video starts for 5 seconds. </p>
  
  <p>Is this possible all I could find and understand did something with combining the video and the image but if I do like that I will have to encode it with watermark first then combind it with the other one.</p>
  
Tags: <ffmpeg>
Title: ffmpeg add a intro photo before video
UserDisplayName: user2227874
ThreadText: # ffmpeg add a intro photo before video
  
  (Asked by: username_0 on 2019-06-17)
  
  I currently have a line that makes my video have a watermark in the bottom right corner.
  
  ```
  ffmpeg -i video.mp4 -vf drawtext=text=WATERMARKTEXT:x=w-tw-10:y=h-th-10:fontfile=\\Windows\\Fonts\\Montserrat-Regular.ttf:fontsize=32:fontcolor=white -vcodec libx264 -crf 20 -acodec copy output.mp4;
  
  ```
  
  What I want to do is add an image file .png or .jpg doesn't really matter and display that before the video starts for 5 seconds.
  
  Is this possible all I could find and understand did something with combining the video and the image but if I do like that I will have to encode it with watermark first then combind it with the other one.
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-06-19. Score: 2
  
  Use the concat filter to join the image to the video:
  
  ```
  ffmpeg -framerate 25 -loop 1 -t 5 -i image.png -t 5 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -i video.mp4 -filter_complex "[2:v]drawtext=text='foo'[main];[0][1][main][2:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" output.mp4
  
  ```
  
  * The image should be the same width and height of the video, so you may have to add the scale, scale2ref, crop, and/or pad filters before concatenation.
  * If the main video has audio then the image needs have audio as well. Generating silent audio with anullsrc as shown in the example can suffice. Make sure to match the channel layout and sample rate of the main input.
  
  
  ---
  
  