linkedin / LiTr

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

Audio Overlay for a specific time #267

Open vikaspAlgoworks opened 1 year ago

vikaspAlgoworks commented 1 year ago

Hi @izzytwosheds ,

Is there an option to overlay audio or video for only a specific time duration? For example: if we have a video of length 40 seconds and we want to overlay audio from 5 seconds to 25 seconds only, how can it be achieved?

From looking at AudioOverlayFilter's apply method, it uses ByteBuffer but no presentationTime to make any such operation.

Any insight or guidance would be highly valuable to us.

izzytwosheds commented 10 months ago

Hi. Apologies for late response. AudioOverlayFilter receives a Frame in apply method, which has bufferInfo field, which in turn will have a presentationTimeUs. You can use that field to control when audio filter is applied.