ffmpeg.js icon indicating copy to clipboard operation
ffmpeg.js copied to clipboard

Rewrap WebM/H.264 to MP4/H.264

Open krean93 opened this issue 5 years ago • 2 comments

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:

  1. Recording video/webm;codecs=h264 recordVideo = RecordRTC(stream, { type: "video", mimeType: "video/webm;codecs=h264", });
  2. 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.

Thanks for any insight!

krean93 avatar May 21 '20 08:05 krean93

Can you share the ffmpeg logging output?

tpetry avatar May 21 '20 11:05 tpetry

Is the black screen in browser or in e.g. Quicktime? At least for me h264 mp4s work fine in Chrome but not in the OS players

videoinu avatar May 22 '20 05:05 videoinu