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

[wasm] MP4 example #753

Merged
merged 14 commits into from
Sep 17, 2024
Merged

[wasm] MP4 example #753

merged 14 commits into from
Sep 17, 2024

Conversation

noituri
Copy link
Member

@noituri noituri commented Sep 10, 2024

Added MP4 example for @live-compositor/browser-render. The example simply plays mp4 video with text component on top of it.

Closes #730

@noituri noituri requested review from wkozyra95 and removed request for wkozyra95 September 10, 2024 15:09
@noituri noituri force-pushed the @noituri/browser-render-mp4 branch from a417c71 to a527f14 Compare September 10, 2024 16:15
Copy link
Member

@wkozyra95 wkozyra95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move those projects to ts/examples directory after #756 lands

@wkozyra95
Copy link
Member

I'm preparing create-live-compositor package that generates projects that use compositor, can you make a list of changes that you had to do on a project generated from vite

@noituri noituri force-pushed the @noituri/browser-render-mp4 branch from a527f14 to 4dad3e8 Compare September 11, 2024 13:46
@@ -1,13 +1,16 @@
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import { createRequire } from 'node:module';

const require = createRequire(import.meta.url);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a workaround for vite transforming the global require

const buffer = new Uint8ClampedArray(frame.allocationSize(frameOptions));
frame.copyTo(buffer, frameOptions);
const buffer = new Uint8ClampedArray(
frame.allocationSize(frameOptions as VideoFrameCopyToOptions)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as VideoFrameCopyToOptions is needed here because the default typings for VideoFrame are missing format field, even though format is part of the web codecs spec

ts/lerna.json Outdated Show resolved Hide resolved
@noituri noituri requested a review from wkozyra95 September 11, 2024 15:06
ts/examples/web-examples/counter/src/App.tsx Outdated Show resolved Hide resolved
ts/examples/web-examples/mp4/vite.config.ts Outdated Show resolved Hide resolved
ts/examples/web-examples/counter/package.json Outdated Show resolved Hide resolved
ts/examples/web-examples/counter/tsconfig.app.tsbuildinfo Outdated Show resolved Hide resolved
@noituri noituri force-pushed the @noituri/browser-render-mp4 branch from 8b8dcc6 to c420eda Compare September 16, 2024 12:14
@noituri noituri requested a review from wkozyra95 September 16, 2024 12:18
ts/lerna.json Outdated Show resolved Hide resolved
@wkozyra95
Copy link
Member

btw if I open mp4 example, one of the chrome processes memory usage is 10GB. Is this expected?

@noituri noituri enabled auto-merge (squash) September 17, 2024 11:46
@noituri noituri merged commit facbb86 into master Sep 17, 2024
4 checks passed
@noituri noituri deleted the @noituri/browser-render-mp4 branch September 17, 2024 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MP4 input example for wasm compositor
2 participants