Mute a part of video and add new audio to video
Mute a part of video and add new audio to video
I was testing this library
these are the various scenarios we are testing
-
Mute a part of video, For example We have a video of 1 minute, we want to mute from 20th sec. to 40th sec. keeping rest of the audio. i.e from 0 sec. to 20 and from 41 sec to 60 sec
-
for another video of 2 minutes long we want to add new audio to the original video removing original audio or keeping original audio overlaying new audio over it(both are different scenario)
-
can we keep original video and revrse audio
how can we do this.
Please create documentation for the different use cases which are present in the demo app and other uses.
Thank you for using LiTr! Let's go over each scenario:
- LiTr does not yet support muting part of audio. You could implement this by developing a custom
Rendererfor audio which outputs zero filled buffers when silencing part of audio. This should be pretty straightforward - you can takePassthroughSoftwareRendereras an example and modify it. I will soon enable support for audio filters which should let you do this at a filter level, without needing a custom renderer. - Replacing original audio with a different track is something you can do now. You will have to define two
TrackTransforms - one will have aMediaExtractorMediaSourcethat takes video track only, another will haveMediaExtractorMediaSourcethat takes audio track only from a different file and both tracks will have a commonMediaMuxerMediaTargetwhich will write both tracks into one file. There are examples of usingTrackTransforminTransformationPresenterin demo app that should help. Mixing two audio tracks into one - LiTr does not do that yet. - This is not a very straightforward task, LiTr does not support this yet.
@izzytwosheds: in case 2, I can replace the original audio with a new audio. However, when the audio is shorter than the video, is there a way to keep looping the audio to match the duration of the video?
LiTr does not yet support looping audio or video frames. I will try to look into this.