Media abstraction and playback library
- Sn.Media: Basic abstraction
- Sn.Media.NAudio: Sample stream and player based on NAudio
- Sn.Media.OpenCvSharp4: Frame stream based on OpenCvSharp4 VideoCapture
- Sn.Media.WPF: Frame player implementation on WPF
-
Add xmlns:
xmlns:mwpf="clr-namespace:Sn.Media.WPF;assembly=Sn.Media.WPF"
-
Add
SamplePlayercontrol:<mwpf:FramePlayer x:Name="framePlayer" />
-
Set source, and play:
framePlayer.Source = new VideoFileFrameStream(@"D:\CloudMusic\MV\shanqiu.mp4"); framePlayer.IsPlaying = true;
Tips: Type
VideoFileFrameStreamis fromSn.Media.OpenCvSharp4
-
Create player, set source, play
var samplePlayer = new SamplePlayer(); samplePlayer.Source = new AudioFileSampleStream(@"D:\CloudMusic\MV\shanqiu.mp4"); samplePlayer.IsPlaying = true;
If you want the reading of frame data or sample data to happen in the background, you can use buffered frame or sample streams
framePlayer.Source = new BufferedFrameStream(new VideoFileFrameStream(@"D:\CloudMusic\MV\shanqiu.mp4"));