FAQ: How do I edit video and audio files using ffmpeg?
#1
To ensure that videos are compatible with Experiment Builder, they should be in the same resolution as the project and in a supported file format. If you need to resize a video, you can use ffmpeg, a free and open-source software that can easily adjust video properties. This tool can also convert any audio file (e.g. mp3, aac etc) into a supported 16-bit signed WAV file. You can download ffmpeg from their website at https://ffmpeg.org

This command-line tool is available for Windows, macOS, and Linux, and it offers powerful video and audio conversion capabilities. With this tool, you can easily resize videos, converting them from 4K UHD to HD, for instance. You can also change the codec or file type of a video, for example, converting from an obscure codec to h.264 or from .mov to .mp4. Additionally, the tool allows you to adjust the frame rate of a video, making it more suitable for different displays, such as reducing a high fps to a monitor refresh rate-friendly 24 or 30 fps. Finally, it can convert audio files into a supported format for Experiment Builder.

Download and Install ffmpeg
As ffmpeg is a command line tool (and not an application) installation typically involves a few steps.
This wikiHow entry provides a simple step-by-step guide: How to Install FFmpeg on Windows
This site provides some instruction for macOS users: Installing FFmpeg on Mac

Using ffmpeg and common conversions
  • To use ffmpeg, open command-prompt or terminal and set the directory to the folder which contains your video files. For example, a folder on the Desktop called 'Files_to_Convert'
       
    Code:
    # Use cd to set the directory to the folder that contains the videos to convert
    cd C:\Users\username\Desktop\Files_To_Convert

  • Change the video file type keeping the frame rate and size e.g. from .mov to .mp4
       
    Code:
    # The command format is 'ffmpeg -i <input filename> <output filename>'
    ffmpeg -i input.mov output.mp4

  • Change the frame rate to 24 frames per second (fps) and convert from .mov to .mp4
    Code:
    ffmpeg -i input.mov -filter:v fps=24 output.mp4

  • Change the size/resolution of a video and file type, e.g. from 3840*2160 .mov to 1920*1080 .mp4
    Code:
    ffmpeg -i input.mov -vf scale=1920:1080 output.mp4
    * Please note some caution is advised in scaling, see this post for more info https://trac.ffmpeg.org/wiki/Scaling

  • Convert any audio file into an Experiment Builder supported 16-Bit signed wav file with a 48 kHz sampling frequency
    Code:
    ffmpeg -i input.mp3 -acodec pcm_s16le -ar 48000 output.wav