Skip to content

Transcode recordings from WebM to MP3 via ffmpeg #24

Description

@AevumDecessus

Summary

Server-side transcode uploaded WebM/Opus recordings to MP3 for playback compatibility on older devices that do not support WebM (pre-2021 iOS, legacy browsers).

Requirements

  • ffmpeg as system dependency in Docker image
  • Transcode WebM/Opus to MP3 (128kbps mono)
  • Extract duration via ffprobe if not already set
  • Store MP3 alongside or replacing the original WebM
  • Clean up source WebM after successful transcode (optional, could keep both)

Technical notes

  • Can run synchronously on upload for simplicity, or as a background task if performance is a concern
  • ffmpeg command: ffmpeg -i input.webm -ac 1 -ab 128k -f mp3 output.mp3
  • Duration extraction: ffprobe -v quiet -show_entries format=duration -of csv=p=0 output.mp3
  • Playback view would need to serve the MP3 instead of (or alongside) the WebM

Context

WebM/Opus has broad support in 2026 browsers (Chrome, Firefox, Edge, Safari 14.1+). This is a fallback for edge cases like older donated hospital devices. Not required for MVP launch.

Acceptance criteria

  • ffmpeg added to Docker image
  • Transcoded MP3 created after upload
  • Duration extracted and saved to model
  • Playback view serves compatible format

Metadata

Metadata

Assignees

No one assigned

    Labels

    non-mvpEnhancement deferred past MVP

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions