trungnt2910
trungnt2910

Reputation: 342

Merge Audio and Video on Uno Platform

I am trying to merge an audio stream and a video stream into a single file, on the Uno Platform, particularly for WebAssembly.
I already know that the normal, desktop-only way is by calling ffmpeg, and I also found a C# only way for UWP here.
However, the code used Windows.Media.Editing which is not implemented in Uno.
I know there is a ffmpeg library port for WASM here, but I don't know how to call it from my Uno web application.

So are there any ways to merge an audio stream and a video stream to a single file, on the Uno platform for WASM?

Upvotes: 0

Views: 219

Answers (1)

Martin Zikmund
Martin Zikmund

Reputation: 39082

Unfortunately, this API is not yet implemented in Uno Platform, so in this case you need to write platform-specific implementation.

If you have a JavaScript library available, which can provide the functionality you need, you can still call it from the C# code. There is a three-part tutorial in the Uno Platform docs on implementing C# - JS interop, so that may be helpful to get started.

Alternatively, in case you find an alternative implementation in C# on NuGet, you can install it for the supported platforms and use it in your code as well. To write platform-specific code, you can use #if conditionals like #if __WASM__ etc. - for full information see this documentation page.

Upvotes: 1

Related Questions