-
Notifications
You must be signed in to change notification settings - Fork 19
FFmpegFactory
Shivendra Pratap Singh edited this page Nov 21, 2020
·
1 revision
FFmpegFactory is an Static Class.
Init is a factory function that Assigns IJSRuntime and injects JS modules automatically
Arguments:
-
jsRuntime
an IJSRuntime instance [not null] -
newCDNPath
download any latest js module [can be null]
Examples:(razor)
@inject IJSRuntime Runtime
using FFmpegBlazor;
FFmpegFactory.Init(Runtime);
//or
FFmpegFactory.Init(Runtime,"https://unpkg.com/@ffmpeg/ffmpeg@0.9.5/dist/ffmpeg.min.js");
CreateFFmpeg is a factory function that creates a FFmpeg instance.
Arguments:
-
options
an object of customized options-
corePath
path for ffmpeg-core.js script -
log
a bool to turn on all logs, default isfalse
-
Examples:
var ff = FFmpegFactory.CreateFFmpeg();
//or
var ff = FFmpegFactory.CreateFFmpeg(new FFmpegConfig() { Log=false});
-
Logger
an event to get log messages, a quick example isFFmpegFactory.Logger+=(e) => console.WriteLine(e.message);
-
Progress
a event to trace the progress, a quick example isFFmpegFactory.Progress+=(p) => Console.Writeline(p);
Download Buffer as File on client machine, instantly , without wait
Arguments:
-
buffer
bytes of files to be downloaded as link -
fileName
rename file -
mime type
such as 'video/mp4'
Examples:
FFmpegFactory.DownloadBufferAsFile(res, "output.mp3", "audio/mp3");
Creates a URL for a given Buffer so that it can be referenced by Html component as source
Arguments:
-
buffer
bytes of files to be downloaded as link -
fileName
file blob name -
mime type
such as 'video/mp4'
Examples:
var VideoURl= FFmpegFactory.CreateURLFromBuffer(res, "output.mp3", "audio/mp3");
Free URL object and buffer , caused by CreateURLFromBuffer()
Arguments:
-
urlSource
url to revoke
Examples:
FFmpegFactory.RevokeObjectURL(videoURL);