I am using nginx to serve .mp3
and .ogg
files. The article Configuring servers for Ogg media suggests to add the X-Content-Duration
header when serving .ogg
files to avoid that the browser has to seek in order to determine the audio length.
Oggz is able to compute the length of an .ogg
audio file.
How can I configure nginx to automatically invoke Oggz to compute the length of the audio, cache it, and add it to the headers when serving the file?
I would use Lua and would try to avoid a shell call by using lua itself to parse the ogg headers.