This forum has been archived. All content is frozen. Please use KDE Discuss instead.

need to mix two 1080p videos into a new 3840x1080 video

Tags: None
(comma "," separated)
graysky
Registered Member
Posts
7
Karma
0
OS
I have two 1920x1080x30fps videos from two different security cameras. I would like put them in a new 3840x1080 video (cam1 on left and cam2 on right).

I have experimented with the two "Composite" compositions but I have to make each one 50% size to arrange them side-by-side. That means there is a a 1920x540 black space above them. How can I make kdenlive treat the final project as 3840x1080 and have it compose the two next to each other without resizing them?
berndmj
Registered Member
Posts
358
Karma
4
OS
graysky wrote:I have two 1920x1080x30fps videos from two different security cameras. I would like put them in a new 3840x1080 video (cam1 on left and cam2 on right).

I have experimented with the two "Composite" compositions but I have to make each one 50% size to arrange them side-by-side. That means there is a a 1920x540 black space above them. How can I make kdenlive treat the final project as 3840x1080 and have it compose the two next to each other without resizing them?

You cannot do this in kdenlive directly but in ffmpeg CLI. Here is what you need to do:
  • Put the clips into the timeline V1 and V2
  • Apply a transform effect to both
  • In each transform effect
    • Check the Distort box and set size to 50%
    • Change the H value to, say, 1080
    • Align the clips by clicking on align left/right respectively, and center vertically
  • Render the project with the default settings
  • Open a terminal (cmd.exe in Windows) and navigate to the directory where you saved the rendered file
  • Enter
    Code: Select all
    ffmpeg -i <your_render_filename> -s 3840x540 -aspect 4:1 <output_filename>
Voila!


This forum will soon be archived and you won't be able to interact with it anymore. Please use KDE Discuss instead.
graysky
Registered Member
Posts
7
Karma
0
OS
berndmj wrote:You cannot do this in kdenlive directly but in ffmpeg CLI. Here is what you need to do:
...


Thank you for the detailed reply. This worked perfectly.

For others finding this thread, ugjka on the arch linux bbs pointed out that ffmpeg can do this, see [url=here]https://bytefreaks.net/applications/rough-note-on-ffmpeg-merge-two-videos-side-by-side[/url]. For me, the two files did not start at the same place, one of them had ~15 sec lead time. So I did the alignment in kdenlive based on their two audio tracks (aligning the wave forms). I do not know how to accomplish this using the ffmpeg-only method. It might be useful for someone though.
User avatar
Arkengheist
Registered Member
Posts
162
Karma
2
OS
I know you have a solution, but i wanted to add that it's totally possible in kdenlive (although ffmpeg is probably preferable here), you just need to change your project's resolution to the new one, and use a composite or transform to place you clips.
graysky
Registered Member
Posts
7
Karma
0
OS
Arkengheist wrote:I know you have a solution, but i wanted to add that it's totally possible in kdenlive (although ffmpeg is probably preferable here), you just need to change your project's resolution to the new one, and use a composite or transform to place you clips.


I tried that initially (that being creating a 3840x1080 30fps project) but found that each of the clips in V1 and V2 would be displayed stretched in the preview window.
berndmj
Registered Member
Posts
358
Karma
4
OS
Arkengheist wrote:I know you have a solution, but i wanted to add that it's totally possible in kdenlive (although ffmpeg is probably preferable here), you just need to change your project's resolution to the new one, and use a composite or transform to place you clips.

That's what I also thought and tried it. Even with a rescale in the rendering window the clips placed next to each other, transformed etc come out either stretched or squished and there will always be a gap between the clips above and below.

I think it has to do with the aspect ratio kdenlive assumes and passes on to MLT (or not). I could not successfully do this with different project settings, scaling factors. If you have succeeded I would like to see your project settings, timeline and effects to check what I missed or did wrong.


This forum will soon be archived and you won't be able to interact with it anymore. Please use KDE Discuss instead.
User avatar
Arkengheist
Registered Member
Posts
162
Karma
2
OS
i really can't figure out images on forums but here you go!
(had to remove this sorry)

basically new profile with 3840x1080, and aspect ratio or 32/9, and then 2 transform effects to move the 2 clips

Last edited by Arkengheist on Mon Dec 13, 2021 3:02 pm, edited 1 time in total.
berndmj
Registered Member
Posts
358
Karma
4
OS
Arkengheist wrote:basically new profile with 3840x1080, and aspect ratio or 32/9, and then 2 transform effects to move the 2 clips

The trick is to set the aspect ratio to 32:9 when creating the new profile. I missed that setting when I created my new "longboi" ;-) profile. Thanks for pointing this out - it works like a charm!

Last edited by berndmj on Mon Dec 13, 2021 3:54 pm, edited 1 time in total.


This forum will soon be archived and you won't be able to interact with it anymore. Please use KDE Discuss instead.
graysky
Registered Member
Posts
7
Karma
0
OS
Thanks guys. the 32:9 AR did the trick.
graysky
Registered Member
Posts
7
Karma
0
OS
I should add that the strategy outlined above also works with mixed aspect ratio videos. For example the first clip 608x1080 and the second clip 1920x1080. You can easily join them by creating a profile of (608+1920)x1080 = 2528x1080 with an AR of 316/135. Then align the two clips and use two transform filters to achieve the alignment. Very powerful.


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], Yahoo [Bot]