Answers.Body: <p>To overlay a half-sized version of a video in the center of an image, use</p>
  
  <pre><code>ffmpeg -loop 1 -i image -i video
  -filter_complex "[1]scale=iw/2:-1[ovrl];
                   [0][ovrl]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2:shortest=1[v]"
  -map "[v]" -map 1:a -c:v libx264 -c:a copy output.mp4
  </code></pre>
  
  <hr>
  
  <p>To frame the video:</p>
  
  <pre><code>ffmpeg -loop 1 -i image -i video loop 1 -i frame
  -filter_complex "[1]scale=iw/2:-1[ovrl];
                   [2][ovrl]scale2ref=iw*1.2:-1[fr][ol];
                   [fr][ol]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2:shortest=1[fv];
                   [0][fv]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2:shortest=1[v]"
  -map "[v]" -map 1:a -c:v libx264 -c:a copy output.mp4
  </code></pre>
  
  <p>If you composite the frame onto the background image beforehand, in ffmpeg or elsewhere, you can just use that resultant image with the first command. Of course, you'll lose freedom of movement for the video overlay.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-14T16:23:55.560Z
Answers.Text: error output video without sound
Answers.UserDisplayName: Loi Loigâk
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-14T16:30:41.910Z
Answers.Text: corrected audio mapping
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-14T16:01:04.063Z
Answers.LastActivityDate: 2016-04-14T16:45:25.047Z
Answers.LastEditDate: 2016-04-14T16:45:25.047Z
Answers.UserDisplayName: Gyan
Body: <p><a href="https://i.sstatic.net/F7gn9.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/F7gn9.jpg" alt="**enter image description here**"></a></p>
  
  <p>How can encode video with images like these help me ffmpeg ?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-14T15:33:54.697Z
Comments.Text: It's unclear what you're asking. Do you want to know how to stack multiple images horizontally and then overlay another image on top?
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-14T15:38:14.110Z
Comments.Text: video located at the center of an image please help me how to be able to do
Comments.UserDisplayName: Loi Loigâk
Tags: <ffmpeg><codec><animation><recommendation><animation-rendering>
Title: How can encode video with images like these (overlay a video over a fixed image) with ffmpeg?
UserDisplayName: Loi Loigâk
ThreadText: # How can encode video with images like these (overlay a video over a fixed image) with ffmpeg?
  
  (Asked by: username_0 on 2016-04-14)
  
  [![**enter image description here**](https://i.sstatic.net/F7gn9.jpg)](https://i.sstatic.net/F7gn9.jpg)
  
  How can encode video with images like these help me ffmpeg ?
  
  **Tags:** ffmpeg, codec, animation, recommendation, animation-rendering
  
  > **Comments:**
  > **username_1**: It's unclear what you're asking. Do you want to know how to stack multiple images horizontally and then overlay another image on top?  
  > **username_0**: video located at the center of an image please help me how to be able to do  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-04-14. Score: 6
  
  To overlay a half-sized version of a video in the center of an image, use
  
  ```
  ffmpeg -loop 1 -i image -i video
  -filter_complex "[1]scale=iw/2:-1[ovrl];
                   [0][ovrl]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2:shortest=1[v]"
  -map "[v]" -map 1:a -c:v libx264 -c:a copy output.mp4
  
  ```
  
  ---
  
  To frame the video:
  
  ```
  ffmpeg -loop 1 -i image -i video loop 1 -i frame
  -filter_complex "[1]scale=iw/2:-1[ovrl];
                   [2][ovrl]scale2ref=iw*1.2:-1[fr][ol];
                   [fr][ol]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2:shortest=1[fv];
                   [0][fv]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2:shortest=1[v]"
  -map "[v]" -map 1:a -c:v libx264 -c:a copy output.mp4
  
  ```
  
  If you composite the frame onto the background image beforehand, in ffmpeg or elsewhere, you can just use that resultant image with the first command. Of course, you'll lose freedom of movement for the video overlay.
  
  > **Comments:**
  > **username_0**: error output video without sound  
  > **username_1**: corrected audio mapping  
  
  ---
  
  