-
Notifications
You must be signed in to change notification settings - Fork 22
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:
-
jsRuntimean IJSRuntime instance [not null] -
newCDNPathdownload 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:
-
optionsan object of customized options-
corePathpath for ffmpeg-core.js script -
loga bool to turn on all logs, default isfalse
-
Examples:
var ff = FFmpegFactory.CreateFFmpeg();
//or
var ff = FFmpegFactory.CreateFFmpeg(new FFmpegConfig() { Log=false});-
Loggeran event to get log messages, a quick example isFFmpegFactory.Logger+=(e) => console.WriteLine(e.message); -
Progressa 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:
-
bufferbytes of files to be downloaded as link -
fileNamerename file -
mime typesuch 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:
-
bufferbytes of files to be downloaded as link -
fileNamefile blob name -
mime typesuch as 'video/mp4'
Examples:
var VideoURl= FFmpegFactory.CreateURLFromBuffer(res, "output.mp3", "audio/mp3");Free URL object and buffer , caused by CreateURLFromBuffer()
Arguments:
-
urlSourceurl to revoke
Examples:
FFmpegFactory.RevokeObjectURL(videoURL);