 Okay, so we move on to our next presentation. Let me remind you that this year we're trying something new to the questions. So you can log into onlinequestions.org with the event ID 2147 in our room number. And you can ask questions there. I'll vote for your favorite question. So our next presenter, Akil, will introduce QML in the video industry. Please welcome Akil. Thank you. Good morning and hello. I'm Akil. And today I'm here to talk about how in Cadian Live we're trying to create videos out of QML. So let's get started. A bit about myself. I'm a student at Amrita University pursuing my undergrad studies in computer science and being a Cadian Live contributor for more than a year now. I was part of them last summer as part of the Summer of Code program. And I'm a part of AM Force. It's a student community back in my college. So it's just a bunch of students who contribute to a bunch of open source software. And over the years we had a lot of students taking part in various open source programs in various organizations through these student programs. And especially if I were to say we have a lot of people in the open media, especially in the media field. Just to name a few. Mindfree is Krishna here. Yeah, we are from the same bunch. And yeah, that's that. So let's start with the why. Why would you take QML? A language you would use to create UI, UI applications. QML is something you would use if you were a Qt application developer. Qt is a cross-platform software development platform using C++. So QML is something that you would use to actually design your application interface. QML defines the behavior and how your application should look like. So if I have a button on my window, you can use QML to say where I can place this button and how this button will behave and stuff like that. That's what QML is used for. So QML does this by order. It orders the interface elements in an hierarchical manner. So there's the child parent thing in QML. So why would you take QML? It's like JavaScript. So yeah, why would you take QML to create videos? So that's the end result of what we managed to do in KDNLi right now. That's a QML file, by the way, in the KDNLi clip monitor. That's actually playing. So why do it? A, passing XML sucks. And B, QML is actually awesome. So let me tell you where we do this in KDNLi. We actually do this in the title tool. So in KDNLi, the video editor, we actually have a title tool. So what we use the title tool is to create title clips. Now, what title clips are, they are basically clips which contain text or images, which you can later composite over your videos. Suppose if you want to add subtitles or you want to add the credits. At the end of your video, you use the title tool for that. So how it works currently in KDNLi is the KDNLi title clip is basically an XML file which describes how it should look like. And what we do in the backend is we actually pass this XML. We pass each of the attributes, text, image. We do that. And then we create a QGraphicsView to describe the XML, and then we render it. So that's a hefty process. And no one uses QGraphicsView. It's depreciated. That's one reason why this process sucks. And second reason is it's a lot of code. It's a lot of lines of code. And yeah, those two reasons why it is not really that nice to do this. So the second reason, yeah. So why use QML? Because rendering, let me tell you how rendering works in QML. So since QD Quick 2, rendering in QML makes use of the cute scene graph. Now the scene graph is a common term in the rendering world. It's a data structure which basically represents how the QML item scene looks like. So as I told you, the QML is basically a child parent thing. So the scene graph will actually order this thing during the rendering process. So yeah. So that's what the cute scene graph is. Now as against traditional imperative painting systems like QPainter, this is a much faster way to render stuff because the cute scene graph actually takes lesser state changes to render, say, if you have to render 30 background images. So instead of 30 imperative painting calls, you would just take one call in the scene graph. So yeah, that's how QD Quick Content is actually rendered in the back end. So this is a big advantage because we don't really have to pass stuff. And yeah, so that's QML rendering. So there's a way to actually tweak this process. So now I want you to imagine how we would want to take QML and if you want to make a video out of it. So the nature of approach would be to load this QML in a quick window and then call grab window for each frame. So that's the native approach. You can just call grab window for each frame that goes by. And this one sucks because it takes a lot of time. Suppose your QML file takes five minutes from beginning to end. It would take five minutes to actually render the whole thing because this thing is like screen recording. It will take each frame. And to grab window is expensive. As you all know, it calls the OpenGL graph pixels. So it's expensive and it's time consuming. So how we can tweak this to make it a lot more faster is to make use of this magical class called QQ render control. So as the name says, render control, it allows you to control the different steps in the whole rendering room. So now when you use this class, you don't actually need that window. You can actually just tell the renderer to actually render your QML onto a frame buffer object which you can just use it for your image later. So that's what QQ render control allows you to do. So that's what we have tried to do. We have tried to load a QML file. You use this class and directly render this QML onto a frame buffer object and save it. And I'm not going to go too much into technical because it might get a bit boring. So when you do this, you're getting obviously a lot more freedom to do it. But you will have to handle the context and the frame buffer object and threading and stuff like that. So that's that. So the stuff I just talked about, we got this idea from this blog. So you can just look it up if you are really into technical details by Andy on the Qt blog. So it's a great blog how Andy actually observed that people were using the Qt API in ways that they weren't supposed to. And he just sought out to make an example out of that. And that's the result. So you can find the code there. It's I think production ready. That's the QML. I call it the QML renderer. It's a library. It has you can actually even test it out on. You can just go QML you go the input file with the QML file. You tell how many frames you want. And you can just give the upper directory and you will get those many frames in by default be JPG or whatever you want. So I can even tell which format you want. And yeah, so what now we have the frames. So most of the heavy lifting is done now. Now we have taken a QML file. We have rendered it. We got the frames. Now we just need to, you know, combine it together and play it. So yeah. Now MLT. So kid in live uses as its back end it uses an open source multimedia framework called MLT. So MLT was originally it's a it was made for broadcasting services. So it's loosely based on the design on the consumer producer design pattern. So what we need here is we have some QML frames and we need to, you know, have MLT producer. So in order to, you know, play that QML file. So yeah, it's not that hard really. I just this was done around a month ago and we right now we have an MLT producer which can actually play a QML file. So, yeah. So you can find the code there for the MLT producer if you want to tweak play with it. And yeah, it's the demo. Yeah. So you just if you want to test it out, you just go any LT melt. Melt is the command line interface for MLT. So you go just you just tell melt which producer to use. That's QML and you tell the input file. So that will just, you know, tell you to tell. There you go. It just plays it there. You can see the you can see the frames changing there. So that's that's how MLT does it. And yeah, so we are done with QML. We are done with QML rendering. We got the frames. So we got our we are able to play it. And the next process, the next step. Yeah, we have actually tried to try to put that in Cadian live. This work is currently ongoing. And what we've done is let's just connect the producer to the clip monitor in Cadian live. So that's the clip monitor you get after you, you know, after you drag a QML file onto the bin. So you can just play the file. That thing doesn't move, but it's playing. So yeah, got so far. This is still in process because we are not there yet. The QML, the MLT producer can't yet animate animated QML frames just static ones because for our initial testing, we thought let's stop with this and it works fine so far. And yeah, moving on. What's next? So yeah, as I said, we need animated QML support. We need that's an obvious requirement if we were to create a new title tool in the future. And QML obviously having animated QML is an requirement. And yeah, once we have that and once you've completed the integration of the current producer and we're done with testing it completely with Cadian live because so far facing some issues with handling it in the timeline. And we'll be looking into that soon. But once that is done, I suppose we could just move on and move on with the title tool. So this is what I did for my last summer of core program. And yeah, so last summer I worked on creating the QML render library. And after that the work was to create the MLT producer and which was done a couple of months ago. And right now we're into creating the we're into integrating this producer into Cadian live and and yeah, once that is done, we will actually start to think about how we're going to design the new title tool about the about the interface about how we're going to change it about what things we're going to add. And after that is done, we can actually possibly get it done and maybe or maybe I don't know in some time, I can't really say. And yeah, so I guess I'm I'm really done. Yeah, so if you have any questions. You have one question online. So on online questions.org. And it is, do you think this approach could be used for 24 seven live play out system? Well, really, because you could, because you are really creating frames, but I'm not sure about the performance. You could, in theory, create an MLT producer to do that or something else, which is more feasible. But so far what I have noticed is it's not really that quick the QML renderer. But in theory, you should be able to do it because in the end you are just creating frames and you just need to play them. So I'm not sure about the feasibility, but maybe next question. How do you manage video rendering time on QML side? How do we manage Q video rendering time on QML side and really get that question. Well, we have a suppose if we have a static QML frame where we really don't have animations, you don't need to worry about the time it takes. Rendering time. Okay. All right. The time it takes to render, I guess. If you want to start an animation of this frame or this frame, how do you make it? Oh, all right. All right. This many frames? Okay. Okay. That makes sense. Yeah. All right. Yeah. Well, the approach right now, how it works is we just, there's an animation driver. So we have actually, we have a custom animation driver, which we have overwritten. So if we want a certain frame at a certain point of time, what we do is we just advance to that point of time and we get that frame. That's how we do it right now. That may not be efficient, but we are getting there. Any other questions from the floor? Raise your hand. Title sequences. Do you see this potentially something suitable for like hold the shoulder graphics or like banners? You know, something, you know, more oriented around like real-time, opposed to like post-process content? So the question is, yeah. The question is if we can use this approach to actually, for more, a wider range of applications such as presentations or banners or stuff. So the answer is definitely yes, because you have the entire QML spectrum, which you can use to design stuff. So I don't really, I didn't really face a limitation till now because we are rendering using the scene graph. So there is no limitation per se of what we render. So if we can render QML successfully, we can actually connect it to anything we want to. So yeah, the answer is yes. Another question? Thank you, Akil. Thank you.