#
#  MicroHH
#  Copyright (c) 2011-2024 Chiel van Heerwaarden
#  Copyright (c) 2011-2024 Thijs Heus
#  Copyright (c) 2014-2024 Bart van Stratum
#
#  This file is part of MicroHH
#
#  MicroHH is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  MicroHH is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with MicroHH.  If not, see <http://www.gnu.org/licenses/>.
#
# use H.264 compression to create very high quality and small file size movies 
# (use "avconv" as the executable name in case libav is installed instead of ffmpeg). 
# framerate is the fps of the movie
# r is the number of frames per second in the output, leading to duplicates in case framerate < r
#
# ONE PASS FILTERING (aim for constant quality)
# crf is quality (0 is lossless, 15 is very good, 23 is standard)
ffmpeg -framerate 15 -i figs/frame.%05d.png -s:v 1280x720 -c:v libx264 \
  -profile:v high -crf 15 -pix_fmt yuv420p -r 25 movie.mp4

# TWO PASS FILTERING (aim for constant bitrate)
# b:v is the bitrate (for high quality use 10000k for 720p and 16000k for 1080p)
# ffmpeg -framerate 15 -i figs/frame.%05d.png -pass 1 -s:v 1280x720 -c:v libx264 \
#   -profile:v high -b:v 10000k -pix_fmt yuv420p -r 25 -f mp4 -y /dev/null
# ffmpeg -framerate 15 -i figs/frame.%05d.png -pass 2 -s:v 1280x720 -c:v libx264 \
#   -profile:v high -b:v 10000k -pix_fmt yuv420p -r 25 movie.mp4
