diff --git a/DashTools.Samples/Program.cs b/DashTools.Samples/Program.cs index 73df624..fe443ae 100644 --- a/DashTools.Samples/Program.cs +++ b/DashTools.Samples/Program.cs @@ -11,6 +11,16 @@ namespace Qoollo.MpegDash.Samples { class Program { + private static readonly string[] mpdFiles = new string[] + { + "http://ncplusgo.s43-po.live.e56-po.insyscd.net/out/u/eskatvsd.mpd", + "http://dash.edgesuite.net/envivio/EnvivioDash3/manifest.mpd", + "http://dash.edgesuite.net/dash264/TestCases/1a/netflix/exMPD_BIP_TC1.mpd", + "http://10.5.5.7/q/p/userapi/streams/32/mpd", + "http://10.5.7.207/userapi/streams/30/mpd", + "http://10.5.7.207/userapi/streams/11/mpd?start_time=1458816642&stop_time=1458819642", + }; + static void Main(string[] args) { Task.Run(async () => @@ -22,11 +32,9 @@ static void Main(string[] args) static async Task MainAsync(string[] args) { string dir = "envivio"; - string mpdUrl = "http://10.5.5.7/q/p/userapi/streams/32/mpd"; - //"http://10.5.7.207/userapi/streams/30/mpd"; - //"http://10.5.7.207/userapi/streams/11/mpd?start_time=1458816642&stop_time=1458819642"; - //"http://dash.edgesuite.net/envivio/EnvivioDash3/manifest.mpd"; - //"http://dash.edgesuite.net/dash264/TestCases/1a/netflix/exMPD_BIP_TC1.mpd"; + string mpdUrl = mpdFiles[0]; + var from = TimeSpan.Zero; + var to = TimeSpan.MaxValue; var stopwatch = Stopwatch.StartNew(); var downloader = new MpdDownloader(new Uri(mpdUrl), dir); @@ -39,7 +47,7 @@ static async Task MainAsync(string[] args) // ? new Mp4InitFile(Path.Combine("envivio", Path.GetFileName(f))) // : new Mp4File(Path.Combine("envivio", Path.GetFileName(f)))) // .ToArray(); - await downloader.Download(trackRepresentation, TimeSpan.FromMinutes(60), TimeSpan.FromMinutes(60 + 60 * 6 / 6)); + await downloader.Download(trackRepresentation, from, to); var downloadTime = stopwatch.Elapsed - prepareTime; var ffmpeg = new FFMpegConverter(); diff --git a/DashTools/MediaPresentationDescription.cs b/DashTools/MediaPresentationDescription.cs index 1df6feb..918bbf2 100644 --- a/DashTools/MediaPresentationDescription.cs +++ b/DashTools/MediaPresentationDescription.cs @@ -156,7 +156,6 @@ private XElement ReadMpdTag() { using (var reader = XmlReader.Create(stream)) { - stream.Seek(0, SeekOrigin.Begin); reader.ReadToFollowing("MPD"); return XNode.ReadFrom(reader) as XElement; }