• I’ve pretty much come to the conclusion that there is no true way to get the true current frame of a video using any properties of the stream or metadata from the video. Whatever information you receive about the video you can never be sure that’s actually what pixels are being displayed. Even if you draw the video to a bitmap, you can never be sure what frame the video object is currently displaying when you copy the pixels. That is, the only way to know what frame is displayed is to actually look at that frame.

    The only true thing you can trust about a displayed frame is the frame itself. Therefore, the solution I came up with is to embed the frame value into the video itself. This can be done as a small bar at the bottom of the video that is the binary value of the current frame displayed as a barcode. Then, every frame you capture the video frame, check the pixels of the barcode, and convert the binary value back to base-10 and voilà, you have the actual current frame.

    Basically your video has an extra 10 pixels at the bottom. The first 5 pixels are the bottom 5 pixels of the video mirrored. This is to ensure that during the compression bleeding and artifacts don’t appear due to the stark contrast between the video and the barcode. The last 5 rows of pixels below the mirrored strip are the barcode. There are many options to make the barcode at the bottom of the video. Zeh wrote an After Effects expression that generates it as the video renders. I made mine externally, via Photoshop JSX. A better option than Photoshop scripting would have been processing or AIR app, but at the time I was too lazy to set either of those up and honestly I wanted to explore using JavaScript in Photoshop some more.

    Hi Zeh
    wondering how i get my hands on the “expression’ that will embed code as video is exported out of after effects


  • Zeh

    Hi tricia,

    I don’t have that project anymore, so I don’t have the expression.

    What I had was a bunch of squares (one square for each binary “digit”. The background was black, and the square was white. Then its opacity would be controlled by the expression, depending on the digit position. So the rightmost square would have an opacity of 1 if “current frame % 2 > 0”, and 0 otherwise. The second digit would have an opacity of 1 if “(current frame % 8) % 4 > 0” (something like that). And so on and so forth. It was kinda hacky but worked well.

    Frame number reading in Flash is still appallingly bad. I’ve created a bug/feature request on Adobe’s JIRA tracker a while ago but nothing came of it. If anything, we can be happy that it seems to be much better and precise in HTML5 (of all things). I did some small testing on Chrome a while ago and was very happy with the results!

  • Don


    I just downloaded your work from dafont.com while looking for a font whose license terms are agreeable with my entry in LD25!

    I came to your website when I couldn’t find a license for this font. Could you tell me if I’m allowed to use this in my LD25 entry? 😀



  • Zeh

    NO YOU ARE NOT! My LD shall be superior by disallowing people to use my fonts!

    Just kidding. Sure you can use it. Maybe it’s not too obvious but that font has a free license.. you can use it as you please. I just “copied” the VGA font design anyway.

    Good luck! Myself, I’m still thinking of ideas for LD 25…