SIGN IN SIGN UP
mifi / lossless-cut UNCLAIMED

The swiss army knife of lossless video/audio editing

0 0 32 TypeScript

feat: add lossless crop, rotate & aspect ratio via bitstream metadata (#643)

Implements lossless video transformation via codec bitstream filters:

- H.264: h264_metadata (crop_left/right/top/bottom, sample_aspect_ratio)
- HEVC: hevc_metadata (crop_left/right/top/bottom, sample_aspect_ratio)
- Other codecs: container-level -aspect flag fallback

Changes:
- types.ts: Add BsfCropParams, BsfAspectRatioParams interfaces and
  bsfCrop/bsfAspectRatio fields to StreamParams
- useFfmpegOperations.ts: Inject crop and SAR bitstream filters into
  the existing customParamsArgs() pipeline, with codec auto-detection
- StreamsSelector.tsx: Add lossless crop UI (4 number inputs for
  left/right/top/bottom) and aspect ratio UI (num:den) to the stream
  parameters editor, with codec compatibility detection and VLC warning

No re-encoding required - uses -codec copy with -bsf:v metadata injection.
Tested compatible with mpv, MPC-HC, Firefox, ffplay, Microsoft Photos.
Known issue: VLC has a bug interpreting H.264 crop metadata (VLC #27382).
B
Bala Vignesh S committed
2b9654bad98cc1d89a9d3ee54ab43c853ae0ea5b
Parent: 260405e