Closed suyana closed 2 months ago
Hi
You need to add a DecodeBinBlock block after an HTTPSourceBlock to decode MP4 file video/audio streams. UniversalSourceBlock has decoders inside.
Sample code:
_source = new HTTPSourceBlock(settings);
_videoRenderer = new VideoRendererBlock(_pipeline, VideoView1) { IsSync = false };
_decode = new DecodeBinBlock(renderAudio: false);
_pipeline.Connect(_source.Output, _decode.Input);
_pipeline.Connect(_decode.VideoOutput, _videoRenderer.Input);
If you need audio, you have to add AudioRendererBlock and connect the AudioOutput pad of DecodeBinBlock.
You're right. The problem has been resolved, thank you.
I use Example:
Replace the UniversalSourceBlock of the code with
var
tmpSource = new HTTPSourceBlock(new HTTPSourceSettings(new Uri(" http://test.visioforge.com/video.mp4 ")));Running programs on the Windows platform, unable to play videos properly
Player_OnError prompts the following error:
But i used a WPF based example (with the same URL), which can play normally.