cytopia / ffscreencast

ffscreencast - ffmpeg screencast/desktop-recording with video overlay and multi monitor support
MIT License
1.77k stars 76 forks source link

Post record optimisation #11

Open cdplayer opened 7 years ago

cdplayer commented 7 years ago

From personal experience it's a tall ask to record in one step on low performance computers. Suggest add option to post-optimise the original 'uncompressed' file recorded Here is what is used (...before finding ffscreencast)

#my 60 second test record ffmpeg -f x11grab -framerate 20 -video_size 640X480 -i :0.0 -c:v libx264rgb -pix_fmt rgb24 -tune animation -crf 0 -preset ultrafast -t 60 raw.mp4

one minute is about 16mb

#my_ re-compress, oddly -crf 35 still looks good. ffmpeg -i raw.mp4 -c:v libx264rgb -r 10 -preset veryslow -crf 35 -tune animation -movflags faststart compressed.mp4

cytopia commented 7 years ago

Hi @cdplayer ,

thanks for the input. I am still trying to find the best balance between compression (size) and performance on old cpu's.

However, when you want to adjust the way it records, you can simply use --sargs and --oargs. To verify your command without executing it, simply add --dry (which will only show what would be executed).

I could almost mimic your command with the exception of the resolution as this is auto-picked according to your screen resolution.

$ ffscreencast --oargs="-pix_fmt rgb24 -tune animation -crf 0 -preset ultrafast -t 60" \
--sargs="-framerate 20" --dry

/usr/local/bin/ffmpeg -hide_banner -loglevel info -thread_queue_size 512 \
-f avfoundation -video_size 2880x1800 -framerate 20 -i "1" -c:v libx264 \
-pix_fmt rgb24 -tune animation -crf 0 -preset ultrafast -t 60 -threads 0 \
"/Users/cytopia/Desktop/Screencast 2016-08-26 at 21.48.55.mkv"

Also note that you can add your presets to ~/.config/ffscreencast/ffscreencastrc so you can start it without any arguments and it will use the defined defaults.

Post processing is a neat topic as well, however i would not integrate it, but separate it into a different tool, which could output videos based on presets, including nice gif versions.

cdplayer commented 7 years ago

Things i've found

cytopia commented 7 years ago

So I would suggest we pick a couple of potential defaults for initial recording, compile a nice way for benchmarking them on different machines and ask people to help collect benchmark data on that.

Best would be to have a standalone Benchmark.md page with all results for different hardware. Once done I could integrate different presets into ffscreencast for easier recording.

Tasks that would still have to be done is

cytopia commented 7 years ago

@cdplayer I added some post-processing scripts in contrib/ via #19