Skip to content

Commit

Permalink
fix(mpd) parse xml (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvAlex committed Jan 18, 2018
1 parent a5ad28f commit 0626ecf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
18 changes: 13 additions & 5 deletions DashTools.Samples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ 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://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 () =>
Expand All @@ -22,10 +31,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";
string mpdUrl = mpdFiles[0];
var from = TimeSpan.Zero;
var to = TimeSpan.MaxValue;
var stopwatch = Stopwatch.StartNew();

var downloader = new MpdDownloader(new Uri(mpdUrl), dir);
Expand All @@ -38,7 +46,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();
Expand Down
1 change: 0 additions & 1 deletion DashTools/MediaPresentationDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ private XElement ReadMpdTag()
{
using (var reader = XmlReader.Create(stream))
{
stream.Seek(0, SeekOrigin.Begin);
reader.ReadToFollowing("MPD");
return XNode.ReadFrom(reader) as XElement;
}
Expand Down

0 comments on commit 0626ecf

Please sign in to comment.