Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mpd) parse xml (#2) #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions DashTools.Samples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 () =>
Expand All @@ -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);
Expand All @@ -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();
Expand Down
1 change: 0 additions & 1 deletion DashTools/MediaPresentationDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down