Skip to content

Add .mts (AVCHD), .m2ts (Blu-ray), and AVCHD-ZIP input support#665

Open
EdmundLimBoEn wants to merge 2 commits into
p2r3:masterfrom
EdmundLimBoEn:add-mts-m2ts-support
Open

Add .mts (AVCHD), .m2ts (Blu-ray), and AVCHD-ZIP input support#665
EdmundLimBoEn wants to merge 2 commits into
p2r3:masterfrom
EdmundLimBoEn:add-mts-m2ts-support

Conversation

@EdmundLimBoEn
Copy link
Copy Markdown

@EdmundLimBoEn EdmundLimBoEn commented May 28, 2026

Summary

Three related additions that make AVCHD camcorder footage (JVC, Sony, Panasonic) and Blu-ray rips fully usable in the converter:

  • MTS support — FFmpeg auto-discovers mpegts but assigns the .ts extension. .mts files from AVCHD camcorders go unrecognised. A manual format entry (same pattern as .wmvasf) maps mts to the mpegts demuxer.
  • M2TS support — same container, different extension used by Blu-ray BDMV rips.
  • AVCHD ZIP extractor (src/handlers/avchd.ts) — on macOS, dragging an AVCHD folder into a browser silently zips the entire package. Users end up uploading a .zip wrapping BDMV/STREAM/*.mts instead of the files directly. This new handler uses JSZip (already a dependency) to unpack any such ZIP, collect all .mts/.m2ts entries regardless of nesting depth, and emit them as FileData so the graph routes them to FFmpeg. Conversion path: ZIP → MTS → (any video format).

Test plan

  • Upload a .mts file directly — should be recognised as "MTS – AVCHD Video" and convert to MP4/WebM/etc.
  • Upload a .m2ts file — same
  • Zip an AVCHD folder (PRIVATE/AVCHD/BDMV/STREAM/…) and upload the ZIP — should be recognised and the MTS files extracted for conversion
  • .ts files still work (no regression on auto-discovered mpegts entry)
  • Other FFmpeg formats unaffected

Notes

I used Claude Code to help write and test this PR. I understand all changes: two push() calls in the FFmpeg fine-tuning section (identical in structure to existing .wmv/.qta entries), and one new handler file using JSZip. Tested locally with a real JVC GZ-E600-N .mts file — the format was correctly identified and selected in the UI.

🤖 Generated with Claude Code

EdmundLimBoEn and others added 2 commits May 28, 2026 12:57
FFmpeg's format auto-discovery maps the mpegts demuxer to the ".ts"
extension. This leaves .mts files (AVCHD camcorders: JVC, Sony,
Panasonic) and .m2ts files (Blu-ray BDMV) unrecognised by the handler,
even though FFmpeg can already decode them perfectly.

Follows the same pattern used for .wmv (maps to "asf") and .qta (maps
to "mov"): push explicit format entries with the correct extension and
MIME type (video/mp2t) that delegate to the existing mpegts demuxer.

Both formats are input-only (to: false) — converting TO AVCHD transport
streams is an unusual workflow and the mpegts muxer entry already covers
it via the auto-discovered ".ts" entry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On macOS, dragging an AVCHD folder into a browser silently zips the
entire package. Users end up uploading a .zip that wraps the BDMV/
STREAM/*.mts file tree rather than the .mts files directly.

This new handler unpacks such a ZIP with JSZip, collects every .mts /
.m2ts entry (regardless of nesting depth), and emits them as FileData
so the graph can route them onward to FFmpeg for conversion.

Conversion path added:  ZIP (avchd-zip) → MTS → (any video format via FFmpeg)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant