linkedin / LiTr

Lightweight hardware accelerated video/audio transcoder for Android.
BSD 2-Clause "Simplified" License
612 stars 85 forks source link

Expose more Utility Functions from MediaTransformer #238

Open timcreatedit opened 1 year ago

timcreatedit commented 1 year ago

MediaTransformer does a really nice job of being very simple to use when you're first getting started. Once you want advanced functionality however, you are faced with creating your own MediaTarget, MediaFormat, TrackTransforms etc.

There's a lot of nice logic in LiTr that has been written to do exactly that, but a lot of it is private, even if it doesn't have any side effects. When building my own more custom transformer, I found myself copying logic from MediaTransformer (createTargetMediaFormat, isAudioIncompatible, ...) constantly.

I think there is a big opportunity to make LiTr more approachable by exposing more of the Utility that is hidden away inside. Dealing with MediaFormats is both a daunting task for beginners, but also very essential in a lot of cases, so I assume a lot of users would benefit from improving the usability in that regard :)

A first step would be opening up some of the functions that are already there, but on top of that, more utility functions could still be written

izzytwosheds commented 1 year ago

This is an excellent suggestion! I have been thinking about writing some helper methods for MediaFormat creation - things like typical resolutions/aspect ratios, etc. But I didn't think about exposing some internal util methods. Any specific functionality you would want to see exposed?