Git Product home page Git Product logo

ffmpegsharp's Introduction

FFmpegSharp is a fluent api encapsulation of ffmpeg with C#

Encode media(with snapshot)

var currentDir =
new FileInfo(Uri.UnescapeDataString(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath));

var inputPath = Path.Combine(appPath, "test.mov");
var outputPath = Path.Combine(appPath, Guid.NewGuid().ToString());
var image = Path.Combine(appPath, "logo.png");

if (string.IsNullOrWhiteSpace(appPath))throw new ApplicationException("app path not found.");


var inputPath = Path.Combine(appPath, "test.mov");
var outputPath = Path.Combine(appPath, Guid.NewGuid().ToString());

Encoder.Create()
	.WidthInput(inputPath)
	.WithFilter(new X264Filter { Preset = X264Preset.Faster, ConstantQuantizer = 18 })
	.WithFilter(new ImageWatermarkFilter(image, WatermarkPosition.TopRight))
	.WithFilter(new ResizeFilter(Resolution.X720P))
	.WithFilter(new SnapshotFilter(Path.Combine(appPath,"snapshot","out.png"),320,180,10))//with snapshot
	.To<Mp4>(outputPath)
	.Execute();

Push a file to RTMP Server

Network.Create()
	.WithSource(inputPath)
	.WithDest("rtmp://192.168.10.12/live/stream")
	.WithFilter(new X264Filter{ConstantQuantizer = 20})
	.WithFilter(new ResizeFilter(980,550))
	.Push();

FFmpegLib

if you want build this project, please donwload ffmpeg lib first.

for x32 build with: http://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-20141117-git-3f07dd6-win32-shared.7z

for x64 build withd: http://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-20141117-git-3f07dd6-win64-shared.7z

after extract the files, copy the contents of the 'bin' folder to the path '/external/ffmpeg/x32(or x64)/'

License

MIT

ffmpegsharp's People

Contributors

at0717 avatar yuzukwok avatar

Watchers

 avatar  avatar

Forkers

m446883859

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.