Skip to content
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

Ccapture.js FFMPEG frame encoder #4

Open
mikevercoelen opened this issue Feb 5, 2022 · 2 comments
Open

Ccapture.js FFMPEG frame encoder #4

mikevercoelen opened this issue Feb 5, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@mikevercoelen
Copy link

mikevercoelen commented Feb 5, 2022

Interesting project, I was wondering if you've tried to create an ffmpeg wasm encoder for CCapture.js

The problem with your current approach is that it gets double compressed: first through webm, then through mp4.

The other problem is that it's pretty unoptimised due to these two steps. If we can capture them in one go, which should be possible with ffmpeg, it's probably faster than webm-writer, as ffmpeg is wasm and webm-writer isn't.

I'm currently re-writing CCapture in Typescript, upgrading the dependencies and adding video + audio support, it's very old code.

Perhaps we can do this together?

@amandaghassaei
Copy link
Owner

Hi - yeah that does sound like a better approach and it would solve some of the webm problems I'm having with firefox at the moment. Your project sounds really nice – to be honest this codebase is not really a high priority for me, I just need to it work well enough to support some of my other projects, so I probably won't be making any optimizations any time soon. But let me know when you finish your CCapture TS port, I'd like to check that out!

@amandaghassaei
Copy link
Owner

I found this lib to encode frames directly as mp4: https://github.com/TrevorSundberg/h264-mp4-encoder
also note that there may be legal issues related to h264 encoding: https://www.npmjs.com/package/mp4-h264

Making this switch will also remove the cross-origin isolated requirement of ffmpeg.wasm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants