Skip to main content

How to add waveforms

Waveforms are displayed in the timeline in Accurate.Video to make it easy to navigate based on audio contents.

Timeline waveforms

Generating waveforms

We currently support waveform files generated with audiowaveform by BBC. The program can generate waveform data files in binary or JSON format.

This is an example that generates waveform data in binary format for each individual channel of the first track of a mp4 file:

ffmpeg -i example.mp4 -map a:0 -f wav - | audiowaveform --input-format wav --output-format dat --zoom 128 --bits 8 --split-channels > waveform.dat
info

Read the documentation of audiowaveform for a full explanation of the options.

The waveform file is added to the launch template using the type WAVEFORM. The source video is included in the example below to exemplify how to use waveform:source_file_id:

{
"data": {
"assets": [
{
"files": [
{
"id": "VIDEO-1",
"type": "VIDEO",
"url": "https://example.com/example.mp4"
},
{
"type": "WAVEFORM",
"url": "https://example.com/waveform.dat",
"metadata": [
{
"key": "waveform:source_file_id",
"value": "VIDEO-1"
},
{
"key": "waveform:track",
"value": "0"
}
]
}
]
}
]
}
}

See Launch Template Format for more details.