linkedin / LiTr

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

change the aspect ratio #127

Open lee-ngeap opened 3 years ago

lee-ngeap commented 3 years ago

Hi How to change the aspect ratio for the portrait mode instead of using rotation tag?

izzytwosheds commented 3 years ago

I think you should be able to do this by configuring a target video (for example 720 wide, 1280 high , rotation 0) and by using a DefaultVideoFrameRenderFilter with a Transform to correctly rotate and place your source frame inside the target frame.

lee-ngeap commented 3 years ago

Hi izzy;

the sugeestion working good; however the aspect ratio is still the same 16:9. It change only from 1280x720 to 720x1820. what I'd like is changed from 16:9 to 9:16 since the apple HLS doe support only aspect ratio. I'd like to have it played in portraid mode Please see the link below.

http://streaming.snapkyu.com:1935/redirect/snapkyu_stagging/_definst_/mp4:amazons3_stagging/1627812293-610671c525a9f.mp4?scheme=m3u8

or Can you please suggest me something? we're using exo player.

@izzytwosheds

izzytwosheds commented 3 years ago

I am assuming you guys are doing some sort of processing on a backend to create HLS playlist/segments? LiTr can't transcode into HLS. You should be able to resize (and change bitrate) the video on-device using LiTr and then have your backend create HLS segments compatible with ExoPlayer. I presume, backend uses ffmpeg which is more powerful and flexible than LiTr.