-
-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge Mp3 to mp4 #165
Comments
var fs = require('fs')
var ffmpeg = require('ffmpeg.js/ffmpeg-mp4')
const audioPath = './res/433834921.mp3'`
const videoPath = './res/433834921.mp4'
const resultPath = './result/433834921.mp4'
const audioData = new Uint8Array(fs.readFileSync(audioPath))
const videoData = new Uint8Array(fs.readFileSync(videoPath))
// ffmpeg -i input.flv -i input.mp3 -c:v copy -c:a aac -strict experimental output.mp4
const result = ffmpeg({
MEMFS: [{name: '433834921.mp3', data: audioData}, {name: '433834921.mp4', data: videoData}],
arguments: ["-i", "433834921.mp3", "-i", "433834921.mp4", "-c:v", "copy", "-c:a", "aac", "-strict", "experimental", "out.mp4"],
})
const out = result.MEMFS[0];
fs.writeFileSync(resultPath, Buffer(out.data)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I need to merge mp3 to mp4 in the browser with js. Is there any documentation here for that?
The text was updated successfully, but these errors were encountered: