| Safe Haskell | None |
|---|
Codec.FFmpeg.Juicy
Description
Convert between FFmpeg frames and JuicyPixels images.
- toJuicyT :: AVFrame -> MaybeT IO DynamicImage
- toJuicy :: AVFrame -> IO (Maybe DynamicImage)
- toJuicyImage :: forall p. JuicyPixelFormat p => AVFrame -> IO (Maybe (Image p))
- saveJuicy :: FilePath -> AVFrame -> IO ()
- class Pixel a => JuicyPixelFormat a where
- juicyPixelFormat :: proxy a -> AVPixelFormat
- juicyPixelStride :: forall a proxy. Pixel a => proxy a -> Int
- imageReader :: forall m p e. (Functor m, MonadIO m, Error e, MonadError e m, JuicyPixelFormat p) => FilePath -> m (IO (Maybe (Image p)), IO ())
- imageReaderTime :: forall m p e. (Functor m, MonadIO m, Error e, MonadError e m, JuicyPixelFormat p) => FilePath -> m (IO (Maybe (Image p, Double)), IO ())
- imageWriter :: forall p. JuicyPixelFormat p => EncodingParams -> FilePath -> IO (Maybe (Image p) -> IO ())
Documentation
toJuicyT :: AVFrame -> MaybeT IO DynamicImageSource
Convert an AVFrame to a DynamicImage with the result in the
MaybeT transformer.
toJuicyT = MaybeT . toJuicy
toJuicy :: AVFrame -> IO (Maybe DynamicImage)Source
Convert an AVFrame to a DynamicImage.
toJuicyImage :: forall p. JuicyPixelFormat p => AVFrame -> IO (Maybe (Image p))Source
saveJuicy :: FilePath -> AVFrame -> IO ()Source
Save an AVFrame to a PNG file on disk assuming the frame could
be converted to a DynamicImage using toJuicy.
class Pixel a => JuicyPixelFormat a whereSource
Mapping of JuicyPixels pixel types to FFmpeg pixel formats.
Methods
juicyPixelFormat :: proxy a -> AVPixelFormatSource
juicyPixelStride :: forall a proxy. Pixel a => proxy a -> IntSource
Bytes-per-pixel for a JuicyPixels Pixel type.
imageReader :: forall m p e. (Functor m, MonadIO m, Error e, MonadError e m, JuicyPixelFormat p) => FilePath -> m (IO (Maybe (Image p)), IO ())Source
Read frames from a video stream.
imageReaderTime :: forall m p e. (Functor m, MonadIO m, Error e, MonadError e m, JuicyPixelFormat p) => FilePath -> m (IO (Maybe (Image p, Double)), IO ())Source
Read time stamped frames from a video stream. Time is given in seconds from the start of the stream.
imageWriter :: forall p. JuicyPixelFormat p => EncodingParams -> FilePath -> IO (Maybe (Image p) -> IO ())Source
Open a target file for writing a video stream. When the returned
function is applied to Nothing, the output stream is closed. Note
that Nothing must be provided when finishing in order to
properly terminate video encoding.
Support for source images that are of a different size to the
output resolution is limited to non-palettized destination formats
(i.e. those that are handled by libswscaler). Practically, this
means that animated gif output is only supported if the source
images are of the target resolution.