Gstreamer audio file output duration can't be read by any player

I’ve got following pipeline. During the execution of the pipeline g streamer correctly reports the duration of the video, but when i try to open test.mp3 with VLC the duration just jumps around.

Elisa just show wrong duration about 5x the original, the same with dolphin file explorer under properties -> Details.

gst-launch-1.0 -e souphttpsrc location="$(yt-dlp --format "worst[ext=mp4]" --get-url some_url)" ! decodebin ! audioconvert ! lamemp3enc ! filesink location=./test.mp3

How can i fix it?

Two options:

  1. use lamemp3enc cbr=true
  2. use lamemp3enc ! xingmux ! filesink ..