私は.m3u8ファイルを再生できるアプリケーションを持っています。 ただし、MPEG 1/2 (mpgv)
でエンコードされた動画は、空白の画面しか表示されません。 H.264
のようなビデオを開くと、すべてがOKです。どうしましたか?UWPでのビデオデコード
using Microsoft.Media.AdaptiveStreaming;
//Listing: MainPage.xaml.cs -> class
private MediaExtensionManager extensions;
private PropertySet propertySet;
private IAdaptiveSourceManager adaptiveSourceManager;
//Listing: MainPage.xaml.cs -> class -> constructor
propertySet = new PropertySet();
extensions = new MediaExtensionManager();
adaptiveSourceManager = AdaptiveSourceManager.GetDefault();
propertySet["{A5CE1DE8-1D00-427B-ACEF-FB9A3C93DE2D}"] = adaptiveSourceManager;
extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "text/xml", propertySet);
extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "application/vnd.ms-sstr+xml", propertySet);
extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "application/x-mpegurl", propertySet);
extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "video/mp2t", propertySet);
extensions.RegisterSchemeHandler("Microsoft.Media.AdaptiveStreaming.SmoothSchemeHandler", "ms-sstr:", propertySet);
//Listing -> MainPage.xaml.cs -> OnNavigatedTo method
//Getting manifest.m3u8
var link = new Uri("path_to_remote_m3u8_file");
Player.Source = link;
Player.Play();
//Listing: MainPage.xaml
<MediaElement x:Name="Player" />
一般的に、.m3u8
に我々は.ts
ファイルのリストを持っている:
は、ここでは、コードです。しかし、H.264
でエンコードされたものは再生でき、MPEG-1
またはMPEG-2
でエンコードされたものは再生できません。
私はあなたMicrosoft Player Framework
必要がありますが、彼らは窓10のためのDash plugin
を持っていないので、thisたとえば、次の私は結果を達成することはできませんextensions
に多くのハンドラを追加する必要がありますまたは多分私推測します。あるいはFFmpeg?
ご返信ありがとうございます。私は 'MPEG-2'ファイルを開くことができませんでしたので、別の解決策を探します。 – Vlad