Skip to content

Commit

Permalink
Add example to README
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthi-chaud committed Jul 1, 2024
1 parent b53283e commit bd273f8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to the
[Haskell Package Versioning Policy](https://pvp.haskell.org/).

## Unreleased
## 0.1.0.0 - 2024-07-01

## 0.1.0.0 - YYYY-MM-DD
First release!
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# haskell-ffprobe

This package provides Haskell bindings for the `ffprobe` command.

## Example

```haskell
import FFProbe
import FFProbe.Data.Format (duration, formatName)
import FFProbe.Data.Stream (codecLongName)
import System.Environment

main :: IO ()
main = do
fileName:_ <- getArgs
ffprobeRes <- ffprobe fileName
case ffprobeRes of
Left err -> putStrLn $ "An error occured: " ++ err
Right ffprobeData -> do
print $ formatName (format ffprobeData)
print $ duration (format ffprobeData)
print $ length (chapters ffprobeData)
print $ codecLongName $ head (streams ffprobeData)
```

0 comments on commit bd273f8

Please sign in to comment.