Cap icon indicating copy to clipboard operation
Cap copied to clipboard

MP4 to MP3 converter saves a WAV file named .mp3

Open patrickballard opened this issue 1 month ago • 1 comments

Description

https://cap.so/tools/convert/mp4-to-mp3 offers "Download MP3", but the file it saves is uncompressed WAV audio with an .mp3 name. extractAudioFromVideo in apps/web/components/tools/MediaFormatConverter.tsx asks Remotion's convertMedia for container: "wav", and the download keeps the .mp3 extension.

Converting a 3-second MP4 (H.264 + AAC, 48 kHz stereo) on cap.so today:

download name tone-test.mp3
blob type audio/wav
contents RIFF/WAVE, 16-bit PCM, 48 kHz stereo, 569,388 bytes
  • The file is several times the size of an MP3 of the same audio (4.7× the 320 kbps MP3 in the PR below).
  • Software that goes by the extension can't open it: on macOS, afinfo fails with AudioFileOpenURL failed on a WAV named .mp3.
  • A video with no audio track "converts" to a 44-byte empty WAV, and the page still shows "Conversion complete!" and "Download MP3".

#3044 noted the WAV-versus-MP3 mismatch as outside its scope.

Reproduction

  1. Open https://cap.so/tools/convert/mp4-to-mp3 and convert an MP4 with audio.
  2. Click Download MP3 and run file on the download: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz.

I've opened a PR that fixes this; it's linked below.

patrickballard avatar Oct 26 '26 19:10 patrickballard

CAP-939

linear[bot] avatar Oct 26 '26 19:10 linear[bot]