Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Black screen delete expression?

  • Black screen delete expression?

    Posted by Cedric Bogaert on June 24, 2011 at 3:54 pm

    Heeelp 😀
    Dear fellows, I got a little problem. I recorded my screen yesterday, while playing assasins greed, but something went wrong. When I watched what I recorded, I saw that the screen went black around every 5 frames. So:
    Frame1=image
    Frame2=Black
    Frame 3= black
    Frame4=Image

    Totally random black images between it.

    So, my question is: Is there a way to get this black frames out of the movie? So to be more specificly, is there an after effects expression that says somethings like this:
    IF Frame “movie” = black, THEN delete Frame

    Is there? Hopefully there is, or do you guys know another way maybe to do this?

    Thanks!

    When it HURTS to look back, and you’re SCARED to look ahead,you can look beside you and Bogstar will be there

    Gorm Horger replied 12 years, 2 months ago 3 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    June 24, 2011 at 4:30 pm

    You could probably hack something together using time rempapping and sampleImage(), but I think it would be really slow. Did you want it to skip black frames (which would speed up the movie) or hold the previous non-black frame (which would be easier and faster)?

    Dan

  • Cedric Bogaert

    June 24, 2011 at 7:16 pm

    Uuh, I’m not really used to all the after effects expressions, so I just need a expression that I need to add to the movie layer. I think it would be better when it just skips the black images, But I would be happy to see when it just reshowed the previous image! Thanks for your reaction already! Ow, yeah, couldn’t it maybe be done with a luma key on that layer, so that that layer becomes transparant when it is black. And then, when you precompose it you maybe could add an expression like IF frame=transparant, then skip that frame
    Or something like that xP
    Of course I’m just suggesting, but I’m sure that more advanced people in expressions will be able to help me out! Thanks!

    When it HURTS to look back, and you’re SCARED to look ahead,you can look beside you and Bogstar will be there

  • Dan Ebberts

    June 24, 2011 at 10:12 pm

    Well, here’s the simple version that just holds the most recent non-black frame. You have to enable time remapping and then add this time remapping expression:


    for (f = timeToFrames(); f >= timeToFrames(inPoint); f--){
    L = rgbToHsl(sampleImage([width,height]/2,[10,10],true,framesToTime(f)))[2];
    if (L > .01) break;
    }
    framesToTime(f);

    You might have to adjust the .01 value in the third line to get the sensitivity you need.

    Dan

  • Gorm Horger

    June 18, 2014 at 9:21 am

    Hi Dan,

    i tried to copy/paste your code to an After Effects CC – Project i’m working on. The result is either a “timeout while waiting for the engine” on values for L larger than .2 or a replication of the first frame over the whole timeline (like a frozen image) on values smaller than .2

    It is the first time for me working with expressions why it could be an operationg error too. To eleminate this, i’ll try a step by step description on how i applied the expression:
    1. going to first frame of video in composition
    2. rightclick on video in composition
    3. select time / time remapping
    4. alt+click on the clock of time remapping in composition
    5. copy/paste your code

    result:

    link to image

    I would be glad if you could help me with some advice how to hold the most recent non-black frame until the next non-black frame comes…

  • Dan Ebberts

    June 18, 2014 at 4:31 pm

    Try making this correction to the first line:

    for (f = timeToFrames(time); f >= timeToFrames(inPoint); f–){

    If that doesn’t help–what are your comp dimensions?

    Dan

  • Gorm Horger

    June 23, 2014 at 8:52 am

    working great. thanks!!!

    for (f = timeToFrames(time); f >= timeToFrames(inPoint); f--){
    L = rgbToHsl(sampleImage([width,height]/2,[10,10],true,framesToTime(f)))[2];
    if (L > .01) break;
    }
    framesToTime(f);

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy