FFME: The Advanced WPF MediaElement (based on FFmpeg)
FFME: The Advanced WPF MediaElement (based on FFmpeg)
:star: Please star this project if you like it and show your appreciation via PayPal.Me
Source dependency property has been downgraded to a notification property. Please use the asynchronous Open and Close methods instead.Please note the current NuGet realease might require a different version of the FFmpeg binaries than the ones of the current state of the source code.
Open Visual Studio and create a new WPF Application.
Target Framework must be set to .net 5.0 or above
Install the NuGet Package from your Package Manager Console:
…Unosquare.FFME.Library.FFmpegDirectory = @"c:\ffmpeg";```
And use the FFME MediaElement control as you would any other WPF control.
in your main window (e.g MainWindow.xaml)
xmlns:ffme="clr-namespace:Unosquare.FFME;assembly=ffme.win"
* Play files or streams, by calling the asynchronous method, Open:
```await Media.Open(new Uri(@"c:\your-file-here"));```
* Close the media, by calling:
```await Media.Close();
```
…
```
device://dshow/?audio=Microphone (Vengeance 2100):video=MS Webcam 4000
device://gdigrab?title=Command Prompt
device://gdigrab?desktop
```
…
```
ffme.win.dll```.
### ffmeplay.exe Sample Application
The source code for this project contains a very capable media player (`FFME.Windows.Sample`) covering most of the use cases for the `FFME` control. If you are just checking things out, here is a quick set of shortcut keys that `ffmeplay` accepts.
| Shortcut Key | Function Description |
| --- | --- |
| G | Example of toggling subtitle color |
| Left | Seek 1 frame to the left |
| Right | Seek 1 frame to the right |
| + / Volume Up | Increase Audio Volume |
| - / Volume Down | Decrease Audio Volume |
| M / Volume Mute | Mute Audio |
| Up | Increase playback Speed |
| Down | Decrease playback speed |
| A | Cycle Through Audio Streams |
| S | Cycle Through Subtitle Streams |
| Q | Cycle Through Video Streams |
| C | Cycle Through Closed Caption Channels |
| R | Reset Changes |
| Y / H | Contrast: Increase / Decrease |
| U / J | Brightness: Increase / Decrease |
| I / K | Saturation: Increase / Decrease |
| E | Example of cycling through audio filters |
| T | Capture Screenshot to `desktop/ffplay` folder |
| W | Start/Stop recording packets (no transcoding) into a transport stream to `desktop/ffplay` folder. |
| Double-click | Enter fullscreen |
| Escape | Exit fullscreen |
| Mouse Wheel Up / Down | Zoom: In / Out |
## Thanks
*In no particular order*
- To the FFmpeg team for making the Swiss Army Knife of media. I encourage you to donate to them.
- To the NAudio team for making the best audio library out there for .NET -- one day I will contribute some improvements I have noticed they need.
- To Ruslan Balanukhin for his FFmpeg interop bindings generator tool: FFmpeg.AutoGen.
- To Martin Bohme for his tutorial on creating a video player with FFmpeg.
- To Barry Mieny for his beautiful FFmpeg logo
## Similar Projects
- Meta Vlc
- Microsoft FFmpeg Interop
- WPF-MediaKit
- LibVLC.NET
- Microsoft Player Framework
## License
- Please refer to the LICENSE file for more information.No open issues yet, or sync has not completed.