04-14-2023, 07:38 AM
To ensure videos are compatible with Experiment Builder, they must have the same resolution as your project and be in a supported file format. If your video or audio files don't meet these requirements, you can use any number of third party video editing/conversion tools to preformat the video stimuli.
FFmepg, a free, open-source command-line tool, is one tool that we can recommend to convert them. FFmpeg is a powerful tool for Windows, macOS, and Linux that can perform several useful conversions, such as:
Using FFmpeg for Common Conversions
To use FFmpeg, first open the Command Prompt (on Windows) or Terminal (on macOS/Linux) and navigate to the folder containing your media files.
For example, if your files are in a folder named Files_to_Convert on your desktop, you would use the cd (change directory) command:
You can use different options, known as flags, to tell FFmpeg exactly how to convert your file. A single command can combine multiple flags to perform several operations at once.
Full documentation on all available commands can be found on the FFmpeg webiste.
The following example shows how to convert a file named input.mov into output.mp4 by applying multiple changes simultaneously. This single command will:
The following is a breakdown of each component of the command above:
FFmepg, a free, open-source command-line tool, is one tool that we can recommend to convert them. FFmpeg is a powerful tool for Windows, macOS, and Linux that can perform several useful conversions, such as:
- Resize a video's resolution (e.g., from 4K UHD to 1920x1080 HD).
- Change a video's file type or codec (e.g., from .mov to .mp4 or to the common H.264 codec).
- Adjust a video's frame rate (e.g., from a high frame rate to a standard 24 or 30 fps).
- Convert an audio file (e.g., MP3, AAC) into a 16-bit signed WAV file, which is required by Experiment Builder.
Using FFmpeg for Common Conversions
To use FFmpeg, first open the Command Prompt (on Windows) or Terminal (on macOS/Linux) and navigate to the folder containing your media files.
For example, if your files are in a folder named Files_to_Convert on your desktop, you would use the cd (change directory) command:
Code:
cd C:\Users\username\Desktop\Files_to_Convert
You can use different options, known as flags, to tell FFmpeg exactly how to convert your file. A single command can combine multiple flags to perform several operations at once.
Full documentation on all available commands can be found on the FFmpeg webiste.
The following example shows how to convert a file named input.mov into output.mp4 by applying multiple changes simultaneously. This single command will:
- Resize the video resolution to 1920x1080.
- Change the video frame rate to 24 fps.
- Convert the audio to a compatible format (16-bit PCM at a 48 kHz sample rate).
Code:
ffmpeg -i input.mov -vf "scale=1920:1080,fps=24" -c:a pcm_s16le -ar 48000 output.mp4
The following is a breakdown of each component of the command above:
- -i input.mov: Specifies the input file.
- -vf "scale=1920:1080,fps=24": Applies a chain of video filters. Multiple filters are placed inside quotes and separated by a comma.
- -c:a pcm_s16le: Sets the audio codec (c:a) to 16-bit signed PCM.
- -ar 48000: Sets the audio rate (sample rate) to 48000 Hz.
- output.mp4: Defines the name of the output file.