uyvy conversion question - slab vs CPU

    Jul 19 2012 | 9:15 pm
    Hi All,
    I have a patch which functionally does what I want, but I can't figure out how to fix one aspect which affects CPU usage.
    The patch reads a qt movie in uyvy mode, then does the conversion to RGBA on a slab. Problem is that I have a shared context where I want to take the same movie and display it as a thumbnail within a larger pwindow.
    I have it working, but I can't figure out how to do the thumbnail as a portion of the larger pwindow AND do the uyvy to RGBA conversion on the slab. Something about how I'm patching it up only works if I do the conversion using jit.uyvy2argb which hogs way more CPU than I want to use.
    The patch will make it all self-explanatory I think:
    Any ideas would be awesome, thanks!

    • Jul 26 2012 | 1:11 am
      I guess I'll have to try another approach - doesn't seem to be any interest on the forum with this question - lol
      Thanks anyway :-)
    • Jul 26 2012 | 9:27 am
      how about this? (btw, do you really need 200fps with qmetro 5?)
    • Jul 26 2012 | 9:37 am
      btw #2, you're better off using a jit.window instead of a jit.pwindow for your preview as well. pwindows are very inefficient. i've got the qmetro set at 60hz. with jit.pwindow i get 30fps, with jit.window 60fps.
    • Jul 26 2012 | 3:28 pm
      Hi dtr,
      Thanks for the patch and info - I'm in a session now, but I'll def. check it out =)
      As far as jit.pwindow vs. jit.window, I will need to be able to track mouseover and mouse click etc. - i.e. there is a lot of user interaction with the pwindow. I forget, can I do the same with jit.window, including tracking mouse coords within the window?
      Thanks again!
    • Jul 26 2012 | 4:37 pm
      I'm sure there's an equivalent in GL land that will work on jit.window, just don't know which, haven't used such a thing.
    • Jul 27 2012 | 1:42 am
      Hi dtr,
      I checked out your posted patch. The problem is that with 2 videoplanes on different layers in the preview window, I lose one of the important aspects of my original patch.
      When I write to the sub texture in my patch, every time I move the thumbnail, it updates the portion of the texture that it is sitting over. So the texture ends up with the thumbnails getting updated as I move them around. Your patch using 2 video planes, doesn't update the portion of the texture, so when I move the thumbnail, the underlying video stays as it was. i.e. the top "layer" doesn't affect the bottom layer.
      I need to have the thumbnail updating the actual texture using the subtex messages.
      This is what was confusing. I can get that to happen, but only if I do the uyvy conversion prior to sending to the GPU. If I do the conversion on the GPU, I can't get the subtext message to work to create a thumbnail.
      Thanks for the idea though. Hopefully there is a way to do what I am trying to do
    • Jul 27 2012 | 10:42 am
      Ah ok, I overlooked that. It relates to this, right?
      How about not doing uyvy conversion at all, just reading in the movie in rgba? I bet working out how to do it with a window instead of a pwindow will gain you much more than sending uyvy to the GPU.
    • Jul 27 2012 | 11:13 pm
      Hey dtr,
      I'll check out the possibility of doing the window instead of pwindow, but there's a lot more going on in my main patch, so I'm trying to keep as much on the GPU as possible, and saw a big boost in performance when I went from RGBA to uyvy and converting on a slab.
      I'd really like to try to keep the patch the same, but get the subtexture working here.
    • Jul 27 2012 | 11:23 pm
      why don't you just use something like a scaled down to display your thumbnail?
    • Jul 28 2012 | 11:31 am
      That's what I patched for him but that doesn't do the feedback/compositing part.
    • Jul 28 2012 | 2:54 pm
      Exactly . The idea is not just to get a thumbnail video to sit in position over the other layer of video, but to have it replacing the "underlying video as it runs, wherever the thumbnail sits.
      The original patch I had posted works functionally as I need it to, but I'm looking for a solution that also does the uyvy conversion on the GPU.
      dtr, I did get the mouseover functionality to work just fine using jit.window instead of jit.pwindow - That was actually pretty easy as it uses the idlemouse attribute much the same as the pwindow. Thanks!
      Still searching for the solution to the original problem. =)
    • Jul 28 2012 | 8:23 pm
      ok, i see what you mean.
      you can make this work by using to capture the two layers (static backgroud and dynamic thumbnail) then a third videoplane on the pwindow context too display the captured texture.
      for the feedback, you also send the gl.node captured texture back to the background videoplane layer.
      also, you should use jit.window/jit.pwindow @shared 1, rather than the deprecated gl.render @shared_context.
    • Jul 29 2012 | 11:42 pm
      Hi Robert,
      Thanks as always for the help. I think this will work very well!
      I did notice that on my setup, the patch you posted has a flicker that happens every few seconds on the thumbnail.
      Does it do that on your setup as well? Is there a way around it?