1

I have two videos of different length. I need to create a new video with one video at the left and other at the right. I tried using this. Problem is my videos are of different length. I want to start one video a few seconds after the other started. Also, I want to keep the audio of the longer video only.

2
  • Do you know which of the videos is longer?
    – Gyan
    Jan 4, 2018 at 6:21
  • Yes. I know. The right one. Jan 4, 2018 at 7:36

1 Answer 1

1

Use

ffmpeg -i shorter.mp4 -i longer.mp4 -filter_complex
 "[0]trim=0:3.5,drawbox=c=black[delay];[delay][0]concat[left];
  [left][1]hstack[v]"
 -map "[v]" -map 1:a -c:a copy out.mp4

where 3.5 should be replaced with the delayed start time (in seconds) of the shorter video.

17
  • Awesome! But there was one missing point. Sync was proper. But the right video didn't start until the delay (13s) elapsed. Then both videos started simultaneously. In essence, I lost the first 13s of the right video Jan 4, 2018 at 9:04
  • See edited cmd.
    – Gyan
    Jan 4, 2018 at 9:15
  • No. The update distorted. Both videos began simultaneously. After few seconds, left video paused for few seconds. Then it resumed in sync with the right video Jan 4, 2018 at 9:30
  • Show full log..
    – Gyan
    Jan 4, 2018 at 9:31
  • drive.google.com/open?id=1gaX3d2ccbUcNjS8TqIPBL1kRX-sB4z0y I have put the logs here Jan 4, 2018 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.