0

I need to merge videos in a ratio of 16:9 with a png image to use instead of the black borders. I'm running this command: melt vid_1.mp4 vid_2.mp4 -mix 30 -mixer luma -consumer avformat:finish.mp4

I see the affine plugin but can make it work

Marcelo
  • 3
  • 1
  • Can you clarify your question? Maybe show a picture of what you want and what you are getting. Also, your command does not include any .png files. – Brian Jul 31 '22 at 17:46
  • @Brian i try to use a track for the background and another for the video compose like this: melt -track bg.png in=0 out=500 -track v1.mp4 v2.mp4 -mix 30 -mixer luma -consumer avformat:finish8.mp4 Also try to make the compose in kdenlive and compare the xml to see if there is a clue o how to do it, i think it uses a producer with a qimage from here: https://www.mltframework.org/plugins/ProducerQimage/ – Marcelo Aug 04 '22 at 16:20

1 Answers1

0
melt -profile atsc_1080p_25 bg.png -filter affine transition.rect="-36.8976 -58 1953.17 1300 1" -track v1.mp4 v2.mp4 -transition affine

This command will get you started. You will need to customize transition.rect to meet the needs of how you want to crop/fit your background image. If your background image aspect ratio matches your profile aspect ratio, then you can exclude transition.rect.

You should also change the profile to be whatever profile you want.

See the melt documentation for other helpful parameters (like in/out points)

See Affine Filter and Affine Transition for details about the parameters for the image transformation.

Brian
  • 1,200
  • 6
  • 8
  • Thank you, i try and it works fine in the screen, but it never ends. I try to add a in and an out, and it works fine if i cut the first track before the composition ends How can i make to run until the end of the join? – Marcelo Aug 06 '22 at 02:17
  • I can use this with ffprobe https://stackoverflow.com/questions/2017843/fetch-frame-count-with-ffmpeg and add to this command: `melt -profile atsc_1080p_25 bg.png in=0 out=1203 -filter affine transition.rect=0 0 100% 100% 1 -track v1.mp4 v2.mp4 -transition affine -consumer avformat:finish2.mp4` – Marcelo Aug 06 '22 at 04:27