Merge Audio and Video on Uno Platform - c#

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?

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.

Related

Alternate option of Amazon Kinesis Video Streams

Please suggest some material or links so that I can create a small project .net on Live streaming Like Amazon Kinesis Video Streams.
Unfortunately, we don't yet have support for .NET.
One way is to take the C or C++ producer SDK project, compile it for Windows (which it supports), create a library with most of the logic for the .NET or use the APIs directly and write a thin .NET wrapper/interop code on top of it that exposes the functionality to .NET.

WinRt C# Audio Library

I am looking to develop an app in C# WinRt, but was wondering what libraries are available for playback and for complicated manipulation. I am looking for a free library that allows for an extensive list of audio formats to be played (for example mp3, wma, wav, ogg, etc.) and also to be analyzed. Thats pretty much the basic functionality I would need. But if I could get picky, a library that can convert audio files between the formats would be handy. Doing a google search I came across the Naudio library, but it was not so greatly compatible with WinRt.Thanks for any tips or advice on this.
The current alpha build of NAudio 1.7 (available via NuGet) does contain a Windows RT assembly and the source code includes a simple demo of playback and recording as a Windows Store app. Since it uses Media Foundation, you'll be able to play most of the file types you suggested (although ogg won't be supported out of the box), and you can construct your audio pipeline to access the audio as floating point samples for analysis.
Things that aren't currently supported are using the Media Foundation encoders to encode, and the various reader/writer classes need to be re-written to use the WinRT asynchronous streams and File I/O APIs instead of the regular .NET ones. Hopefully these features will be added to the library soon.

Filling and playing audio buffer in C# (.NET 4.0)

Where I can found something suitable (library) for .NET 4.0 (C#) capable for following features:
+ Reading mp3/wav samples with direct access to samplebuffer of loaded samples? (for example I want to load mp3 sample and programatically add reverb, chorus, and more custom effects implemented by me)
+ Playing directly audio buffers (arrays of floats)
+ Saving audio buffers to disk as mp3 or wav
Some time ago i found ASIO for .NET and this only works with .NET 3.5, is there something for .NET 4.0? Thank's a lot for your help.
ASIO for .NET won't help you in the cracking of mp3 or wav files. The most modern API in Windows for doing this is Microsoft Media Foundation. These are all COM APIs though, so you're either going to be doing (perhaps painful) COM interop from .NET or (easier) writing a C++/CLI wrapper. If you go the C++/CLI wrapper, you will need to be aware of performance issues (especially with how critical latency is to audio programming).
I'm skeptical that you will get the audio latency you need when programming in .NET. A good audio driver (like ASIO) will get you down to <3ms of latency. So if you are targetting "live audio", you will need to be generating audio buffers quicker than that (unless you are fine with longer latencies). To put it this way, the "time intervals" that the Windows APIs deal with are in 100 nanosecond intervals :).
You likely don't want to have to crack the files yourself. It becomes tedious as it's not only just mp3 and wav. You also have to be aware of how the wav is formatted as well (to account for different bit rates, number of channels, etc.). Using Media Foundation, it will automatically load the write decoder for you, you just give it the file path. Check out this tutorial that shows opening an existing WAV file and writing a new WAV file. I just recently went down this path for a drum sequencer I'm creating, and it's not very painful at all (if you're familiar with COM programming).
The central component in MF that makes this possible is the MFSourceReader.
If you're wanting to play the audio after you modify it, you can look at the sample "RenderExclusiveEventDriven" in the Windows SDK (under "audio" I believe). That's what I did for the drum sequencer as well. Latency won't be an issue and you're just dealing with byte arrays, so manipulating the raw data becomes very easy. Though at this point, you can probably stick with the ASIO .NET route and just use that to play the raw data you get from MFSourceReader.
I don't think there are .NET wrappers around Media Foundation yet (though if somebody has done that work already, feel free to post here as it would be awesome to know).

.Net sdk for video editing like Windows Movie Marker

i am currently working on .net application which contains one audio & video file.
audio file is split as in to small section as per database entries. then we have to merge this files on video file at specific positions.we what something like windows movie maker
it will be nice if someone suggest some .net based sdk for this.
You can use ffmpeg for this purpose. But you will need a .net wrapper to make it usable in C#.
You can use ffmpeg-sharp or SolidFFMpeg. its a a wrapper library over the FFmpeg multimedia suite that provides easy to use wrappers for use in C#.
Datastead Software's TVideoGrabber Video SDK has this feature.
"join several video clips and/or audio clips into a single one, in full or by specifying respective start times and end times"
http://www.datastead.com/products/tvideograbber/features.html
The engine behind Windows Movie Maker is DirectShow Editing Services. You can use it via DirectShow.NET.

What is the best way to play MMS/RTSP streams in C#?

Is there something like libmms, librtsp or xine-lib for C#?
I have been using the BASS library successfully for these types of streams.
It should be able to do it with the WMA plugin.
It's written in C/C++ , but there is a .NET wrapper available.
It also supports mp3 and ogg/aac (with plugins)
You may also try to host the Media Player, if the target is Windows Forms/WPF.

Categories

Resources