I keep getting mp3 audio files with the wrong duration

We use Egress to record mp3 audio files into Azure storage, and serve them directly on the web, so no copying or any other kind of pipeline is used.
The length of the audio displayed vs. what gets played is often wrong.

When I attempt to open the raw file in VLC, I see the duration change as the audio playback progresses.

AI suggests this issue is typically caused by missing or inaccurate duration metadata in VBR-encoded MP3 files

Is this a known issue, and how to resolve it?

Thank you!

Are you sure you are getting mp3 or do you mean mp4 video files?

Yes, I am referring to mp3.
audio_only=True,
file_type=EncodedFileType.MP3
filepath=”{filename}.mp3”

I admit my egress knowledge is not great but I did not think we supported mp3 I thought we only supported ogg for audio output.

Yes, its’s been supported since Egress 1.11.0

Hey @Bilal_K - thanks for reporting the issue. I will take a look and get back to you.

It would also be very helpful - if you can reproduce it and share the mp3 file that exhibits this behavior.

Hey Milos, how can I share a file with you?

Hey @Bilal_K - I managed to reproduce it it with VLC player - no need for file sharing - fix will likely be available in the next egress release. Will let you know once it’s available. Are you using cloud or hosting egress yourself?

I am glad you were able to reproduce it.
We’re self-hosting right now, with plans to move to the cloud in the coming weeks.
Is there an ETA? for when we get the new Egress version with this fix?

Thank you!

I have already merged the PR: Fix MP3 duration metadata and CBR encoding by milos-lk · Pull Request #1187 · livekit/egress · GitHub

The fix will likely be deployed to cloud during this week. We don’t have yet scheduled date for OSS release. That will also follow in coming weeks.