Exemplo n.º 1
0
        public static async Task <Stream> MergeToFileAsync(string video, string audio, string output)
        {
            await WebAssemblyRuntime.InvokeAsync($@"
                ffmpeg.run('-i', '{WebAssemblyRuntime.EscapeJs(video)}', '-i', '{WebAssemblyRuntime.EscapeJs(audio)}', '-c', 'copy', '{WebAssemblyRuntime.EscapeJs(output)}');");

            return(FFmpegFile.OpenRead(output));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Runs the FFmpeg application, as if invoked on the command line.
        /// </summary>
        /// <param name="param">Command line arguments. The last argument MUST be the output file.</param>
        /// <returns>A Stream containing the output file.</returns>
        public static async Task <Stream> RunAsync(params string [] param)
        {
            await WebAssemblyRuntime.InvokeAsync($@"
                ffmpeg.run({string.Join(",", param.Select(x => $@"'{WebAssemblyRuntime.EscapeJs(x)}'"))});
            ");

            return(FFmpegFile.OpenRead(param.Last()));
        }