NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 8 9 10 11 12 … 93 Next »
Streaming media

 
  • 0 Vote(s) - 0 Average
Streaming media
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#1
2012-11-24, 10:47 AM
I find myself with some (rare) free time, so I thought I'd play around with a bit of development and look at trying to knock together a simple movies trailers plugin. On the absence of suggestions for a better place to grab trailers, I was looking at the Apple iTunes rss feed here: http://trailers.apple.com/trailers/home/...t_720p.xml

Although this has links to the video files, Apple won't let you direct download them unless it thinks you're coming from QuickTime. So doing this, for example, won't work:

Code:
PluginHelperFactory.GetPluginHelper().PlayVideoFile("http://trailers.apple.com/movies/independent/holdyourbreath/holdyourbreath-tlr2_a720p.m4v");

There is a simple workaround, however, which is to change the user-agent, eg with wget:

Code:
wget -U QuickTime http://trailers.apple.com/movies/independent/holdyourbreath/holdyourbreath-tlr2_a720p.m4v

Is there any way you could make such functionality available via the NPVR API? It would be much nicer to have the videos stream on the fly rather than have to download them first.

Iain
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2012-11-24, 04:04 PM
Unfortunately I don't think so. When you ask NextPVR to play a URL, it asks DirectShow to renderer it, and it will pick components components on the machine that can play that type of stream. One of those components will be responsible for downloading the data, and would be the one to supply the user agent. That component could be one of a few directshow filters depending on the URL, and none of those are supplied by NextPVR, so I cant tweak them to force the user-agent.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#3
2012-11-24, 04:06 PM
You might be able to create some local proxy though. ie, tell it play a local URL, and you have a function listening on a socket that forwards the request to Apple, adding the user agent.
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#4
2012-11-24, 05:37 PM
sub Wrote:You might be able to create some local proxy though. ie, tell it play a local URL, and you have a function listening on a socket that forwards the request to Apple, adding the user agent.

Interesting. It's not something I've ever done before, but there seems to be plenty of examples after a quick search, so it might be worth a shot.

Iain
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#5
2012-11-25, 12:11 PM
As a follow up to this, can you playback a file (from a local drive) that is still being downloaded?

The proxy trick works, although (my implementation of it) is a little messy for now, so I also looked at just using WebClient to download the file first (with the correct user-agent). mpc-hc seems to be able to start playing the file before it's fully downloaded, but NPVR didn't want to. Are we back in "it's DirectShow's fault" territory again? I know you can obviously play growing files with Live TV, but that's your own .ts handler stuff.

Feeding it a http:// request works too (ignoring the user-agent problems for a moment), so I thought maybe accessing the local file with a file:// URL would work, but I didn't have any luck there either.

Iain
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,767
Threads: 954
Joined: May 2006
#6
2012-11-25, 12:51 PM
imilne Wrote:As a follow up to this, can you playback a file (from a local drive) that is still being downloaded?

whurlston's YouTube plugin allows this. He is making it open source too so you might be able to use his whole download module. It is nice because it use ffmpeg to remux to .ts making playback on the NMT much nicer.

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#7
2012-11-25, 03:55 PM
imilne Wrote:As a follow up to this, can you playback a file (from a local drive) that is still being downloaded?

The proxy trick works, although (my implementation of it) is a little messy for now, so I also looked at just using WebClient to download the file first (with the correct user-agent). mpc-hc seems to be able to start playing the file before it's fully downloaded, but NPVR didn't want to. Are we back in "it's DirectShow's fault" territory again? I know you can obviously play growing files with Live TV, but that's your own .ts handler stuff.
Yeah unfortunately you're at the mercy of whatever filters are chosen by directshow to play this type of URL.

As Martin indicated above, you can probably use ffmpeg or vlc to download from url and transcode as it does it, to a .ts file that you can then play.
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#8
2012-11-26, 08:09 PM
mvallevand Wrote:whurlston's YouTube plugin allows this. He is making it open source too so you might be able to use his whole download module. It is nice because it use ffmpeg to remux to .ts making playback on the NMT much nicer.

Martin
Yeah, but I'm currently using ffmpeg for the download. I haven't found a way to make ffmpeg spoof the UA though so it wouldn't help. I did however use a method with my first Netflix plugin that might work. I'll have to dig out that code if I still have it.
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#9
2012-11-27, 04:05 AM
Actually, I have to correct myself (now that I've had more time to think about this). I'm actually using a modified WebClient (so that it works with cookies) to do the actual download and I then pipe the response stream to ffmpeg. So my method would definitely work for you and allow you to set the UA. I have a busy day tomorrow but I'll get the code to you tomorrow night.
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#10
2012-11-27, 11:51 AM
That would be great if it works. There's no rush for it though.... I doubt I'll get another chance to look at it until the weekend.

The proxy thing did work, but it just screamed "not robust and never will be" at me Smile

Iain
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (5): 1 2 3 4 5 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Video streaming URL and parameters? cncb 1 1,758 2021-10-22, 06:58 PM
Last Post: sub
  Looking for C# UPnP Media Server code bgowland 5 7,556 2016-12-16, 08:25 PM
Last Post: mvallevand
  Media Browser Integration lukemb3 557 148,269 2015-11-29, 05:27 PM
Last Post: UncleJohnsBand
  Media\Show Directory mvallevand 12 6,004 2014-07-02, 10:58 AM
Last Post: sub
  Advice on which streaming method to use fred250 17 6,156 2013-09-14, 11:14 AM
Last Post: fred250
  Media\Shows Metadata mvallevand 2 1,828 2013-05-22, 04:09 AM
Last Post: mvallevand
  On-the-fly transcoding for streaming recordings / videos bgowland 6 3,982 2012-06-03, 03:10 AM
Last Post: bgowland
  Building a list of files in media folders (npvr Music and Videos) bgowland 2 1,847 2012-02-05, 10:29 AM
Last Post: bgowland
  NPVR HTTP streaming bug? tmrt 3 1,819 2010-12-28, 11:48 PM
Last Post: tmrt
  Windows Media Connect - Storing stuff on a Home Server psycik 3 2,636 2009-09-29, 03:47 AM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode