I am using ffmpeg-kit to manage audio recordings in React Native.
- I have 2 recordings -
rec_1.m4aandrec_2.m4a. - I only know the duration of
rec_1.m4a, which is 10.0 seconds. - I want to overwrite
rec_1.m4awithrec_2.m4afrom a specific timestamp on - e.g. from 5.6 seconds.
How can I do this with ffmpeg?
rec_2.m4aends beforerec_1.m4adoes (in our case this meansrec_2.m4a's duration is <4.4 seconds - 10.0-5.6=4.4).rec_2.m4adoes not end even afterrec_1.m4adoes (in our case this meansrec_2.m4a's duration is >=4.4 seconds).
I know I could split the files and then concatenate them. But for that I would have to know rec_2.m4a's duration, which I don't.
Edit: Figured I could use the FFprobeKit.getMediaInformationAsync() function to easily get the duration of rec_2.m4a. But it would still be nice to know if replacement is possible without this extra step.