thibauts/node-upnp-mediarenderer-client

Upnp Error Resource not found (716)

wallydz opened this issue · 15 comments

{ [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)

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

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

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

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

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

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

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.

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.

Oh great thank you

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.

Thank you very much

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..

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.

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