Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Matthew Waters
- 4:48 PM
- what even does crossfade between three inputs even mean?
- meh profile image
- Mathieu Duponchelle
- 4:48 PM
- ?
- meh profile image
- Mathieu Duponchelle
- 4:49 PM
- You crossfade the result of the crossfade
- slomo profile image
- Sebastian Dröge
- 4:49 PM
- i'm just replying something to that
- bilboed profile image
- Edward Hervey
- 4:50 PM
- Commented on Mathieu Duponchelle's message: You crossfade the result of the crossfade
- damnit, there's no :xzibit_yo_dawg emoticon
- (edited)
- slomo profile image
- Sebastian Dröge
- 4:51 PM
- Commented on Matthew Waters' message: what even does crossfade between three inputs even mean?
- something for which i would use two times the same element
- meh profile image
- Mathieu Duponchelle
- 4:51 PM
- eg: https://cave.centricular.com/paste/ptne84x7x
- meh profile image
- Mathieu Duponchelle
- 4:52 PM
- Commented on Matthew Waters' message: what even does crossfade between three inputs even mean?
- note that this part is not mandatory for pitivi, but it would eventually allow us to use a single mixer for the whole timeline
- ystreet00 profile image
- Matthew Waters
- 4:53 PM
- crossfade and single mixer for the whole timeline are not workable with the painters algorithm
- slomo profile image
- Sebastian Dröge
- 4:53 PM
- a single mixer for the whole pipeline is also not so good performance-wise
- meh profile image
- Mathieu Duponchelle
- 4:53 PM
- making things easier for GES, and also reducing the likelihood of race conditions sneaking in
- slomo profile image
- Sebastian Dröge
- 4:54 PM
- it does not parallelize
- meh profile image
- Mathieu Duponchelle
- 4:55 PM
- that's a valid concern, though we could always parallelize if we found that to be a problem
- slomo profile image
- Sebastian Dröge
- 4:55 PM
- or parallelize the code inside compositor, yes
- meh profile image
- Mathieu Duponchelle
- 4:56 PM
- Anyway, that's not a mandatory feature for us
- 4:56 PM
- What's mandatory is the positioning and mixing of differently-sized input streams
- 4:56 PM
- things that compositor does for us
- slomo profile image
- Sebastian Dröge
- 4:56 PM
- that's what compositor did before crossfading was added
- meh profile image
- Mathieu Duponchelle
- 4:57 PM
- yes of course, but we need both features in combination
- tim profile image
- Tim Müller
- 4:57 PM
- should prolly move this to #gstreamer at some point (my bad for starting it)
- meh profile image
- Mathieu Duponchelle
- 4:57 PM
- an element that would crossfade two perfectly overlapping input streams is useless for us
- slomo profile image
- Sebastian Dröge
- 4:59 PM
- i see, and you don't want a cascade of compositors (which you can use for crossfading just fine without the crossfade property) because then you have to create some kind of "schedule" from the timeline and then build the pipeline topology based on that
- 4:59 PM
- while now you just put everything to a single compositor and done
- meh profile image
- Mathieu Duponchelle
- 4:59 PM
- no, we currently cascade
- 4:59 PM
- one compositor per transition
- 4:59 PM
- and one coompositor to mix the different layers
- 5:00 PM
- that's why the "more than 2-pad crossfade" feature is not useful for us right now, but we were quite happy that we'd be able to use it if we wanted in the future
- slomo profile image
- Sebastian Dröge
- 5:00 PM
- i see
- 5:01 PM
- but at that point it probably degenerates sooner or later into a pitivi-compositor, not a generic compositor
- meh profile image
- Mathieu Duponchelle
- 5:03 PM
- there's nothing pitivi-specific to that feature
- slomo profile image
- Sebastian Dröge
- 5:03 PM
- the way how crossfade is currently implemented in compositor
- 5:04 PM
- and later you'd probably also want to support other kinds of transitions in pitivi and then we're back at this point
- 5:04 PM
- i think the only way how to do this generically is a pitivi-compositor that does just that. or a lot of smaller elements that you can combine to get that effect
- meh profile image
- Mathieu Duponchelle
- 5:05 PM
- fwiw I would be completely happy with a compositor subclass, it's just the copy paste part I'm not enthusiastic about
- slomo profile image
- Sebastian Dröge
- 5:05 PM
- me neither but i prefer it over stabilizing the current API
- meh profile image
- Mathieu Duponchelle
- 5:11 PM
- I suppose the real question is, would new blend modes in compositor allow us to get the expected behaviour?
- 5:12 PM
- If so, then I don't care and I don't think thibault does either about the exact API that gets used
- New Messages
- slomo profile image
- Sebastian Dröge
- 5:12 PM
- not with a single compositor unless you move away from the painter's algorithm
- meh profile image
- Mathieu Duponchelle
- 5:13 PM
- hrm, even in our current usage scenario where we use one compositor per transition, with two and only two pads ?
- slomo profile image
- Sebastian Dröge
- 5:14 PM
- no because you want to mix the background after the two inputs
- 5:15 PM
- unrelated, i also just looked at the code in compositor, it breaks zorder if there are multiple pads with crossfading and in between pads without
- 5:16 PM
- ah no, nevermind
- meh profile image
- Mathieu Duponchelle
- 5:16 PM
- couldn't we solve this by instead using the "reverse painter's algorithm"?
- nirbheek profile image
- Nirbheek Chauhan
- 5:17 PM
- That's already how composition works, right?
- 5:17 PM
- Except when you have alpha
- slomo profile image
- Sebastian Dröge
- 5:17 PM
- no, it's bottom to top
- meh profile image
- Mathieu Duponchelle
- 5:18 PM
- I'd need to see the code I suppose
- 5:18 PM
- also wouldn't the reverse algorithm make the whole "is_that_stream_covered" code unnecessary ?
- slomo profile image
- Sebastian Dröge
- 5:19 PM
- painters algorithm is
- ((A op B) op C) op D) etc
- what you need here is (for crossfading B and C
- (A op (B op C)) op D
- 5:19 PM
- A being the background
- nirbheek profile image
- Nirbheek Chauhan
- 5:20 PM
- The reverse algo also requires you to implement an occlusion culling algorithm, doesn't it?
- slomo profile image
- Sebastian Dröge
- 5:20 PM
- yes
- nirbheek profile image
- Nirbheek Chauhan
- 5:20 PM
- So it increases complexity, unless you're using a GPU which does that for you
- slomo profile image
- Sebastian Dröge
- 5:20 PM
- and i'm not sure how that would work with SIMD for the blending
- meh profile image
- Mathieu Duponchelle
- 5:21 PM
- hrm, correct me if I'm wrong, but wouldn't occlusion culling in our case basically be "is this pixel opaque" ?
- nirbheek profile image
- Nirbheek Chauhan
- 5:21 PM
- I have never implemented a culling algo
- 5:22 PM
- Except around the edges I guess, where you want to over-render
- slomo profile image
- Sebastian Dröge
- 5:22 PM
- it also wouldn't solve the problem, the result would be the same or your algorithm has a bug
- 5:26 PM
- i wonder if one could get your behaviour by adding some kind of "first with following pad"-boolean flag to each pad. which would then first do whatever operation there is with the following pad, and only then do the previous operation with the background
- but at that point we maybe just want to implement a way to define arbitrary parenthesis
- meh profile image
- Mathieu Duponchelle
- 5:26 PM
- back to the point then
- 5:26 PM
- yes I was about to ask that
- 5:26 PM
- instead of saying "crossfade"
- 5:27 PM
- we would be able to specify a relational operation with the next pad
- slomo profile image
- Sebastian Dröge
- 5:28 PM
- that's then again taking the pitivi use-case as the goal. why only the following pad?
- maybe you want to crossfade pad D and E, and then crossfade the result on pad C?
- meh profile image
- Mathieu Duponchelle
- 5:28 PM
- we need to quantify that operation however
- slomo profile image
- Sebastian Dröge
- 5:28 PM
- how that operation would look like i wrote in the bug this morning
- meh profile image
- Mathieu Duponchelle
- 5:29 PM
- we had that idea in our initial discussions with thibault fwiw (arbitrary relations)
- 5:29 PM
- but iirc we couldn't find a solution to do that without introducing a new object type
- ystreet00 profile image
- Matthew Waters
- 5:29 PM
- order is signified by zorder already
- slomo profile image
- Sebastian Dröge
- 5:29 PM
- yes the API is the problem, not the processing itself
- 5:30 PM
- @Matthew Waters i meant
- (((A op B) op (C op (D op E))) op F) etc
- 5:31 PM
- or you mean that in that case things could be moved according to the zorder?
- ystreet00 profile image
- Matthew Waters
- 5:31 PM
- right, doing that in one element is tricky
- meh profile image
- Mathieu Duponchelle
- 5:32 PM
- I'm sure we're smart enough to figure out an implementation
- ystreet00 profile image
- Matthew Waters
- 5:32 PM
- and I think requires an intermediate buffer anyway
- meh profile image
- Mathieu Duponchelle
- 5:32 PM
- It's just what the API should look like
- slomo profile image
- Sebastian Dröge
- 5:32 PM
- it alraedy uses intermediate buffers in the current crossfading code
- 5:32 PM
- because it can't work otherwise
- ystreet00 profile image
- Matthew Waters
- 5:33 PM
- right, so then multiple mixers and be done with it
- slomo profile image
- Sebastian Dröge
- 5:33 PM
- which is also why i say that using multiple compositors wouldn't be bad, you do the same processing after all
- 5:33 PM
- but @Mathieu Duponchelle and thibault disagree
- (edited)
- meh profile image
- Mathieu Duponchelle
- 5:33 PM
- I'm afraid thibault is not in this channel
- nirbheek profile image
- Nirbheek Chauhan
- 5:33 PM
- Just so I understand correctly, the problem is new crossfade ops that are not commutative?
- 5:34 PM
- Err, I meant the other thing, not commutative
- slomo profile image
- Sebastian Dröge
- 5:34 PM
- associative
- nirbheek profile image
- Nirbheek Chauhan
- 5:34 PM
- Right that one
- slomo profile image
- Sebastian Dröge
- 5:35 PM
- the ones we have right now are not associative already
- nirbheek profile image
- Nirbheek Chauhan
- 5:35 PM
- Oh
- meh profile image
- Mathieu Duponchelle
- 5:35 PM
- @Sebastian Dröge , note that I don't disagree with anything, just looking for a solution that does not involve expropriating pitivi
- slomo profile image
- Sebastian Dröge
- 5:36 PM
- using multiple compositors would always solve the pitivi problem
- meh profile image
- Mathieu Duponchelle
- 5:36 PM
- didn't you say blending the background would be a problem ?
- ystreet00 profile image
- Matthew Waters
- 5:37 PM
- you can specially craft the background (e.g. black) so that it doesn't matter
- 5:37 PM
- which is how we can do 'crossfading' with glvideomixer currently
- meh profile image
- Mathieu Duponchelle
- 5:38 PM
- Then I don't understand
- slomo profile image
- Sebastian Dröge
- 5:39 PM
- @Mathieu Duponchelle you would just take another background you have two backgrounds with two compositors. you use the first compositor to crossfade, and the second to blend over the background
- 5:39 PM
- the first would have a fully transparent background i guess
- 5:40 PM
- which is basically what you implement as a special case inside compositor right now. there's a second "background" being created for an intermediate surface for the crossfading
- meh profile image
- Mathieu Duponchelle
- 5:41 PM
- OK, then IMO the plan forward should be:
- 5:41 PM
- Implement blend modes in compositor
- 5:42 PM
- let us try and use that in pitivi
- 5:42 PM
- it works as expected -> remove crossfade
- 5:42 PM
- don't copy anything
- slomo profile image
- Sebastian Dröge
- 5:42 PM
- and e.g. in my previous case of (((A op B) op (C op (D op E))) op F)
- you would have one compositor doing (D op E), connected to one compositor doing (C op (D op E)), to one compositor doing the remainder
- 5:43 PM
- that's all more obvious if you create a tree out of those expressions
- meh profile image
- Mathieu Duponchelle
- 5:43 PM
- it's obvious enough don't worry
- slomo profile image
- Sebastian Dröge
- 5:43 PM
- ok
- 5:44 PM
- so then i put that on my list, but not for today. and show that it works
- meh profile image
- Mathieu Duponchelle
- 5:44 PM
- but yeah, bottom line for me is "let's not copy anything"
- 5:44 PM
- cool
- 5:44 PM
- anyone cares if I paste the convo to thiibault ?
- slomo profile image
- Sebastian Dröge
- 5:44 PM
- and i don't even need to implement new code, just fix the broken additive blending (or maybe i misread the orc code and it's actually correct)
- meh profile image
- Mathieu Duponchelle
- 5:45 PM
- you should be able to test with ges-launch btw
- 5:45 PM
- the current behaviour
- slomo profile image
- Sebastian Dröge
- 5:45 PM
- should be fine to paste, just double-check. should've been in #gstreamer anyway
- meh profile image
- Mathieu Duponchelle
- 5:46 PM
- just need to add two clips with overlapping times on the same layer
- slomo profile image
- Sebastian Dröge
- 5:46 PM
- there's a crossfade compositor example app in git. i don't want to learn GES first
- meh profile image
- Mathieu Duponchelle
- 5:46 PM
- and with non-overlapping geometries
- slomo profile image
- Sebastian Dröge
- 5:47 PM
- ok need to shower now, have to leave in 45 minutes and only got half of what i wanted to do done today because of the compositor stuff
- meh profile image
- Mathieu Duponchelle
- 5:48 PM
- compositor is a pretty important thing to get right I think
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement