Wiki

Clone wiki

Pianofall / Creating_a_video_with_FFmpeg

Creating a video with FFmpeg

Pianofall prerender mode outputs a PNG image sequence. To create a video you have to use a video editor or an utility that can convert the sequence to singe file.

This is quick tutorial how to create a video file with FFmpeg.

  1. Download FFmpeg.
  2. Open cmd.exe.
  3. Write:
[ffmpeg.exe] -y -framerate 60 -i [Output folder]\img%05d.png -f f32le -ar 22050 -channels 2 -i [Output folder]\audio.raw -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -c:v libx264 -crf 16 -r 60 -pix_fmt yuv420p -c:a flac -q 0 !out.mkv

Where:

  • [ffmpeg.exe] - path to your ffmpeg.exe

  • [Output folder] - Pianofal output folder path with image sequence and raw audio.

  • -crf 16 - video quality. 0 - lossless (huge file). 51 - bad quality (small file).

  • !out.mkv path to result video file.

After filling paths you can also save the command to .bat file and run it every time you need to create a video.

(If you decide to save .bat file, replace img%05d.png to img%%05d.png, because % is the escape character in bat files.)

Tip

If you copy FFmpeg.exe to the output folder and open cmd from that folder, you can just use next command as is without specifying full paths:

ffmpeg.exe -y -framerate 60 -i img%05d.png -f f32le -ar 22050 -channels 2 -i audio.raw -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -c:v libx264 -crf 16 -r 60 -pix_fmt yuv420p -c:a flac -q 0 !out.mkv

Project0234.gif

Updated