Created
July 26, 2015 15:25
-
-
Save TomMD/ae6dd7e1bbc1f041e440 to your computer and use it in GitHub Desktop.
Shows how to use Friday, Friday-JuicyPixels and FFmpeg-light to get a lazy image list.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module LazyDemo where | |
import Vision.Image.JuicyPixels | |
import Vision.Image (RGBA) | |
import Codec.FFmpeg | |
import System.IO.Unsafe | |
lazyStream :: FilePath -> IO [RGBA] | |
lazyStream fp = do | |
initFFmpeg | |
(rd,close) <- imageReader fp | |
go rd close | |
where | |
go rd close = do | |
mi <- rd | |
case mi of | |
Nothing -> close >> return [] | |
Just i -> (toFridayRGBA i : ) <$> unsafeInterleaveIO (go rd close) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment