thibauts / node-upnp-mediarenderer-client

An UPnP/DLNA MediaRenderer client
MIT License
125 stars 30 forks source link

Upnp Error Resource not found (716) #8

Closed wallydz closed 9 years ago

wallydz commented 9 years ago

{ [Error: Resource not found (716)] code: 'EUPNP', statusCode: 500, errorCode: '716' } Trace at /Users/wally/po/dlna/node-upnp-mediarenderer-client/test.js:18:9 at /Users/wally/po/dlna/node-upnp-mediarenderer-client/index.js:46:22 at IncomingMessage. (/Users/wally/po/dlna/node-upnp-mediarenderer-client/node_modules/upnp-device-client/index.js:132:18) at IncomingMessage.EventEmitter.emit (events.js:117:20) at _stream_readable.js:919:16 at process._tickCallback (node.js:419:13)

/Users/wally/po/dlna/node-upnp-mediarenderer-client/test.js:19 throw err;
^ Error: Resource not found (716) at IncomingMessage. (/Users/wally/po/dlna/node-upnp-mediarenderer-client/node_modules/upnp-device-client/index.js:128:21) at IncomingMessage.EventEmitter.emit (events.js:117:20) at _stream_readable.js:919:16 at process._tickCallback (node.js:419:13)

thibauts commented 9 years ago

Are you OK the distant resource doesn't 404 ?

Can you try to play a local resource and make sure the HTTP request is sent ? Maybe something like nc -l -p 8000 (netcat) and try to stream http://your-local-ip:8000/foo.avi

wallydz commented 9 years ago

Tried with nc and tried to stream foo.avi no activity on nc ( i tested by normal browser i had activity ) but with the TV it dont even connect to it / Error: Resource not found (716) but does not try to connect to the address

thibauts commented 9 years ago

OK. Can you try to set contentType to video/vnd.dlna.mpeg-tts in load() options (along autoplay), and repeat the test ?

wallydz commented 9 years ago

Sorry i added ' ' to video/vnd now i have result HEAD /foo HTTP/1.0 getcontentFeatures.dlna.org: 1 Host: 192.168.0.118

EDIT : trying something else give us the same error

thibauts commented 9 years ago

Ok so now you're receiving a request from your TV right ?

wallydz commented 9 years ago

Connection from [192.168.0.116] port 80 [tcp/http] accepted (family 2, sport 49429) HEAD /EG_example_JPG_RIP_010.jpg HTTP/1.0 getcontentFeatures.dlna.org: 1 Host: 192.168.0.118 Right

thibauts commented 9 years ago

OK. You'll need a little express server / proxy with specific DLNA headers to go further. I have the code at home and will get back to you around 8pm GMT+1.

wallydz commented 9 years ago

Code : https://gist.github.com/wallydz/a2d4901fb09aac68a108

thibauts commented 9 years ago

The code is way more complicated than it could be but the headers look right. There is an additional trick to get subtitles (for some devices) in the same sweep. I'll post code here later today.

wallydz commented 9 years ago

Oh great thank you

thibauts commented 9 years ago

Here it is : https://gist.github.com/thibauts/5f5f8d8ce6566c8289e6

It will serve your current directory, should set the appropriate content-type, and demonstrates how to use subtitles on some devices (one Samsung TV tested so far).

Edit: code updated.

wallydz commented 9 years ago

Thank you very much

jaruba commented 9 years ago

I'm trying to use node-upnp-mediarenderer-client with a Samsung Smart TV too, I got my device description url with node-ssdp, it looks like this:

https://gist.github.com/jaruba/72af14e70e7cd2b47ed8

(it's very similar to the one @wallydz pasted in this post)

I'm also getting this error:

Uncaught Error: Resource not found (716)

My test code:

var MediaRendererClient = require('upnp-mediarenderer-client');

var client = new MediaRendererClient('http://192.168.1.100:7676/smp_20_');

var options = { 
    autoplay: true,
    contentType: 'video/mp4',
    metadata: {
        title: 'Some Movie Title',
        creator: 'John Doe',
        type: 'video' // can be 'video', 'audio' or 'image'
    }
};

client.load('http://commondatastorage.googleapis.com/gtv-videos-bucket/big_buck_bunny_1080p.mp4', options, function(err, result) {
    if(err) throw err;
    console.log('playing ...');
});

Can I only stream local videos by creating a local http server with custom headers? I've had no luck yet while testing the code in this post..

thibauts commented 9 years ago

Most probably, yes. I've had no luck either streaming remote video (on a Sony Bravia). Please try with a local server and post feedback here.

jaruba commented 9 years ago

Works flawlessly with a local server. You've done some amazing work! :)