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

Title clip causes video to darken?

Tags: None
(comma "," separated)
User avatar
Ranko Kohime
Registered Member
Posts
46
Karma
0
OS

Title clip causes video to darken?

Tue Sep 24, 2013 10:52 pm
I'm having a bit of an issue with the title clip function.

As I understand, it's the only way of adding captions. If I'm wrong about, I'd certainly like to know! ;D

But to the problem, even though I set the opacity of the background to 0, my video darkens perceptibly during the time the title clip is displayed. I have a short example clip here

Does anyone know a solution to this?
ddavis
Registered Member
Posts
2
Karma
0
You need to add a transition. Put the title in the time line above the background video. Select Affine or Composite as the transition type and select the "with track" if the background is not the next track down.
Another way to add captions is in the DVDWizard if closed caption is what you want.
User avatar
Ranko Kohime
Registered Member
Posts
46
Karma
0
OS
When I drag the title clip to the timeline, it automatically creates an "Affine" that partly covers the track the title clip is on, and the track below it. The example video had that Affine. If I remove that, the title clip entirely replaces the video below.
normcross
Registered Member
Posts
300
Karma
0
In the few years I have used Kdenlive, I don't think I have seen this darkening problem. For simple titles I generally use the Composite transition. Try that, (as mentioned above). Delete the Affine, right click on the title clip and select Transition > Composite.
User avatar
Ranko Kohime
Registered Member
Posts
46
Karma
0
OS
normcross wrote:In the few years I have used Kdenlive, I don't think I have seen this darkening problem. For simple titles I generally use the Composite transition. Try that, (as mentioned above). Delete the Affine, right click on the title clip and select Transition > Composite.

That does MUCH better, but there is still a barely perceptible change in the color of the overall picture.

Here's a second test clip.

Is there anything you might recommend changing in the settings for the Composite?

Image
TheDiveO
Registered Member
Posts
595
Karma
3
OS
I'm constantly using title clips with both affine and composite transitions. Started with composite but then switched to affine for most use cases due to the color space bug (that has been fixed recently) and because affine offers translation and resizing. Even with a few weeks old sunab svn repo package I've never seen the problem you describe. So, could it be that the background of your title clip is not entirely transparent? What kind of title clip do you have? Is it one created in kdenlive itself or did you use an external editor, such as inkscape for creating an svg-based title?
TheDiveO
Registered Member
Posts
595
Karma
3
OS
normcross wrote:In the few years I have used Kdenlive, I don't think I have seen this darkening problem. For simple titles I generally use the Composite transition. Try that, (as mentioned above). Delete the Affine, right click on the title clip and select Transition > Composite.

Minor note: you don't need to delete the transition as you simply can change the type of transition in the transition dialog/properties. Please note the combobox in the screenshot the OP posted after your reply. This is very convenient, yet probably very easy to overlook.
User avatar
Ranko Kohime
Registered Member
Posts
46
Karma
0
OS
TheDiveO wrote:Minor note: you don't need to delete the transition as you simply can change the type of transition in the transition dialog/properties. Please note the combobox in the screenshot the OP posted after your reply. This is very convenient, yet probably very easy to overlook.

Good to know, I would have overlooked that. :)

TheDiveO wrote:I'm constantly using title clips with both affine and composite transitions. Started with composite but then switched to affine for most use cases due to the color space bug (that has been fixed recently) and because affine offers translation and resizing. Even with a few weeks old sunab svn repo package I've never seen the problem you describe. So, could it be that the background of your title clip is not entirely transparent? What kind of title clip do you have? Is it one created in kdenlive itself or did you use an external editor, such as inkscape for creating an svg-based title?

I'm using the Title clip editor built into Kdenlive, and on the background tab the color is set to white, (#FFFFFF) and what I assume is the opacity slider next to it is set to 0.

Kdenlive is coming from the sunab release repo, is 0.9.6, while melt is 0.8.8-1. I noticed that melt is coming from the Ubuntu repos, and that the version in sunab is 0.8.8-0ubuntu0~sunab~raring1, which Synaptic is telling me is a downgrade... Could that have anything to do with it? (Nope, just "downgraded", and still the same thing)
User avatar
Ranko Kohime
Registered Member
Posts
46
Karma
0
OS
I do believe I've made some progress on this. I changed Alpha Channel Operation from "Over" to "And", and now I cannot notice ANY darkening whatsoever. ;D

An example, with the new settings.

ETA: This is while using Composite, I haven't tried it with the Affine transition yet.
TheDiveO
Registered Member
Posts
595
Karma
3
OS
I'm not sure but I think that Kdenlive's "And" alpha operation actually is the Duff and Porter "in" operator.
TheDiveO
Registered Member
Posts
595
Karma
3
OS
Ranko Kohime wrote:I do believe I've made some progress on this. I changed Alpha Channel Operation from "Over" to "And", and now I cannot notice ANY darkening whatsoever.

As your observation left me puzzled, I dug into my own experiments and the MLT source code for the composite transition. What I learnt there: the alpha channel operation controls the bitwise logical fusion of the alpha values for a given pixel from the overlaid frame (your title clip) and the underlying frame. At least this is what my I think what the code does.

When choosing OVER, then only the alpha value from your title clip is taken. The resulting pixel channel value for red, green, and blue are then calculated as finalpixel=alphatitle*titlepixel+(1-alphatitle)*clippixel. As you are seeing darkening occurring here, either your title clip is somehow screwed up or your mlt broken.

The AND operation instead does a bitwise AND for the two alpha channel values from the title clip and background clip. That is, alpha=alphatitle&alphaclip. Then, the sampe finalpixel calculation is done as above.

Since you noticed that AND works like OVER, yet OVER causes darkening this may either be due to a broken mlt or your title clip has incorrect alpha values. There is some comment about SSE2 fixes, but I don't know whether this may apply to the version you are using.
User avatar
Ranko Kohime
Registered Member
Posts
46
Karma
0
OS
Just as soon as I said something, now it quits working. AND now makes the title clip disappear. In the exact same project file as the above clip came from. ???
TheDiveO
Registered Member
Posts
595
Karma
3
OS
Ranko Kohime wrote:Just as soon as I said something, now it quits working. AND now makes the title clip disappear. In the exact same project file as the above clip came from. ???

That actually does make sense now, if I'm not mistaken: your title clip has alpha channel data that is non-zero for the image parts not covered by lettering. Now, the video clip you are compositing with has all its alpha channel values set to zero, as it has no transparency. With an alpha operation of AND, you are telling tge compose transition to bitwise AND alpha channel pixel values. But the resulting alpha is always zero! That's because there is no transparency in the bottom clip.

Did you had an Kdenlive or mlt update since then?
User avatar
Ranko Kohime
Registered Member
Posts
46
Karma
0
OS
TheDiveO wrote:
Ranko Kohime wrote:Just as soon as I said something, now it quits working. AND now makes the title clip disappear. In the exact same project file as the above clip came from. ???

That actually does make sense now, if I'm not mistaken: your title clip has alpha channel data that is non-zero for the image parts not covered by lettering. Now, the video clip you are compositing with has all its alpha channel values set to zero, as it has no transparency. With an alpha operation of AND, you are telling tge compose transition to bitwise AND alpha channel pixel values. But the resulting alpha is always zero! That's because there is no transparency in the bottom clip.

Did you had an Kdenlive or mlt update since then?

I got lost in that explanation, but no, no Kdenlive or mlt upgrades the entire time I've been using it.

In addition, after more testing, I got a new project file to use all AND for half-a-dozen title clips, and it worked perfectly fine. I opened the project I was having trouble with, still having trouble with it. ???

On second thought, maybe I am getting your explanation. But then I'm more confused, as to why it seems to work, sometimes.
TheDiveO
Registered Member
Posts
595
Karma
3
OS
It even gets weirder with every test I do: I have to admit that I've finally noticed the darkening effect that you described in my own project(s). I have to admit that most probably I never paid enough attention to the effect you are describing. I'm on a recent sunab ppa svn+mlt Kdenlive version which is a week old or so.

So when I tried to extract two frames with and without titling in Kdenlive using the built-in save frame context menu, something totally unexpected happens ... in the frames saved, the one with the titling now actually is lighter than the frame without title. But in Kdenlive's project view, it is the other way round with the project result getting darker when the title in composed on top of it. >:D


Bookmarks



Who is online

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