Link an audio file to QTM by using FFmpeg

It is possible to include a video as part of a recording performed from the MoCap system on QTM. However, sometimes we need to record high-quality audio independently from QTM. Assuming that an audio file was recorded externally and synchronized properly in the process, we can link this file by converting it into a compatible video, which can be done via the FFmpeg tool.

QTM allows to link a .avi video file to a recording. For doing that you have to go to File -> Import -> Link to Video File...

Since it only accepts .avi files, when we need to link an audio file it has to be converted from its sound format to .avi video format. For this conversion we can use the tool FFmpeg. You can get this command-line tool from here. Moreover, Alexander Jensenius has a collection of tutorials for several use cases for this tool on his blog.

For this specific case, (assuming that the tool is installed and is to be run from a terminal) we can use the next example followed by the explanation and an additional resource (a black image).

ffmpeg -i image.jpg -i input.wav -ar 44100 -acodec pcm_s16le output.avi

 "input.wav" corresponds to the audio file that has to be converted, it can have a different format apart from .wav, it depends of what was recorded. "output.avi" is the resulting output video that will be linked to QTM. "image.jpg" is a black image that complements the graphic part of the .avi file, it can be downloaded from here. It is assumed that the command is executed in the same folder where these files are, and the output will be put in this same folder, otherwise, you can specify a full path for every of these parameters. 

Other parameters in this command are needed to have a compatible file with QTM. After trial and error tests, we figured out issues that avoid a proper link, for instance, even that FFmpeg allows to convert audio to a video file without an image, for QTM it is needed to have such graphic component, that is why we provide the black image, but you can replace this file with any other if necessary.

Sample rate and bit depth should be 44.1 kHz and 16-bits since with other formats you could experience audio noise in QTM, this is included in the command with the parameters '-ar' and '-acoded'.

A know issue is that the audio is not played on QTM through a virtual machine after the link, so try to perform this process in an actual PC.

Published Aug. 18, 2022 11:09 AM - Last modified Aug. 18, 2022 11:09 AM