Open juntaosun opened 1 year ago
🙏🏻 please
@juntaosun @gomjellie
@webav/av-cliper
can mixin audio tracks and re-encoding.
https://github.com/hughfenghen/WebAV/blob/main/packages/av-cliper/README.md#usage
Here is a code example to create the audio track https://github.com/hughfenghen/WebAV/blob/main/packages/av-cliper/src/mp4-utils.ts#L295C37-L295C37
const audioTrackOpts = {
timescale: 1e6,
samplerate: audioOpts.sampleRate,
channel_count: audioOpts.channelCount,
samplesize: audioOpts.sampleSize,
hdlr: 'soun',
name: 'SoundHandler',
type: 'mp4a'
}
let trackId = 0
const encoder = new AudioEncoder({
output: (chunk, meta) => {
if (trackId === 0 && meta.decoderConfig?.description != null) {
trackId = mp4File.addTrack({
...audioTrackOpts,
description: createESDSBox(meta.decoderConfig?.description)
})
}
})
This is great, can you continue to support audio track encoding?