Skip to content

feat: MP4 and M4A file upload support #209

@thcp

Description

@thcp

Summary

Add support for uploading MP4 (video) and M4A (audio) files for stem separation.

Why

Users want to drop a music video or downloaded M4A track directly without converting to MP3/WAV first. ffmpeg already handles the transcode step in the pipeline -- MP4/M4A support is essentially free.

What changes

  • app/api/jobs.py -- add .mp4 and .m4a to _ALLOWED_EXTS; raise _MAX_UPLOAD_BYTES from 100 MB to 400 MB (covers 4-min 1080p music video); add post-transcode duration check to catch oversized video files that slip under the size limit
  • static/js/main.js -- add .mp4, .m4a to client-side extension check
  • static/index.html -- add .mp4,.m4a,video/mp4 to file input accept attribute
  • Error messages updated to include the new formats

What does NOT change

The pipeline itself is unchanged. ffmpeg already extracts the audio stream from MP4 and discards video automatically -- no new flags needed.

Size rationale

Format Typical 4-min size
MP3 (320kbps) ~10 MB
FLAC ~20-30 MB
WAV (CD quality) ~40 MB
MP4 (1080p) up to ~400 MB

400 MB covers all formats. A 400 MB WAV would be ~45 min of audio and would be rejected by the existing duration check anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions