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…