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

Rendre videos with transparent background

Tags: None
(comma "," separated)
alexisle
Registered Member
Posts
2
Karma
0
Hi,
I want to do a little animaion with a transparent background, but I'm not able to rendre the vidéo with a tranparent even if I try with PNG. Is this normal? If so, is it planned to add this function in a future version?

Thanks
Kdenlive-diamond
Registered Member
Posts
41
Karma
0
I think that you have to use Alpha manipulation -> Chroma key or Color selection to make the background color transparent.
Merlimau
Registered Member
Posts
986
Karma
8
It’s not possible as Kdenlive renders always with a back background. I’m not sure if this can be changed. I think in Shotcut this is possible.
joetriskaidekaphobia
Registered Member
Posts
9
Karma
0
Well, rendering with transparent background is possible, but quite a bit tricky and not sure if of more than academic interest.
There is codec qtrle which allows rendering with alpha-channel. So what you need is a new rendering profile to use the qtlre encoder and a pix_fmt of rgba to add alpha channel
Create a render profile, give it a name and set file extension to "mov" and enter
Code: Select all
vcodec=qtrle pix_fmt=argb
in the parameter field. Rendering with this profile would be it, if kdenlive does sometimes add a hidden black track. To make use of the alpha channel, you need, instead of rendering to a file, create a script in the rendering dialog. I created a script called "transparent.sh" and kdenlive creates two files: transparent.sh and transparent.sh.mlt. Open the .mlt-file with a text editor and look for lines like:
Code: Select all
 <tractor title="Anonymous Submission" id="maintractor" global_feed="1" in="0" out="1970">
  <track producer="black_track"/>

If don't see the line
Code: Select all
<track producer="black_track"/>
kdenlive did not add the hidden black track, IF you see the line, remove it and run transparent.sh. you will get a video with transparent background.
Merlimau
Registered Member
Posts
986
Karma
8
Thank you for this explanation.

This is more than of academic interest. People ask for videos with transparent background which can be re-imported into the timeline. Like for animation, logos, after rotoscopeing, etc .

If you like, would you share your script? I would post an instruction in the manual how to render videos with transparent background.
joetriskaidekaphobia
Registered Member
Posts
9
Karma
0
Hi Merlimau,
yes, I created an example archive, about 20MB ... any idea where to upload?
Joe
Merlimau
Registered Member
Posts
986
Karma
8
I checked but unfortunately there is no way to upload such a big file. Could you share via Dropbox or similar?
joetriskaidekaphobia
Registered Member
Posts
9
Karma
0
Oh yes, dropbox ... forgot about this at all.
I put some files in a dropbox directory:
  • videos/kdenlive-logo.mov: A simple transparent animated kdelive logo as transparent example
  • kdenlive-logo.kdenlive: A project which uses the above logo to create a new transparent video
  • transparent.sh: A sample script generated by kdenlive's render dialog
  • transparent.sh.mlt: A samplemlt project generated by kdenlive's render dialog
Do not forget to create a render profile with vcodec=qtrle and pix_fmt=argb (As described in a previous post).

Let me know if the link works...
/jr
Merlimau
Registered Member
Posts
986
Karma
8
I could download your samples from the dropbox. And yes, it works according your steps!
I'll create a description in the manual how to do that and upload the render profiles in a manner that you can download it direct into Kdenlive.

Many thanks for your description and help.

BTW: In which program do you create the Kdenlive “flag” logo?
joetriskaidekaphobia
Registered Member
Posts
9
Karma
0
Hi Merlimau,
cool to hear it works... :)
The logo was created in blender which forms with kdenlive and gimp my most favoured applications in Linux ....


Bookmarks



Who is online

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