-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Minimal bindings to the FFmpeg library. -- -- Stream frames from an encoded video, or stream frames to a video -- output file. To read the first frame from an h264-encoded -- file into a JuicyPixels Maybe DynamicImage, -- --
--   import Codec.FFmpeg
--   import Codec.Picture
--   import Control.Applicative
--   
--   go :: IO (Maybe DynamicImage)
--   go = do (getFrame, cleanup) <- imageReader "myVideo.mov"
--           (fmap ImageRGB8 <$> getFrame) <* cleanup
--   
-- -- Tested with FFmpeg 3.1 - 4.3.1 @package ffmpeg-light @version 0.13.0 module Codec.FFmpeg.Enums newtype AVMediaType AVMediaType :: CInt -> AVMediaType avmediaTypeVideo :: AVMediaType avmediaTypeAudio :: AVMediaType avmediaTypeData :: AVMediaType avmediaTypeSubtitle :: AVMediaType avmediaTypeAttachment :: AVMediaType newtype AVPixelFormat AVPixelFormat :: CInt -> AVPixelFormat avPixFmtNone :: AVPixelFormat avmediaTypeNb :: AVMediaType avPixFmtRgb24 :: AVPixelFormat avPixFmtRgba :: AVPixelFormat avPixFmtBgra :: AVPixelFormat avPixFmtY400a :: AVPixelFormat avPixFmtRgb32 :: AVPixelFormat avPixFmtRgb321 :: AVPixelFormat avPixFmtBgr32 :: AVPixelFormat avPixFmtBgr321 :: AVPixelFormat avPixFmtRgb8 :: AVPixelFormat avPixFmtBgr8 :: AVPixelFormat avPixFmtRgb4Byte :: AVPixelFormat avPixFmtBgr4Byte :: AVPixelFormat avPixFmtGray8 :: AVPixelFormat avPixFmtGray16 :: AVPixelFormat avPixFmtGray8a :: AVPixelFormat avPixFmtPal8 :: AVPixelFormat avPixFmtRgb565 :: AVPixelFormat avPixFmtRgb555 :: AVPixelFormat avPixFmtYuv420p :: AVPixelFormat avPixFmtYuv420p9 :: AVPixelFormat avPixFmtYuv420p10 :: AVPixelFormat avPixFmtYuv420p12 :: AVPixelFormat newtype AVCodecID AVCodecID :: CInt -> AVCodecID avCodecIdNone :: AVCodecID avPixFmtYuv422p12 :: AVPixelFormat avCodecIdMpeg1video :: AVCodecID avPixFmtYuv444p12 :: AVPixelFormat avCodecIdMpeg2video :: AVCodecID avPixFmtYuv420p14 :: AVPixelFormat avCodecIdH261 :: AVCodecID avPixFmtYuv422p14 :: AVPixelFormat avCodecIdH263 :: AVCodecID avPixFmtYuv444p14 :: AVPixelFormat avCodecIdRv10 :: AVCodecID avPixFmtYuv420p16 :: AVPixelFormat avCodecIdRv20 :: AVCodecID avPixFmtYuv422p16 :: AVPixelFormat avCodecIdMjpeg :: AVCodecID avPixFmtYuv444p16 :: AVPixelFormat avCodecIdMjpegb :: AVCodecID avPixFmtRgba64 :: AVPixelFormat avCodecIdLjpeg :: AVCodecID avPixFmtBgra64 :: AVPixelFormat avCodecIdSp5x :: AVCodecID avCodecIdJpegls :: AVCodecID avCodecIdMpeg4 :: AVCodecID avCodecIdRawvideo :: AVCodecID avCodecIdMsmpeg4v1 :: AVCodecID avCodecIdMsmpeg4v2 :: AVCodecID avCodecIdMsmpeg4v3 :: AVCodecID avCodecIdWmv1 :: AVCodecID avCodecIdWmv2 :: AVCodecID avCodecIdH263p :: AVCodecID avCodecIdH263i :: AVCodecID avCodecIdFlv1 :: AVCodecID avCodecIdSvq1 :: AVCodecID avCodecIdSvq3 :: AVCodecID avCodecIdDvvideo :: AVCodecID avCodecIdHuffyuv :: AVCodecID avCodecIdCyuv :: AVCodecID avCodecIdH264 :: AVCodecID avCodecIdIndeo3 :: AVCodecID avCodecIdVp3 :: AVCodecID avCodecIdTheora :: AVCodecID avCodecIdAsv1 :: AVCodecID avCodecIdAsv2 :: AVCodecID avCodecIdFfv1 :: AVCodecID avCodecId4xm :: AVCodecID avCodecIdVcr1 :: AVCodecID avCodecIdCljr :: AVCodecID avCodecIdMdec :: AVCodecID avCodecIdRoq :: AVCodecID avCodecIdInterplayVideo :: AVCodecID avCodecIdXanWc3 :: AVCodecID avCodecIdXanWc4 :: AVCodecID avCodecIdRpza :: AVCodecID avCodecIdCinepak :: AVCodecID avCodecIdWsVqa :: AVCodecID avCodecIdMsrle :: AVCodecID avCodecIdMsvideo1 :: AVCodecID avCodecIdIdcin :: AVCodecID avCodecId8bps :: AVCodecID avCodecIdSmc :: AVCodecID avCodecIdFlic :: AVCodecID avCodecIdTruemotion1 :: AVCodecID avCodecIdVmdvideo :: AVCodecID avCodecIdMszh :: AVCodecID avCodecIdZlib :: AVCodecID avCodecIdQtrle :: AVCodecID avCodecIdTscc :: AVCodecID avCodecIdUlti :: AVCodecID avCodecIdQdraw :: AVCodecID avCodecIdVixl :: AVCodecID avCodecIdQpeg :: AVCodecID avCodecIdPng :: AVCodecID avCodecIdPpm :: AVCodecID avCodecIdPbm :: AVCodecID avCodecIdPgm :: AVCodecID avCodecIdPgmyuv :: AVCodecID avCodecIdPam :: AVCodecID avCodecIdFfvhuff :: AVCodecID avCodecIdRv30 :: AVCodecID avCodecIdRv40 :: AVCodecID avCodecIdVc1 :: AVCodecID avCodecIdWmv3 :: AVCodecID avCodecIdLoco :: AVCodecID avCodecIdWnv1 :: AVCodecID avCodecIdAasc :: AVCodecID avCodecIdIndeo2 :: AVCodecID avCodecIdFraps :: AVCodecID avCodecIdTruemotion2 :: AVCodecID avCodecIdBmp :: AVCodecID avCodecIdCscd :: AVCodecID avCodecIdMmvideo :: AVCodecID avCodecIdZmbv :: AVCodecID avCodecIdAvs :: AVCodecID avCodecIdSmackvideo :: AVCodecID avCodecIdNuv :: AVCodecID avCodecIdKmvc :: AVCodecID avCodecIdFlashsv :: AVCodecID avCodecIdCavs :: AVCodecID avCodecIdJpeg2000 :: AVCodecID avCodecIdVmnc :: AVCodecID avCodecIdVp5 :: AVCodecID avCodecIdVp6 :: AVCodecID avCodecIdVp6f :: AVCodecID avCodecIdTarga :: AVCodecID avCodecIdDsicinvideo :: AVCodecID avCodecIdTiertexseqvideo :: AVCodecID avCodecIdTiff :: AVCodecID avCodecIdGif :: AVCodecID avCodecIdDxa :: AVCodecID avCodecIdDnxhd :: AVCodecID avCodecIdThp :: AVCodecID avCodecIdSgi :: AVCodecID avCodecIdC93 :: AVCodecID avCodecIdBethsoftvid :: AVCodecID avCodecIdPtx :: AVCodecID avCodecIdTxd :: AVCodecID avCodecIdVp6a :: AVCodecID avCodecIdAmv :: AVCodecID avCodecIdVb :: AVCodecID avCodecIdPcx :: AVCodecID avCodecIdSunrast :: AVCodecID avCodecIdIndeo4 :: AVCodecID avCodecIdIndeo5 :: AVCodecID avCodecIdMimic :: AVCodecID avCodecIdRl2 :: AVCodecID avCodecIdEscape124 :: AVCodecID avCodecIdDirac :: AVCodecID avCodecIdBfi :: AVCodecID avCodecIdCmv :: AVCodecID avCodecIdMotionpixels :: AVCodecID avCodecIdTgv :: AVCodecID avCodecIdTgq :: AVCodecID avCodecIdTqi :: AVCodecID avCodecIdAura :: AVCodecID avCodecIdAura2 :: AVCodecID avCodecIdV210x :: AVCodecID avCodecIdTmv :: AVCodecID avCodecIdV210 :: AVCodecID avCodecIdDpx :: AVCodecID avCodecIdMad :: AVCodecID avCodecIdFrwu :: AVCodecID newtype SwsAlgorithm SwsAlgorithm :: CUInt -> SwsAlgorithm avCodecIdFlashsv2 :: AVCodecID swsFastBilinear :: SwsAlgorithm swsBilinear :: SwsAlgorithm avCodecIdCdgraphics :: AVCodecID swsBicubic :: SwsAlgorithm avCodecIdR210 :: AVCodecID swsX :: SwsAlgorithm avCodecIdAnm :: AVCodecID swsPoint :: SwsAlgorithm avCodecIdBinkvideo :: AVCodecID swsArea :: SwsAlgorithm avCodecIdIffIlbm :: AVCodecID avCodecIdKgv1 :: AVCodecID swsBicublin :: SwsAlgorithm newtype FFProfile FFProfile :: CInt -> FFProfile swsGauss :: SwsAlgorithm avCodecIdYop :: AVCodecID ffProfileAacMain :: FFProfile swsSinc :: SwsAlgorithm avCodecIdVp8 :: AVCodecID ffProfileAacLow :: FFProfile swsLanczos :: SwsAlgorithm ffProfileAacSsr :: FFProfile avCodecIdPictor :: AVCodecID swsSpline :: SwsAlgorithm avCodecIdAnsi :: AVCodecID ffProfileAacLtp :: FFProfile ffProfileAacHe :: FFProfile avCodecIdA64Multi :: AVCodecID ffProfileAacHeV2 :: FFProfile avCodecIdA64Multi5 :: AVCodecID avCodecIdR10k :: AVCodecID ffProfileAacLd :: FFProfile avCodecIdMxpeg :: AVCodecID ffProfileAacEld :: FFProfile avCodecIdLagarith :: AVCodecID ffProfileMpeg2AacLow :: FFProfile avCodecIdProres :: AVCodecID ffProfileMpeg2AacHe :: FFProfile avCodecIdJv :: AVCodecID ffProfileDts :: FFProfile avCodecIdDfa :: AVCodecID ffProfileDtsEs :: FFProfile ffProfileDts9624 :: FFProfile avCodecIdWmv3image :: AVCodecID ffProfileDtsHdHra :: FFProfile avCodecIdVc1image :: AVCodecID ffProfileDtsHdMa :: FFProfile avCodecIdUtvideo :: AVCodecID ffProfileMpeg2422 :: FFProfile avCodecIdBmvVideo :: AVCodecID avCodecIdVble :: AVCodecID ffProfileMpeg2High :: FFProfile avCodecIdDxtory :: AVCodecID ffProfileMpeg2Ss :: FFProfile avCodecIdV410 :: AVCodecID ffProfileMpeg2SnrScalable :: FFProfile avCodecIdXwd :: AVCodecID ffProfileMpeg2Main :: FFProfile avCodecIdCdxl :: AVCodecID ffProfileMpeg2Simple :: FFProfile avCodecIdXbm :: AVCodecID ffProfileH264Constrained :: FFProfile ffProfileH264Intra :: FFProfile avCodecIdZerocodec :: AVCodecID avCodecIdMss1 :: AVCodecID ffProfileH264Baseline :: FFProfile avCodecIdMsa1 :: AVCodecID ffProfileH264ConstrainedBaseline :: FFProfile avCodecIdTscc2 :: AVCodecID ffProfileH264Main :: FFProfile avCodecIdMts2 :: AVCodecID ffProfileH264Extended :: FFProfile avCodecIdCllc :: AVCodecID ffProfileH264High :: FFProfile avCodecIdMss2 :: AVCodecID ffProfileH264High10 :: FFProfile avCodecIdVp9 :: AVCodecID ffProfileH264High10Intra :: FFProfile newtype AVIOFlag AVIOFlag :: CInt -> AVIOFlag avioFlagRead :: AVIOFlag avCodecIdAic :: AVCodecID ffProfileH264High422 :: FFProfile avioFlagWrite :: AVIOFlag avCodecIdEscape130 :: AVCodecID ffProfileH264High422Intra :: FFProfile avioFlagReadWrite :: AVIOFlag avCodecIdG2m :: AVCodecID ffProfileH264High444 :: FFProfile avioFlagNonblock :: AVIOFlag avCodecIdWebp :: AVCodecID ffProfileH264High444Predictive :: FFProfile newtype AVRoundMode AVRoundMode :: CInt -> AVRoundMode avioFlagDirect :: AVIOFlag avRoundZero :: AVRoundMode avCodecIdHnm4Video :: AVCodecID ffProfileH264High444Intra :: FFProfile avRoundInf :: AVRoundMode avCodecIdHevc :: AVCodecID ffProfileH264Cavlc444 :: FFProfile avRoundDown :: AVRoundMode avCodecIdMp2 :: AVCodecID ffProfileVc1Simple :: FFProfile avRoundUp :: AVRoundMode avCodecIdMp3 :: AVCodecID ffProfileVc1Main :: FFProfile avRoundNearInf :: AVRoundMode newtype CodecFlag CodecFlag :: CInt -> CodecFlag avCodecIdAac :: AVCodecID ffProfileVc1Complex :: FFProfile avRoundPassMinmax :: AVRoundMode avCodecIdAc3 :: AVCodecID ffProfileVc1Advanced :: FFProfile avCodecIdDts :: AVCodecID ffProfileMpeg4Simple :: FFProfile avCodecIdVorbis :: AVCodecID ffProfileMpeg4SimpleScalable :: FFProfile avCodecIdDvaudio :: AVCodecID ffProfileMpeg4Core :: FFProfile avCodecIdWmav1 :: AVCodecID ffProfileMpeg4Main :: FFProfile avCodecIdWmav2 :: AVCodecID ffProfileMpeg4NBit :: FFProfile avCodecIdMace3 :: AVCodecID ffProfileMpeg4ScalableTexture :: FFProfile avCodecIdMace6 :: AVCodecID ffProfileMpeg4SimpleFaceAnimation :: FFProfile avCodecIdVmdaudio :: AVCodecID ffProfileMpeg4BasicAnimatedTexture :: FFProfile avCodecIdFlac :: AVCodecID ffProfileMpeg4Hybrid :: FFProfile avCodecIdMp3adu :: AVCodecID ffProfileMpeg4AdvancedRealTime :: FFProfile avCodecIdMp3on4 :: AVCodecID ffProfileMpeg4CoreScalable :: FFProfile avCodecIdShorten :: AVCodecID avCodecFlagUnaligned :: CodecFlag ffProfileMpeg4AdvancedCoding :: FFProfile avCodecIdAlac :: AVCodecID avCodecFlagQscale :: CodecFlag ffProfileMpeg4AdvancedCore :: FFProfile avCodecFlag4mv :: CodecFlag avCodecIdWestwoodSnd1 :: AVCodecID ffProfileMpeg4AdvancedScalableTexture :: FFProfile avCodecIdGsm :: AVCodecID avCodecFlagOutputCorrupt :: CodecFlag ffProfileMpeg4SimpleStudio :: FFProfile avCodecIdQdm2 :: AVCodecID avCodecFlagQpel :: CodecFlag ffProfileMpeg4AdvancedSimple :: FFProfile avCodecIdCook :: AVCodecID avCodecFlagPass1 :: CodecFlag avCodecFlagPass2 :: CodecFlag avCodecIdTruespeech :: AVCodecID avCodecIdTta :: AVCodecID avCodecFlagLoopFilter :: CodecFlag avCodecFlagGray :: CodecFlag avCodecIdSmackaudio :: AVCodecID avCodecIdQcelp :: AVCodecID avCodecFlagPsnr :: CodecFlag avCodecIdWavpack :: AVCodecID avCodecFlagTruncated :: CodecFlag newtype FormatFlag FormatFlag :: CInt -> FormatFlag avCodecIdDsicinaudio :: AVCodecID avCodecFlagInterlacedDct :: CodecFlag avCodecIdImc :: AVCodecID avCodecFlagLowDelay :: CodecFlag avCodecIdMusepack7 :: AVCodecID avCodecFlagGlobalHeader :: CodecFlag avCodecIdMlp :: AVCodecID avCodecFlagBitexact :: CodecFlag avCodecIdGsmMs :: AVCodecID avCodecFlagAcPred :: CodecFlag avCodecIdAtrac3 :: AVCodecID avCodecFlagInterlacedMe :: CodecFlag avCodecIdApe :: AVCodecID avCodecFlagClosedGop :: CodecFlag avfmtNofile :: FormatFlag avCodecIdNellymoser :: AVCodecID avfmtNeednumber :: FormatFlag avCodecIdMusepack8 :: AVCodecID avfmtGlobalheader :: FormatFlag avCodecIdSpeex :: AVCodecID avfmtNotimestamps :: FormatFlag avCodecIdWmavoice :: AVCodecID avfmtVariableFps :: FormatFlag avCodecIdWmapro :: AVCodecID avfmtNodimensions :: FormatFlag avCodecIdWmalossless :: AVCodecID avfmtNostreams :: FormatFlag avCodecIdAtrac3p :: AVCodecID avfmtNobinsearch :: FormatFlag avCodecIdEac3 :: AVCodecID avfmtNogensearch :: FormatFlag avCodecIdSipr :: AVCodecID newtype PacketFlag PacketFlag :: CInt -> PacketFlag avPktFlagKey :: PacketFlag avfmtNoByteSeek :: FormatFlag avCodecIdMp1 :: AVCodecID avPktFlagCorrupt :: PacketFlag avfmtAllowFlush :: FormatFlag avCodecIdTwinvq :: AVCodecID avfmtTsNonstrict :: FormatFlag newtype LogLevel LogLevel :: CInt -> LogLevel avLogQuiet :: LogLevel avCodecIdTruehd :: AVCodecID avfmtTsNegative :: FormatFlag avLogPanic :: LogLevel avCodecIdMp4als :: AVCodecID avfmtSeekToPts :: FormatFlag avLogFatal :: LogLevel avCodecIdAtrac1 :: AVCodecID avLogError :: LogLevel avCodecIdBinkaudioRdft :: AVCodecID avLogWarning :: LogLevel avCodecIdBinkaudioDct :: AVCodecID avLogInfo :: LogLevel avCodecIdAacLatm :: AVCodecID avLogVerbose :: LogLevel avCodecIdQdmc :: AVCodecID newtype AVSampleFormat AVSampleFormat :: CInt -> AVSampleFormat avSampleFmtNone :: AVSampleFormat avLogDebug :: LogLevel avCodecIdCelt :: AVCodecID avSampleFmtU8 :: AVSampleFormat avLogTrace :: LogLevel avCodecIdG7231 :: AVCodecID avSampleFmtS16 :: AVSampleFormat avLogMaxOffset :: LogLevel avCodecIdG729 :: AVCodecID avSampleFmtS32 :: AVSampleFormat avCodecId8svxExp :: AVCodecID avSampleFmtFlt :: AVSampleFormat avCodecId8svxFib :: AVCodecID avSampleFmtDbl :: AVSampleFormat avCodecIdBmvAudio :: AVCodecID avSampleFmtU8p :: AVSampleFormat avCodecIdRalf :: AVCodecID avSampleFmtS16p :: AVSampleFormat getSampleFormatInt :: AVSampleFormat -> CInt avCodecIdIac :: AVCodecID avSampleFmtS32p :: AVSampleFormat avCodecIdIlbc :: AVCodecID avSampleFmtFltp :: AVSampleFormat avCodecIdOpus :: AVCodecID avSampleFmtDblp :: AVSampleFormat avCodecIdComfortNoise :: AVCodecID avSampleFmtNb :: AVSampleFormat avCodecIdTak :: AVCodecID avCodecIdMetasound :: AVCodecID avCodecIdPafAudio :: AVCodecID avCodecIdOn2avc :: AVCodecID avCodecIdDssSp :: AVCodecID avCodecIdFfwavesynth :: AVCodecID avCodecIdSonic :: AVCodecID avCodecIdSonicLs :: AVCodecID avCodecIdEvrc :: AVCodecID avCodecIdSmv :: AVCodecID avCodecIdDsdLsbf :: AVCodecID avCodecIdDsdMsbf :: AVCodecID avCodecIdDsdLsbfPlanar :: AVCodecID avCodecIdDsdMsbfPlanar :: AVCodecID avCodecId4gv :: AVCodecID instance Foreign.Storable.Storable Codec.FFmpeg.Enums.AVSampleFormat instance Data.Bits.Bits Codec.FFmpeg.Enums.AVSampleFormat instance GHC.Classes.Eq Codec.FFmpeg.Enums.AVSampleFormat instance Foreign.Storable.Storable Codec.FFmpeg.Enums.LogLevel instance Data.Bits.Bits Codec.FFmpeg.Enums.LogLevel instance GHC.Classes.Eq Codec.FFmpeg.Enums.LogLevel instance Foreign.Storable.Storable Codec.FFmpeg.Enums.PacketFlag instance Data.Bits.Bits Codec.FFmpeg.Enums.PacketFlag instance GHC.Classes.Eq Codec.FFmpeg.Enums.PacketFlag instance Foreign.Storable.Storable Codec.FFmpeg.Enums.FormatFlag instance Data.Bits.Bits Codec.FFmpeg.Enums.FormatFlag instance GHC.Classes.Eq Codec.FFmpeg.Enums.FormatFlag instance Foreign.Storable.Storable Codec.FFmpeg.Enums.CodecFlag instance Data.Bits.Bits Codec.FFmpeg.Enums.CodecFlag instance GHC.Classes.Eq Codec.FFmpeg.Enums.CodecFlag instance Foreign.Storable.Storable Codec.FFmpeg.Enums.AVRoundMode instance GHC.Classes.Eq Codec.FFmpeg.Enums.AVRoundMode instance Foreign.Storable.Storable Codec.FFmpeg.Enums.AVIOFlag instance GHC.Classes.Eq Codec.FFmpeg.Enums.AVIOFlag instance Foreign.Storable.Storable Codec.FFmpeg.Enums.FFProfile instance GHC.Classes.Eq Codec.FFmpeg.Enums.FFProfile instance Foreign.Storable.Storable Codec.FFmpeg.Enums.SwsAlgorithm instance GHC.Show.Show Codec.FFmpeg.Enums.SwsAlgorithm instance GHC.Classes.Eq Codec.FFmpeg.Enums.SwsAlgorithm instance Foreign.Storable.Storable Codec.FFmpeg.Enums.AVCodecID instance GHC.Show.Show Codec.FFmpeg.Enums.AVCodecID instance GHC.Classes.Eq Codec.FFmpeg.Enums.AVCodecID instance Foreign.Storable.Storable Codec.FFmpeg.Enums.AVPixelFormat instance GHC.Classes.Eq Codec.FFmpeg.Enums.AVPixelFormat instance Foreign.Storable.Storable Codec.FFmpeg.Enums.AVMediaType instance GHC.Classes.Eq Codec.FFmpeg.Enums.AVMediaType instance GHC.Show.Show Codec.FFmpeg.Enums.AVPixelFormat -- | Minimal operations on small vector types. module Codec.FFmpeg.Internal.Linear -- | A two-component vector data V2 a V2 :: !a -> !a -> V2 a -- | A three-component vector data V3 a V3 :: !a -> !a -> !a -> V3 a -- | Quadrance between two 3D points. qd :: V3 CInt -> V3 CInt -> CInt -- | A four-component vector data V4 a V4 :: !a -> !a -> !a -> !a -> V4 a instance GHC.Base.Functor Codec.FFmpeg.Internal.Linear.V4 instance Foreign.Storable.Storable a => Foreign.Storable.Storable (Codec.FFmpeg.Internal.Linear.V4 a) instance GHC.Base.Functor Codec.FFmpeg.Internal.Linear.V3 instance Foreign.Storable.Storable a => Foreign.Storable.Storable (Codec.FFmpeg.Internal.Linear.V3 a) module Codec.FFmpeg.Types class HasPtr a getPtr :: HasPtr a => a -> Ptr () newtype AVFormatContext AVFormatContext :: Ptr () -> AVFormatContext class HasNumStreams t getNumStreams :: HasNumStreams t => t -> IO CInt setNumStreams :: HasNumStreams t => t -> CInt -> IO () hasNumStreams :: HasNumStreams t => t -> Ptr CInt class HasStreams t getStreams :: HasStreams t => t -> IO (Ptr AVStream) setStreams :: HasStreams t => t -> Ptr AVStream -> IO () hasStreams :: HasStreams t => t -> Ptr (Ptr AVStream) class HasOutputFormat t getOutputFormat :: HasOutputFormat t => t -> IO AVOutputFormat setOutputFormat :: HasOutputFormat t => t -> AVOutputFormat -> IO () hasOutputFormat :: HasOutputFormat t => t -> Ptr AVOutputFormat class HasIOContext t getIOContext :: HasIOContext t => t -> IO AVIOContext setIOContext :: HasIOContext t => t -> AVIOContext -> IO () hasIOContext :: HasIOContext t => t -> Ptr AVIOContext class HasInputFormat t getInputFormat :: HasInputFormat t => t -> IO AVInputFormat setInputFormat :: HasInputFormat t => t -> AVInputFormat -> IO () hasInputFormat :: HasInputFormat t => t -> Ptr AVInputFormat setFilename :: AVFormatContext -> String -> IO () av_input_video_device_next :: AVInputFormat -> IO AVInputFormat setCamera :: AVFormatContext -> IO () avformat_alloc_context :: IO (Ptr ()) mallocAVFormatContext :: IO AVFormatContext newtype AVCodecContext AVCodecContext :: Ptr () -> AVCodecContext class HasBitRate t getBitRate :: HasBitRate t => t -> IO CInt setBitRate :: HasBitRate t => t -> CInt -> IO () hasBitRate :: HasBitRate t => t -> Ptr CInt class HasWidth t getWidth :: HasWidth t => t -> IO CInt setWidth :: HasWidth t => t -> CInt -> IO () hasWidth :: HasWidth t => t -> Ptr CInt class HasHeight t getHeight :: HasHeight t => t -> IO CInt setHeight :: HasHeight t => t -> CInt -> IO () hasHeight :: HasHeight t => t -> Ptr CInt class HasTimeBase t getTimeBase :: HasTimeBase t => t -> IO AVRational setTimeBase :: HasTimeBase t => t -> AVRational -> IO () hasTimeBase :: HasTimeBase t => t -> Ptr AVRational class HasGopSize t getGopSize :: HasGopSize t => t -> IO CInt setGopSize :: HasGopSize t => t -> CInt -> IO () hasGopSize :: HasGopSize t => t -> Ptr CInt class HasPixelFormat t getPixelFormat :: HasPixelFormat t => t -> IO AVPixelFormat setPixelFormat :: HasPixelFormat t => t -> AVPixelFormat -> IO () hasPixelFormat :: HasPixelFormat t => t -> Ptr AVPixelFormat class HasCodecFlags t getCodecFlags :: HasCodecFlags t => t -> IO CodecFlag setCodecFlags :: HasCodecFlags t => t -> CodecFlag -> IO () hasCodecFlags :: HasCodecFlags t => t -> Ptr CodecFlag class HasCodecID t getCodecID :: HasCodecID t => t -> IO AVCodecID setCodecID :: HasCodecID t => t -> AVCodecID -> IO () hasCodecID :: HasCodecID t => t -> Ptr AVCodecID class HasPrivData t getPrivData :: HasPrivData t => t -> IO (Ptr ()) setPrivData :: HasPrivData t => t -> Ptr () -> IO () hasPrivData :: HasPrivData t => t -> Ptr (Ptr ()) class HasTicksPerFrame t getTicksPerFrame :: HasTicksPerFrame t => t -> IO CInt setTicksPerFrame :: HasTicksPerFrame t => t -> CInt -> IO () hasTicksPerFrame :: HasTicksPerFrame t => t -> Ptr CInt class HasRawAspectRatio t getRawAspectRatio :: HasRawAspectRatio t => t -> IO AVRational setRawAspectRatio :: HasRawAspectRatio t => t -> AVRational -> IO () hasRawAspectRatio :: HasRawAspectRatio t => t -> Ptr AVRational getFps :: (HasTimeBase a, HasTicksPerFrame a) => a -> IO CDouble getAspectRatio :: HasRawAspectRatio a => a -> IO (Maybe AVRational) -- | When unspecified, the most likely pixel shape is a square guessAspectRatio :: HasRawAspectRatio a => a -> IO AVRational setAspectRatio :: HasRawAspectRatio a => a -> Maybe AVRational -> IO () newtype AVStream AVStream :: Ptr () -> AVStream class HasId t getId :: HasId t => t -> IO CInt setId :: HasId t => t -> CInt -> IO () hasId :: HasId t => t -> Ptr CInt class HasCodecContext t getCodecContext :: HasCodecContext t => t -> IO AVCodecContext setCodecContext :: HasCodecContext t => t -> AVCodecContext -> IO () hasCodecContext :: HasCodecContext t => t -> Ptr AVCodecContext class HasStreamIndex t getStreamIndex :: HasStreamIndex t => t -> IO CInt setStreamIndex :: HasStreamIndex t => t -> CInt -> IO () hasStreamIndex :: HasStreamIndex t => t -> Ptr CInt newtype AVCodec AVCodec :: Ptr () -> AVCodec class HasLongName t getLongName :: HasLongName t => t -> IO CString setLongName :: HasLongName t => t -> CString -> IO () hasLongName :: HasLongName t => t -> Ptr CString class HasName t getName :: HasName t => t -> IO CString setName :: HasName t => t -> CString -> IO () hasName :: HasName t => t -> Ptr CString class HasPixelFormats t getPixelFormats :: HasPixelFormats t => t -> IO (Ptr AVPixelFormat) setPixelFormats :: HasPixelFormats t => t -> Ptr AVPixelFormat -> IO () hasPixelFormats :: HasPixelFormats t => t -> Ptr (Ptr AVPixelFormat) newtype AVDictionary AVDictionary :: Ptr () -> AVDictionary newtype AVFrame AVFrame :: Ptr () -> AVFrame class HasPts t getPts :: HasPts t => t -> IO CLong setPts :: HasPts t => t -> CLong -> IO () hasPts :: HasPts t => t -> Ptr CLong class HasPktPts t getPktPts :: HasPktPts t => t -> IO CLong setPktPts :: HasPktPts t => t -> CLong -> IO () hasPktPts :: HasPktPts t => t -> Ptr CLong class HasLineSize t getLineSize :: HasLineSize t => t -> IO CInt setLineSize :: HasLineSize t => t -> CInt -> IO () hasLineSize :: HasLineSize t => t -> Ptr CInt newtype AVPicture AVPicture :: Ptr () -> AVPicture newtype SwsContext SwsContext :: Ptr () -> SwsContext newtype AVOutputFormat AVOutputFormat :: Ptr () -> AVOutputFormat class HasFormatFlags t getFormatFlags :: HasFormatFlags t => t -> IO FormatFlag setFormatFlags :: HasFormatFlags t => t -> FormatFlag -> IO () hasFormatFlags :: HasFormatFlags t => t -> Ptr FormatFlag class HasVideoCodecID t getVideoCodecID :: HasVideoCodecID t => t -> IO AVCodecID setVideoCodecID :: HasVideoCodecID t => t -> AVCodecID -> IO () hasVideoCodecID :: HasVideoCodecID t => t -> Ptr AVCodecID newtype AVInputFormat AVInputFormat :: Ptr () -> AVInputFormat newtype AVClass AVClass :: Ptr () -> AVClass class HasAVClass t getAVClass :: HasAVClass t => t -> IO AVClass setAVClass :: HasAVClass t => t -> AVClass -> IO () hasAVClass :: HasAVClass t => t -> Ptr AVClass getAVCategory :: AVInputFormat -> IO Category newtype Category Category :: CInt -> Category avClassCategoryNa :: Category avClassCategoryInput :: Category avClassCategoryOutput :: Category avClassCategoryMuxer :: Category avClassCategoryDemuxer :: Category newtype AVIOContext AVIOContext :: Ptr () -> AVIOContext avClassCategoryEncoder :: Category newtype AVPacket AVPacket :: Ptr () -> AVPacket avClassCategoryDecoder :: Category class HasData t getData :: HasData t => t -> IO (Ptr ()) setData :: HasData t => t -> Ptr () -> IO () hasData :: HasData t => t -> Ptr (Ptr ()) class HasSize t getSize :: HasSize t => t -> IO CInt setSize :: HasSize t => t -> CInt -> IO () hasSize :: HasSize t => t -> Ptr CInt avClassCategoryFilter :: Category class HasPacketFlags t getPacketFlags :: HasPacketFlags t => t -> IO PacketFlag setPacketFlags :: HasPacketFlags t => t -> PacketFlag -> IO () hasPacketFlags :: HasPacketFlags t => t -> Ptr PacketFlag class HasDts t getDts :: HasDts t => t -> IO CLong setDts :: HasDts t => t -> CLong -> IO () hasDts :: HasDts t => t -> Ptr CLong avClassCategoryBitstreamFilter :: Category avClassCategorySwscaler :: Category avClassCategorySwresampler :: Category avClassCategoryDeviceVideoOutput :: Category avClassCategoryDeviceVideoInput :: Category -- | sizeof the AVPacket structure in bytes. packetSize :: Int avClassCategoryDeviceAudioOutput :: Category pictureSize :: Int avClassCategoryDeviceAudioInput :: Category avClassCategoryDeviceOutput :: Category avClassCategoryDeviceInput :: Category data AVRational AVRational :: CInt -> CInt -> AVRational [numerator] :: AVRational -> CInt [denomenator] :: AVRational -> CInt avClassCategoryNb :: Category -- | FFmpeg often uses 0 to mean "unknown"; use Nothing instead. nonZeroAVRational :: AVRational -> Maybe AVRational av_rescale_rnd :: CLong -> CLong -> CLong -> AVRoundMode -> CLong -- | Convert an AVRational to a Double av_q2d :: AVRational -> CDouble -- | Rescale an integer from one time base to another. av_rescale_q :: CLong -> AVRational -> AVRational -> CLong -- | The input source can be a file or a camera. When using Camera, -- frequently in the form Camera "0:0" defaultCameraConfig, the -- first input video device enumerated by libavdevice is selected. data InputSource File :: FilePath -> InputSource Camera :: String -> CameraConfig -> InputSource data CameraConfig CameraConfig :: Maybe Int -> Maybe (Int, Int) -> Maybe String -> CameraConfig [framerate] :: CameraConfig -> Maybe Int [resolution] :: CameraConfig -> Maybe (Int, Int) -- | Short name for a video format (e.g. "v4l2") [format] :: CameraConfig -> Maybe String defaultCameraConfig :: CameraConfig instance GHC.Read.Read Codec.FFmpeg.Types.InputSource instance GHC.Show.Show Codec.FFmpeg.Types.InputSource instance GHC.Classes.Ord Codec.FFmpeg.Types.InputSource instance GHC.Classes.Eq Codec.FFmpeg.Types.InputSource instance GHC.Read.Read Codec.FFmpeg.Types.CameraConfig instance GHC.Show.Show Codec.FFmpeg.Types.CameraConfig instance GHC.Classes.Ord Codec.FFmpeg.Types.CameraConfig instance GHC.Classes.Eq Codec.FFmpeg.Types.CameraConfig instance GHC.Show.Show Codec.FFmpeg.Types.AVRational instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVPacket instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVPacket instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVIOContext instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVIOContext instance GHC.Enum.Enum Codec.FFmpeg.Types.Category instance GHC.Read.Read Codec.FFmpeg.Types.Category instance GHC.Show.Show Codec.FFmpeg.Types.Category instance GHC.Classes.Ord Codec.FFmpeg.Types.Category instance GHC.Classes.Eq Codec.FFmpeg.Types.Category instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVClass instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVClass instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVInputFormat instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVInputFormat instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVOutputFormat instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVOutputFormat instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.SwsContext instance Foreign.Storable.Storable Codec.FFmpeg.Types.SwsContext instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVPicture instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVPicture instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVFrame instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVFrame instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVDictionary instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVDictionary instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVCodec instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVCodec instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVStream instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVStream instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVCodecContext instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVCodecContext instance Codec.FFmpeg.Types.HasPtr Codec.FFmpeg.Types.AVFormatContext instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVFormatContext instance Codec.FFmpeg.Types.HasTimeBase Codec.FFmpeg.Types.AVCodecContext instance Codec.FFmpeg.Types.HasTimeBase Codec.FFmpeg.Types.AVStream instance Codec.FFmpeg.Types.HasRawAspectRatio Codec.FFmpeg.Types.AVCodecContext instance Foreign.Storable.Storable Codec.FFmpeg.Types.AVRational instance Codec.FFmpeg.Types.HasDts Codec.FFmpeg.Types.AVPacket instance Codec.FFmpeg.Types.HasPacketFlags Codec.FFmpeg.Types.AVPacket instance Codec.FFmpeg.Types.HasSize Codec.FFmpeg.Types.AVPacket instance Codec.FFmpeg.Types.HasData Codec.FFmpeg.Types.AVFrame instance Codec.FFmpeg.Types.HasData Codec.FFmpeg.Types.AVPicture instance Codec.FFmpeg.Types.HasData Codec.FFmpeg.Types.AVPacket instance Codec.FFmpeg.Types.HasStreamIndex Codec.FFmpeg.Types.AVPacket instance Codec.FFmpeg.Types.HasPts Codec.FFmpeg.Types.AVPacket instance Codec.FFmpeg.Types.HasIOContext Codec.FFmpeg.Types.AVFormatContext instance Codec.FFmpeg.Types.HasAVClass Codec.FFmpeg.Types.AVInputFormat instance Codec.FFmpeg.Types.HasInputFormat Codec.FFmpeg.Types.AVFormatContext instance Codec.FFmpeg.Types.HasVideoCodecID Codec.FFmpeg.Types.AVFormatContext instance Codec.FFmpeg.Types.HasVideoCodecID Codec.FFmpeg.Types.AVOutputFormat instance Codec.FFmpeg.Types.HasFormatFlags Codec.FFmpeg.Types.AVOutputFormat instance Codec.FFmpeg.Types.HasOutputFormat Codec.FFmpeg.Types.AVFormatContext instance Codec.FFmpeg.Types.HasLineSize Codec.FFmpeg.Types.AVFrame instance Codec.FFmpeg.Types.HasPktPts Codec.FFmpeg.Types.AVFrame instance Codec.FFmpeg.Types.HasPts Codec.FFmpeg.Types.AVFrame instance Codec.FFmpeg.Types.HasPixelFormat Codec.FFmpeg.Types.AVFrame instance Codec.FFmpeg.Types.HasWidth Codec.FFmpeg.Types.AVFrame instance Codec.FFmpeg.Types.HasHeight Codec.FFmpeg.Types.AVFrame instance Codec.FFmpeg.Types.HasPixelFormats Codec.FFmpeg.Types.AVCodec instance Codec.FFmpeg.Types.HasName Codec.FFmpeg.Types.AVCodec instance Codec.FFmpeg.Types.HasLongName Codec.FFmpeg.Types.AVCodec instance Codec.FFmpeg.Types.HasCodecID Codec.FFmpeg.Types.AVCodec instance Codec.FFmpeg.Types.HasStreamIndex Codec.FFmpeg.Types.AVStream instance Codec.FFmpeg.Types.HasCodecContext Codec.FFmpeg.Types.AVStream instance Codec.FFmpeg.Types.HasId Codec.FFmpeg.Types.AVStream instance Codec.FFmpeg.Types.HasStreams Codec.FFmpeg.Types.AVFormatContext instance Codec.FFmpeg.Types.HasTicksPerFrame Codec.FFmpeg.Types.AVCodecContext instance Codec.FFmpeg.Types.HasPrivData Codec.FFmpeg.Types.AVCodecContext instance Codec.FFmpeg.Types.HasCodecID Codec.FFmpeg.Types.AVCodecContext instance Codec.FFmpeg.Types.HasCodecFlags Codec.FFmpeg.Types.AVCodecContext instance Codec.FFmpeg.Types.HasPixelFormat Codec.FFmpeg.Types.AVCodecContext instance Codec.FFmpeg.Types.HasGopSize Codec.FFmpeg.Types.AVCodecContext instance Codec.FFmpeg.Types.HasHeight Codec.FFmpeg.Types.AVCodecContext instance Codec.FFmpeg.Types.HasWidth Codec.FFmpeg.Types.AVCodecContext instance Codec.FFmpeg.Types.HasBitRate Codec.FFmpeg.Types.AVCodecContext instance Codec.FFmpeg.Types.HasNumStreams Codec.FFmpeg.Types.AVFormatContext instance Codec.FFmpeg.Types.HasPtr (GHC.Ptr.Ptr ()) -- | Helpers for dumping information about codecs to stdout. module Codec.FFmpeg.Internal.Debug -- | FFmpeg's built-in format debug utlity. av_dump_format :: AVFormatContext -> CInt -> CString -> CInt -> IO () -- | Print the short name, long name, and ID of a codec. debugCodec :: AVCodec -> IO () -- | Print various codec settings. debugCodecContext :: AVCodecContext -> IO () av_get_pix_fmt_name :: AVPixelFormat -> IO CString pixFmtName :: AVPixelFormat -> IO String -- | Print all pixel formats supported by a given AVCodec. debugPixelFormats :: AVCodec -> IO () avcodec_get_name :: AVCodecID -> IO CString -- | Get the name of a codec. debugCodecName :: AVCodecID -> IO String module Codec.FFmpeg.Common open_codec :: AVCodecContext -> AVCodec -> Ptr AVDictionary -> IO CInt av_frame_alloc :: IO AVFrame av_frame_get_buffer :: AVFrame -> CInt -> IO CInt av_frame_free :: Ptr AVFrame -> IO () codec_close :: AVCodecContext -> IO CInt init_packet :: AVPacket -> IO () free_packet :: AVPacket -> IO () av_malloc :: CSize -> IO (Ptr ()) av_free :: Ptr () -> IO () sws_getCachedContext :: SwsContext -> CInt -> CInt -> AVPixelFormat -> CInt -> CInt -> AVPixelFormat -> SwsAlgorithm -> Ptr () -> Ptr () -> Ptr CDouble -> IO SwsContext sws_scale :: SwsContext -> Ptr (Ptr CUChar) -> Ptr CInt -> CInt -> CInt -> Ptr (Ptr CUChar) -> Ptr CInt -> IO CInt av_image_get_buffer_size :: AVPixelFormat -> CInt -> CInt -> CInt -> IO CInt av_image_copy_to_buffer :: Ptr CUChar -> CInt -> Ptr (Ptr CUChar) -> Ptr CInt -> AVPixelFormat -> CInt -> CInt -> CInt -> IO CInt -- | Catch an IOException from an IO action and re-throw it in a wrapping -- monad transformer. wrapIOError :: (MonadIO m, MonadError String m) => IO a -> m a -- | Allocate an AVFrame and set its fields to default values. frame_alloc_check :: IO AVFrame -- | Allocate new buffer(s) for audio or video data with the required -- alignment. Note, for video frames, pixel format, width, and -- height must be set before calling this function. For audio -- frames, sample format, nb_samples, and -- channel_layout must be set. frame_get_buffer_check :: AVFrame -> CInt -> IO () -- | Bytes-per-pixel for an AVPixelFormat avPixelStride :: AVPixelFormat -> Maybe Int -- | Return line size alignment. lineSizeAlign :: CInt -> CInt -- | Retun AVFrames line size. frameLineSize :: AVFrame -> IO (Maybe CInt) -- | Transformer version of frameLineSize. frameLineSizeT :: AVFrame -> MaybeT IO CInt frameAlign :: AVFrame -> IO (Maybe CInt) frameAlignT :: AVFrame -> MaybeT IO CInt -- | Return size of buffer for AVFrames image. frameBufferSize :: AVFrame -> IO (Maybe CInt) -- | Transformer version of frameBufferSize. frameBufferSizeT :: AVFrame -> MaybeT IO CInt -- | Copy AVFrames image to buffer. It is assumed that size of -- buffer is equal to -- --
--   bufSize <- fromJust <$> frameBufferSize frame.
--   
frameCopyToBuffer :: AVFrame -> Ptr CUChar -> IO (Maybe CInt) -- | Transformer version of frameCopyToBuffer. frameCopyToBufferT :: AVFrame -> Ptr CUChar -> MaybeT IO CInt av_strerror :: CInt -> Ptr CChar -> CSize -> IO CInt stringError :: CInt -> IO String module Codec.FFmpeg.Scaler data ImageInfo ImageInfo :: CInt -> CInt -> AVPixelFormat -> ImageInfo [imgWidth] :: ImageInfo -> CInt [imgHeight] :: ImageInfo -> CInt [imgFormat] :: ImageInfo -> AVPixelFormat -- | swsInit srcInfo dstInfo alg initializations an -- SwsContext to scale and convert from srcInfo to -- dstInfo using the algorithm alg when scaling. swsInit :: ImageInfo -> ImageInfo -> SwsAlgorithm -> IO SwsContext -- | Obtain a context for converting the source to destination format. If -- the given context is already configured for the required conversion, -- it is returned. Otherwise, the given context is freed and a new, -- configured context is returned. See swsInit for a description -- of the arguments. swsReset :: SwsContext -> ImageInfo -> ImageInfo -> SwsAlgorithm -> IO SwsContext -- | A common interface required of arguments to swsScale (a higher -- level wrapper for the sws_scale function from -- libswscale). class SwsCompatible a swsPlanes :: SwsCompatible a => a -> (Ptr (Ptr CUChar) -> IO r) -> IO r swsStrides :: SwsCompatible a => a -> (Ptr CInt -> IO r) -> IO r sliceHeight :: SwsCompatible a => a -> (CInt -> IO r) -> IO r -- | Supplies a continuation with all components provided by the -- SwsCompatible class. withSws :: SwsCompatible a => a -> (Ptr (Ptr CUChar) -> Ptr CInt -> CInt -> IO r) -> IO r -- | swsScale ctx src dst scales the entire src image to -- dst using the previously initialized ctx. swsScale :: (SwsCompatible src, SwsCompatible dst) => SwsContext -> src -> dst -> IO CInt instance Codec.FFmpeg.Scaler.SwsCompatible Codec.FFmpeg.Types.AVFrame instance (Codec.Picture.Types.Pixel a, Foreign.Storable.Storable (Codec.Picture.Types.PixelBaseComponent a)) => Codec.FFmpeg.Scaler.SwsCompatible (Codec.Picture.Types.Image a) instance Codec.FFmpeg.Scaler.SwsCompatible (Codec.FFmpeg.Enums.AVPixelFormat, Codec.FFmpeg.Internal.Linear.V2 Foreign.C.Types.CInt, Data.Vector.Storable.Vector Foreign.C.Types.CUChar) -- | Video encoding API. Includes FFI declarations for the underlying -- FFmpeg functions, wrappers for these functions that wrap error -- condition checking, and high level Haskellized interfaces. -- -- Note: If you need to import this module, consider qualifying the -- import. module Codec.FFmpeg.Encode avcodec_find_encoder :: AVCodecID -> IO AVCodec avcodec_find_encoder_by_name :: CString -> IO AVCodec av_opt_set :: Ptr () -> CString -> CString -> CInt -> IO CInt avcodec_encode_video2 :: AVCodecContext -> AVPacket -> AVFrame -> Ptr CInt -> IO CInt av_image_alloc :: Ptr (Ptr CUChar) -> Ptr CInt -> CInt -> CInt -> AVPixelFormat -> CInt -> IO CInt av_freep :: Ptr (Ptr a) -> IO () av_guess_format :: CString -> CString -> CString -> IO AVOutputFormat avformat_alloc_output_context2 :: Ptr AVFormatContext -> AVOutputFormat -> CString -> CString -> IO CInt avformat_new_stream :: AVFormatContext -> AVCodec -> IO AVStream av_write_frame :: AVFormatContext -> AVPacket -> IO CInt av_interleaved_write_frame :: AVFormatContext -> AVPacket -> IO CInt avformat_write_header :: AVFormatContext -> Ptr AVDictionary -> IO CInt av_write_trailer :: AVFormatContext -> IO CInt avio_open :: Ptr AVIOContext -> CString -> AVIOFlag -> IO CInt avio_close :: AVIOContext -> IO CInt avformat_free_context :: AVFormatContext -> IO () av_image_fill_arrays :: Ptr (Ptr CUChar) -> Ptr CInt -> Ptr CUChar -> AVPixelFormat -> CInt -> CInt -> CInt -> IO CInt av_image_fill_linesizes :: Ptr CInt -> AVPixelFormat -> CInt -> IO CInt -- | Minimal parameters describing the desired video output. data EncodingParams EncodingParams :: CInt -> CInt -> Int -> Maybe AVCodecID -> Maybe AVPixelFormat -> String -> Maybe String -> EncodingParams [epWidth] :: EncodingParams -> CInt [epHeight] :: EncodingParams -> CInt [epFps] :: EncodingParams -> Int -- | If Nothing, then the codec is inferred from the output file -- name. If Just, then this codec is manually chosen. [epCodec] :: EncodingParams -> Maybe AVCodecID -- | If Nothing, automatically chose a pixel format based on the -- output codec. If Just, force the selected pixel format. [epPixelFormat] :: EncodingParams -> Maybe AVPixelFormat -- | Encoder-specific hints. For h264, the default preset is -- "medium" (other options are "fast", "slow", -- etc.). For the GIF codec, setting this to "dither" will -- enable dithering during the palettization process. This will improve -- image quality, but result in a larger file. [epPreset] :: EncodingParams -> String -- | FFmpeg muxer format name. If Nothing, tries to infer from the -- output file name. If Just, the string value should be the one -- available in ffmpeg -formats. [epFormatName] :: EncodingParams -> Maybe String -- | Use default parameters for a video of the given width and height, -- forcing the choice of the h264 encoder. defaultH264 :: CInt -> CInt -> EncodingParams -- | Use default parameters for a video of the given width and height. The -- output format is determined by the output file name. defaultParams :: CInt -> CInt -> EncodingParams -- | Determine if the bitwise intersection of two values is non-zero. checkFlag :: Bits a => a -> a -> Bool -- | Find and initialize the requested encoder, and add a video stream to -- the output container. initStream :: EncodingParams -> AVFormatContext -> IO (AVStream, AVCodecContext) -- | Initialize a temporary YUV frame of the same resolution as the output -- video stream. We well convert RGB frames using this frame as a -- destination before encoding the video frame. initTempFrame :: EncodingParams -> AVPixelFormat -> IO AVFrame -- | Allocate an output context inferring the codec from the given file -- name. allocOutputContext :: Maybe String -> FilePath -> IO AVFormatContext -- | Open the given file for writing. avio_open_check :: AVFormatContext -> String -> IO () -- | Close an open IO context. avio_close_check :: AVFormatContext -> IO () -- | Returns True if the AVPacket was updated with new output -- data; False otherwise. encode_video_check :: AVCodecContext -> AVPacket -> Maybe AVFrame -> IO Bool -- | Allocate the stream private data and write the stream header to an -- output media file. write_header_check :: AVFormatContext -> IO () -- | Write a packet to an output media file. write_frame_check :: AVFormatContext -> AVPacket -> IO () -- | Write the stream trailer to an output media file and free the private -- data. May only be called after a successful call to -- write_header_check. write_trailer_check :: AVFormatContext -> IO () -- | Quantize RGB24 pixels to the systematic RGB8 color palette. The image -- data has space for a palette appended to be compliant with -- av_image_fill_arrays's expectations. This is slow. palettizeRGB8 :: EncodingParams -> Vector CUChar -> Vector CUChar -- | High quality dithered, median cut palette using palettize. The -- result is packed such that the BGRA palette is laid out contiguously -- following the palettized image data. palettizeJuicy :: EncodingParams -> Vector CUChar -> Vector CUChar -- | Open a target file for writing a video stream. The function returned -- may be used to write image frames (specified by a pixel format, -- resolution, and pixel data). If this function is applied to -- Nothing, then the output stream is closed. Note that -- Nothing must be provided 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 only works if the source images are of -- the target resolution. frameWriter :: EncodingParams -> FilePath -> IO (Maybe (AVPixelFormat, V2 CInt, Vector CUChar) -> IO ()) -- | Open a target file for writing a video stream. The function returned -- may be used to write RGB images of the resolution given by the -- provided EncodingParams (i.e. the same resolution as the output -- video). If this function is applied to Nothing, then the output -- stream is closed. Note that Nothing must be provided to -- properly terminate video encoding. frameWriterRgb :: EncodingParams -> FilePath -> IO (Maybe (Vector CUChar) -> IO ()) -- | Video decoding API. Includes FFI declarations for the underlying -- FFmpeg functions, wrappers for these functions that wrap error -- condition checking, and high level Haskellized interfaces. module Codec.FFmpeg.Decode avformat_open_input :: Ptr AVFormatContext -> CString -> Ptr AVInputFormat -> Ptr AVDictionary -> IO CInt avformat_find_stream_info :: AVFormatContext -> Ptr () -> IO CInt av_find_best_stream :: AVFormatContext -> AVMediaType -> CInt -> CInt -> Ptr AVCodec -> CInt -> IO CInt avcodec_find_decoder :: AVCodecID -> IO AVCodec avcodec_find_decoder_by_name :: CString -> IO AVCodec avpicture_get_size :: AVPixelFormat -> CInt -> CInt -> IO CInt av_malloc :: CSize -> IO (Ptr ()) av_read_frame :: AVFormatContext -> AVPacket -> IO CInt decode_video :: AVCodecContext -> AVFrame -> Ptr CInt -> AVPacket -> IO CInt close_input :: Ptr AVFormatContext -> IO () av_dict_set :: Ptr AVDictionary -> CString -> CString -> CInt -> IO CInt av_find_input_format :: CString -> IO (Ptr AVInputFormat) av_format_set_video_codec :: AVFormatContext -> AVCodec -> IO () dictSet :: Ptr AVDictionary -> String -> String -> IO () -- | Open the first video input device enumerated by FFMPEG. openCamera :: (MonadIO m, MonadError String m) => String -> CameraConfig -> m AVFormatContext openInput :: (MonadIO m, MonadError String m) => InputSource -> m AVFormatContext -- | Open an input media file. openFile :: (MonadIO m, MonadError String m) => String -> m AVFormatContext -- | AVFrame is a superset of AVPicture, so we can upcast -- an AVFrame to an AVPicture. frameAsPicture :: AVFrame -> AVPicture -- | Find a codec given by name. findDecoder :: (MonadIO m, MonadError String m) => String -> m AVCodec -- | Read packets of a media file to get stream information. This is useful -- for file formats with no headers such as MPEG. checkStreams :: (MonadIO m, MonadError String m) => AVFormatContext -> m () -- | Searches for a video stream in an AVFormatContext. If one is -- found, returns the index of the stream in the container, and its -- associated AVCodecContext and AVCodec. findVideoStream :: (MonadIO m, MonadError String m) => AVFormatContext -> m (CInt, AVCodecContext, AVCodec, AVStream) -- | Find a registered decoder with a codec ID matching that found in the -- given AVCodecContext. getDecoder :: (MonadIO m, MonadError String m) => AVCodecContext -> m AVCodec -- | Initialize the given AVCodecContext to use the given -- AVCodec. **NOTE**: This function is not thread safe! openCodec :: (MonadIO m, MonadError String m) => AVCodecContext -> AVCodec -> m AVDictionary -- | Return the next frame of a stream. read_frame_check :: AVFormatContext -> AVPacket -> IO () -- | Read frames of the given AVPixelFormat from a video stream. frameReader :: (MonadIO m, MonadError String m) => AVPixelFormat -> InputSource -> m (IO (Maybe AVFrame), IO ()) -- | Read RGB frames with the result in the MaybeT transformer. -- --
--   frameReaderT = fmap (first MaybeT) . frameReader
--   
frameReaderT :: (Functor m, MonadIO m, MonadError String m) => InputSource -> m (MaybeT IO AVFrame, IO ()) -- | Read time stamped frames of the given AVPixelFormat from a -- video stream. Time is given in seconds from the start of the stream. frameReaderTime :: (MonadIO m, MonadError String m) => AVPixelFormat -> InputSource -> m (IO (Maybe (AVFrame, Double)), IO ()) -- | Read time stamped RGB frames with the result in the MaybeT -- transformer. -- --
--   frameReaderT = fmap (first MaybeT) . frameReader
--   
frameReaderTimeT :: (Functor m, MonadIO m, MonadError String m) => InputSource -> m (MaybeT IO (AVFrame, Double), IO ()) -- | Construct an action that gets the next available frame, and an action -- to release all resources associated with this video stream. prepareReader :: (MonadIO m, MonadError String m) => AVFormatContext -> CInt -> AVPixelFormat -> AVCodecContext -> m (IO (Maybe AVFrame), IO ()) module Codec.FFmpeg.Probe withAvFile :: (MonadMask m, MonadIO m) => String -> AvFormat m a -> m a nbStreams :: MonadIO m => AvFormat m Int formatName :: MonadIO m => AvFormat m String formatMetadata :: MonadIO m => AvFormat m AVDictionary duration :: MonadIO m => AvFormat m Int64 data AvStreamT m a withStream :: MonadIO m => Int -> AvStreamT (AvFormat m) a -> AvFormat m a codecContext :: MonadIO m => AvStreamT m (Maybe AVCodecContext) codecName :: MonadIO m => AVCodecContext -> AvStreamT m String codecMediaTypeName :: MonadIO m => AVCodecContext -> AvStreamT m String streamBitrate :: MonadIO m => AVCodecContext -> AvStreamT m Int streamMetadata :: MonadIO m => AvStreamT m AVDictionary codec :: MonadIO m => AVCodecContext -> AvStreamT m (Maybe AVCodec) -- | Gives the (width, height) of a video stream in pixels, not accounting -- for the pixel aspect ratio. streamImageSize :: MonadIO m => AVCodecContext -> AvStreamT m (Int, Int) dictFoldM_ :: MonadIO m => ((String, String) -> m ()) -> AVDictionary -> m () instance Control.Monad.Trans.Class.MonadTrans Codec.FFmpeg.Probe.AvStreamT instance GHC.Base.Monad m => Control.Monad.Reader.Class.MonadReader Codec.FFmpeg.Types.AVStream (Codec.FFmpeg.Probe.AvStreamT m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Codec.FFmpeg.Probe.AvStreamT m) instance GHC.Base.Monad m => GHC.Base.Monad (Codec.FFmpeg.Probe.AvStreamT m) instance GHC.Base.Functor m => GHC.Base.Functor (Codec.FFmpeg.Probe.AvStreamT m) instance GHC.Base.Applicative m => GHC.Base.Applicative (Codec.FFmpeg.Probe.AvStreamT m) instance Control.Monad.Trans.Class.MonadTrans Codec.FFmpeg.Probe.AvFormat instance GHC.Base.Monad m => Control.Monad.Reader.Class.MonadReader Codec.FFmpeg.Types.AVFormatContext (Codec.FFmpeg.Probe.AvFormat m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Codec.FFmpeg.Probe.AvFormat m) instance GHC.Base.Monad m => GHC.Base.Monad (Codec.FFmpeg.Probe.AvFormat m) instance GHC.Base.Functor m => GHC.Base.Functor (Codec.FFmpeg.Probe.AvFormat m) instance GHC.Base.Applicative m => GHC.Base.Applicative (Codec.FFmpeg.Probe.AvFormat m) -- | Convert between FFmpeg frames and JuicyPixels images. module Codec.FFmpeg.Juicy -- | Convert AVFrame to a Vector. frameToVector :: AVFrame -> IO (Maybe (Vector CUChar)) -- | Convert AVFrame to a Vector with the result in the -- MaybeT transformer. frameToVectorT :: AVFrame -> MaybeT IO (Vector CUChar) -- | Convert an AVFrame to a DynamicImage with the result in -- the MaybeT transformer. -- --
--   toJuicyT = MaybeT . toJuicy
--   
toJuicyT :: AVFrame -> MaybeT IO DynamicImage -- | Convert an AVFrame to a DynamicImage. toJuicy :: AVFrame -> IO (Maybe DynamicImage) -- | Convert an AVFrame to an Image. toJuicyImage :: forall p. JuicyPixelFormat p => AVFrame -> IO (Maybe (Image p)) -- | Save an AVFrame to a PNG file on disk assuming the frame could -- be converted to a DynamicImage using toJuicy. saveJuicy :: FilePath -> AVFrame -> IO () -- | Mapping of JuicyPixels pixel types to FFmpeg pixel formats. class Pixel a => JuicyPixelFormat a juicyPixelFormat :: JuicyPixelFormat a => proxy a -> AVPixelFormat -- | Bytes-per-pixel for a JuicyPixels Pixel type. juicyPixelStride :: forall a proxy. Pixel a => proxy a -> Int -- | Read frames from a video stream. imageReaderT :: forall m p. (Functor m, MonadIO m, MonadError String m, JuicyPixelFormat p) => InputSource -> m (IO (Maybe (Image p)), IO ()) -- | Read frames from a video stream. Errors are thrown as -- IOExceptions. imageReader :: JuicyPixelFormat p => InputSource -> IO (IO (Maybe (Image p)), IO ()) -- | Read time stamped frames from a video stream. Time is given in seconds -- from the start of the stream. imageReaderTimeT :: forall m p. (Functor m, MonadIO m, MonadError String m, JuicyPixelFormat p) => InputSource -> m (IO (Maybe (Image p, Double)), IO ()) -- | Read time stamped frames from a video stream. Time is given in seconds -- from the start of the stream. Errors are thrown as -- IOExceptions. imageReaderTime :: JuicyPixelFormat p => InputSource -> IO (IO (Maybe (Image p, Double)), IO ()) -- | 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. imageWriter :: forall p. JuicyPixelFormat p => EncodingParams -> FilePath -> IO (Maybe (Image p) -> IO ()) instance Codec.FFmpeg.Juicy.JuicyPixelFormat Codec.Picture.Types.Pixel8 instance Codec.FFmpeg.Juicy.JuicyPixelFormat Codec.Picture.Types.PixelRGB8 instance Codec.FFmpeg.Juicy.JuicyPixelFormat Codec.Picture.Types.PixelRGBA8 -- | Interface to initialize FFmpeg, decode video files, encode video -- files, and convert decoded image frames to JuicyPixels images. module Codec.FFmpeg -- | Initialize FFmpeg by registering all known codecs. This must be -- called before using other FFmpeg functions. The debug level is -- initially set to quiet. If you would like the standard ffmpeg -- debug level, call setLogLevel avLogInfo after -- initFFmpeg. initFFmpeg :: IO () -- | Log output is sent to stderr. setLogLevel :: LogLevel -> IO () -- | Read frames from a video stream. Errors are thrown as -- IOExceptions. imageReader :: JuicyPixelFormat p => InputSource -> IO (IO (Maybe (Image p)), IO ()) -- | Read time stamped frames from a video stream. Time is given in seconds -- from the start of the stream. Errors are thrown as -- IOExceptions. imageReaderTime :: JuicyPixelFormat p => InputSource -> IO (IO (Maybe (Image p, Double)), IO ()) -- | Read frames from a video stream. imageReaderT :: forall m p. (Functor m, MonadIO m, MonadError String m, JuicyPixelFormat p) => InputSource -> m (IO (Maybe (Image p)), IO ()) -- | Read time stamped frames from a video stream. Time is given in seconds -- from the start of the stream. imageReaderTimeT :: forall m p. (Functor m, MonadIO m, MonadError String m, JuicyPixelFormat p) => InputSource -> m (IO (Maybe (Image p, Double)), IO ()) -- | Minimal parameters describing the desired video output. data EncodingParams EncodingParams :: CInt -> CInt -> Int -> Maybe AVCodecID -> Maybe AVPixelFormat -> String -> Maybe String -> EncodingParams [epWidth] :: EncodingParams -> CInt [epHeight] :: EncodingParams -> CInt [epFps] :: EncodingParams -> Int -- | If Nothing, then the codec is inferred from the output file -- name. If Just, then this codec is manually chosen. [epCodec] :: EncodingParams -> Maybe AVCodecID -- | If Nothing, automatically chose a pixel format based on the -- output codec. If Just, force the selected pixel format. [epPixelFormat] :: EncodingParams -> Maybe AVPixelFormat -- | Encoder-specific hints. For h264, the default preset is -- "medium" (other options are "fast", "slow", -- etc.). For the GIF codec, setting this to "dither" will -- enable dithering during the palettization process. This will improve -- image quality, but result in a larger file. [epPreset] :: EncodingParams -> String -- | FFmpeg muxer format name. If Nothing, tries to infer from the -- output file name. If Just, the string value should be the one -- available in ffmpeg -formats. [epFormatName] :: EncodingParams -> Maybe String -- | Use default parameters for a video of the given width and height. The -- output format is determined by the output file name. defaultParams :: CInt -> CInt -> EncodingParams -- | 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. imageWriter :: forall p. JuicyPixelFormat p => EncodingParams -> FilePath -> IO (Maybe (Image p) -> IO ())