Skip to content

Instantly share code, notes, and snippets.

@byeblogs
Last active May 25, 2021 11:37
Show Gist options
  • Save byeblogs/434c450e769e87b567d6d4fc542f68b6 to your computer and use it in GitHub Desktop.
Save byeblogs/434c450e769e87b567d6d4fc542f68b6 to your computer and use it in GitHub Desktop.
Ffmpeg Screen Recorder
I've done. Get an impressive result for what is free.
So I think it'd be useful to share with people here.
Please note that I'm no expert in ffmpeg. I just looking at the link Marco gave me then do a bit more explore.
Install ffmpeg, in my case, Mac OS X, I install via brew
# brew install ffmpeg
Looking for my device id, audio, video
In my case, there were [1] and [1] and it is depend on your setting.
# ffmpeg -f avfoundation -list_devices true -i ""
Start recording audio + video
# ffmpeg -video_size 1440x900 -framerate 30 -f avfoundation -i 1:1 -ac 2 -vcodec libx264 -crf 0 -preset ultrafast -acodec pcm_s16le ~/Desktop/uncompressed.mkv
For my Macbook Pro , I was recording video only since audio quality is not good. So leave -i 1:_ for no audio device.
# ffmpeg -video_size 1440x900 -framerate 30 -f avfoundation -i 1: -ac 2 -vcodec libx264 -crf 0 -preset ultrafast -acodec pcm_s16le ~/Desktop/uncompressed.mkv
Then compress it again from .mkv to .mp4 or any codecs you may need
This step I'm feeling it is slower than other compressor. so it may be helpful to find yourself some video converter app.
# ffmpeg -i ~/Desktop/uncompressed.mkv -acodec mp3 -vcodec h264 ~/Desktop/final.mp4
If you may need to see your ffmpeg app come with which codecs
# ffmpeg -codecs
So, hope this may be helpful for other surfers. :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment