png file on video with no lag...is it possible?


    May 04 2017 | 6:56 am
    Hi
    I am trying to put some text on top of a live video feed. I thought that png would be best way to do this but I am experiencing a momentary lag in the feed when the png loads. Is there way around this?
    After searching the archives, I have tried two methods: non gl (using alphablend) and gl (using videoplane). The gl version is marginally better but the lag is still there.
    I realise that it would be possible by using simple text and an lcd object, but I want big, colourful, multilined text.
    Please see the attached folder and files for my examples so far.
    Cheers :)

    • May 04 2017 | 8:41 am
      I've tried your OpenGL version, but I guess the non-GL approach suffers from the same problem. The problem you're having is related to the action of reading the images from the disk. With the "read" message, the images are being read in the same thread as the rendering, so while the image is being read, there's no rendering of anything, including the live feed. Solutions:
      1. Use the "asyncread" message instead of "read", as it creates a separate thread to do it.
      2. Read all the images beforehand to different jit.matrix objects or, better yet, a single jit.matrixset, and trigger them when you need it.
    • May 05 2017 | 2:46 am
      Thank you very much for your help! These are both great ways to minimalise/ remove the lag.
      Cheers!