acowley / ffmpeg-light

Minimal Haskell bindings to the FFmpeg library
BSD 3-Clause "New" or "Revised" License
67 stars 29 forks source link

Allow reading from stdin and sockets #36

Open oshyshko opened 7 years ago

oshyshko commented 7 years ago

I'd like to use imageReader to get frames from stdin.

Perhaps, a generic way of reading from any System.IO.Handle would be even better.

Maybe, something like this:

import System.IO (Handle)

data InputSource = File FilePath
                 | Camera String CameraConfig
                 | InputHandle Handle
                 deriving (Eq, Show) -- System.IO.Handle doesn't have instances for Read and Ord

Or is there another way to read from stdin?