Answers.Body: <p>Use</p>
  
  <pre><code>ffmpeg -i activity.mp4 -i mobile.mp4 -filter_complex " nullsrc=size=2560x720 [base];[0:v] setpts=PTS-STARTPTS, scale=1280x720 [upperleft]; [1:v] setpts=PTS-STARTPTS, scale=1280x720 [upperright]; [base][upperleft] overlay=shortest=1 [tmp1]; [tmp1][upperright] overlay=x=720" -c:v libx264 output.mp4
  </code></pre>
  
  <p>The <code>shortest</code> should be applied only to the first overlay.</p>
  
  <p>Also, you can skip scale for the video which is already 1280x720. This output will only audio from one of the inputs.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-07T15:44:48.110Z
Answers.Text: Your command gives me the same output as before! Did you forget to change anything?!
Answers.UserDisplayName: angel_30
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-07T15:47:41.797Z
Answers.Text: Command corrected.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-07T15:48:48.153Z
Answers.Text: No still not working. I guess `x=1280` for `shortest` which works now.
Answers.UserDisplayName: angel_30
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-07T15:58:57.030Z
Answers.Text: Heh. I did not check your co-ordinates.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-07T15:37:41.423Z
Answers.LastActivityDate: 2018-11-07T15:47:11.177Z
Answers.LastEditDate: 2018-11-07T15:47:11.177Z
Answers.UserDisplayName: Gyan
Body: <p>I'm trying to concat two videos, side by side, using ffmpeg. One of them is <code>1280x720</code>, and the other <code>1920x1080</code>. One will be left, one will be right side. The higher resolution will be resized to the lower resolution one.</p>
  
  <p>What is the command to do that?</p>
  
  <p>I tried this command (they used 4 videos, I tried to edit it for 2), but somewhere is wrong and it cuts the first video:</p>
  
  <pre><code>ffmpeg -i activity.mp4 -i mobile.mp4 -filter_complex " nullsrc=size=2560x720 [base];[0:v] setpts=PTS-STARTPTS, scale=1280x720 [upperleft]; [1:v] setpts=PTS-STARTPTS, scale=1280x720 [upperright]; [base][upperleft] overlay=shortest=1 [tmp1]; [tmp1][upperright] overlay=shortest=1:x=720" -c:v libx264 output.mp4
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-30T04:25:40.607Z
Comments.Text: https://unix.stackexchange.com/questions/233832/merge-two-video-clips-into-one-placing-them-next-to-each-other/521878#521878
Comments.UserDisplayName: Sanjay Hadiya
Tags: <video><ffmpeg><video-editor><editing><encoding>
Title: Concat two MP4 files (side by side) with FFmpeg
UserDisplayName: angel_30
ThreadText: # Concat two MP4 files (side by side) with FFmpeg
  
  (Asked by: username_0 on 2018-11-07)
  
  I'm trying to concat two videos, side by side, using ffmpeg. One of them is `1280x720`, and the other `1920x1080`. One will be left, one will be right side. The higher resolution will be resized to the lower resolution one.
  
  What is the command to do that?
  
  I tried this command (they used 4 videos, I tried to edit it for 2), but somewhere is wrong and it cuts the first video:
  
  ```
  ffmpeg -i activity.mp4 -i mobile.mp4 -filter_complex " nullsrc=size=2560x720 [base];[0:v] setpts=PTS-STARTPTS, scale=1280x720 [upperleft]; [1:v] setpts=PTS-STARTPTS, scale=1280x720 [upperright]; [base][upperleft] overlay=shortest=1 [tmp1]; [tmp1][upperright] overlay=shortest=1:x=720" -c:v libx264 output.mp4
  
  ```
  
  **Tags:** video, ffmpeg, video-editor, editing, encoding
  
  > **Comments:**
  > **username_1**: https://unix.stackexchange.com/questions/233832/merge-two-video-clips-into-one-placing-them-next-to-each-other/521878#521878  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-11-07. Score: 2 | Accepted answer
  
  Use
  
  ```
  ffmpeg -i activity.mp4 -i mobile.mp4 -filter_complex " nullsrc=size=2560x720 [base];[0:v] setpts=PTS-STARTPTS, scale=1280x720 [upperleft]; [1:v] setpts=PTS-STARTPTS, scale=1280x720 [upperright]; [base][upperleft] overlay=shortest=1 [tmp1]; [tmp1][upperright] overlay=x=720" -c:v libx264 output.mp4
  
  ```
  
  The `shortest` should be applied only to the first overlay.
  
  Also, you can skip scale for the video which is already 1280x720. This output will only audio from one of the inputs.
  
  > **Comments:**
  > **username_0**: Your command gives me the same output as before! Did you forget to change anything?!  
  > **username_2**: Command corrected.  
  > **username_0**: No still not working. I guess `x=1280` for `shortest` which works now.  
  > **username_2**: Heh. I did not check your co-ordinates.  
  
  ---
  
  