[FFmpeg-user] Reading Tempo/BPM information from audio files

Moritz Barsnick barsnick at gmx.net
Tue Sep 18 10:59:03 EEST 2018


On Mon, Sep 17, 2018 at 15:19:50 +0100, Adam Harries wrote:
> After some more digging, it seems that I need to set some options while
> decoding a mov file - at least from reading
> https://ffmpeg.org/doxygen/trunk/mov_8c_source.html
> 
> How would I go about doing this? I'm happy to build a new application based
> on libavformat, but I'm not sure how to interface with it cleanly.

As far as I can tell from a quick glance, MP4/M4A stores the BPM number
in the "tmpo" atom. libavformat/movenc.c has the capability to *write*
this atom (I'm not sure ffmpeg makes any effort to convert "BPM" to
"tmpo" anywhere though), but I don't see any code for *reading* the
atom. I may misunderstand the way the MOV demuxer works though...

With some code fiddling, I managed to make libavformat/mov.c recognize
the atom (mov_read_udta_string()), but didn't manage to decode it (with
the very little effort I put into it).

Cheers,
Moritz


More information about the ffmpeg-user mailing list