Ffmpeg.js
Ffmpeg.js copied to clipboard
Rewrap WebM/H.264 to MP4/H.264
Is it possible to increase performance by recording in H.264 codec, then simply rewrapping with ffmpeg.js?
I'm experimenting with the following setup:
- Recording: video/webm;codecs=h264
recordVideo = RecordRTC(stream, { type: "video", mimeType: "video/webm;codecs=h264", }); - Copying codec, bypassing the transcoding overhead: -c:v copy
worker.postMessage({ type: "command", arguments: "-i video.webm -c:v copy output.mp4".split(" "), files: [ { data: new Uint8Array(aab), name: "video.webm", }, ], });
Result: In theory it should work, but I'm getting a black screen s a result. I'm using the demo source (https://github.com/muaz-khan/Ffmpeg.js/blob/master/webm-to-mp4.html) with the above modifications.
Any updates on this?
-i video.webm -c:v copy output.mp4 worked for me but I had to use the ffmpeg-all-codecs.js taken from http://bgrins.github.io/videoconverter.js/