Skip to content

Instantly share code, notes, and snippets.

@shapr
Created May 25, 2022 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shapr/20bb48a22bee23fcc3118e579239176b to your computer and use it in GitHub Desktop.
Save shapr/20bb48a22bee23fcc3118e579239176b to your computer and use it in GitHub Desktop.
Haskell script to call ffmpeg
module Main where
import Data.Time.Clock
import Data.Time.Format
import Data.Time.Format.ISO8601
import System.Cmd
import System.Directory
main :: IO ()
main = do
now <- getCurrentTime
let cmd = makeCommand (iso8601Show now)
putStrLn $ "calling " <> cmd
exitCode <- system cmd
putStrLn $ "recording finished with exitcode " <> show exitCode
transcriptdir = "/home/shae/transcript"
-- only needs the filename
makeCommand name = "ffmpeg -video_size 3840x2160 -framerate 2 -f x11grab -i :0.0 -s 1920x1080 /home/shae/transcript/" <> name <> ".mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment