thibauts / node-upnp-mediarenderer-client

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

Error: Illegal MIME-type (714) #10

Closed wallydz closed 9 years ago

wallydz commented 9 years ago

Hello,

This almost happen only with LG Tv any idea?

Thank you !

thibauts commented 9 years ago

Can you give me a link to your code ?

wallydz commented 9 years ago

Hello, https://git.popcorntime.io/stash/projects/MIR/repos/dlna-js/browse

And https://git.popcorntime.io/stash/projects/PT/repos/popcorn-app/browse/src/app/lib/device/dlna.js?at=refs%2Fheads%2Fmaster

Thank you again

thibauts commented 9 years ago

Ok. You'll have to provide the correct contentType in load options. I made it optional by using a default of video/mpeg but the protocol requires it, and many devices will break if not provided the correct info.

You should be able to solve your problem by providing the correct MIME type both in loadoptions and in the Content-Type header of your http server. If you do that and still get the 714 error, the device doesn't support the format you're trying to make it play anyway.

I implemented a getSupportedProtocolsmethod on the client that returns all supported protocols / MIME types and may help debugging. You'll find it here

Keep me updated on your results :)

wallydz commented 9 years ago

Hello sorry for delay i had to push some changes into Popcorn

here is the output of LG protocols https://gist.github.com/wallydz/c86a4d7eb009c1e75aa6

thibauts commented 9 years ago

Great. What are you trying to play ? Have you tried setting the correct / best-matching MIME type from the protocol list ? Which one is it ?

wallydz commented 9 years ago

video/mp4 and they are trying to play mp4 file

thibauts commented 9 years ago

OK so :

If this is validated, the only left option is that the TV doesn't like the actual stream sent to it. This could happen for multiple reasons like the container not really being an mp4 or the codecs or codec profiles not being supported.

wallydz commented 9 years ago

I tried everything but LG TV dont want to listen ^^

https://discuss.popcorntime.io/t/tv-lg-42la7408-zb-stated-but-doesnt-stream/10641/111 maybe it help content of xml?

thibauts commented 9 years ago

The TV probably doesn't like the h246 profile of the video stream. You could suggest to your user to try to stream the file using a regular UPnP media server and see what happens. If it doesn't have the same error then there may be something to do in this module, else there's no hope !

wallydz commented 9 years ago

They are telling they are able to play from PLEX the same video This is their tests https://discuss.popcorntime.io/t/tv-lg-42la7408-zb-stated-but-doesnt-stream/10641/8

thibauts commented 9 years ago

I understand popcorntime plays torrents. Is plex able to play the same torrents ? I mean exactly the same one

wallydz commented 9 years ago

Plex is playing the h264 file rather than the torrent and for PT they download torrent then create http server to stream the h264 file using Peerflix

thibauts commented 9 years ago

does plex stream to the TV using UPnP without any transcoding ? I'm not really aware of what plex does

wallydz commented 9 years ago

ah Plex is different its UPNP Media Server

thibauts commented 9 years ago

I don't have time right now but I'll think about it. I don't know what goes wrong

thibauts commented 9 years ago

Could you show me the code for both your streaming server and your calls to upnp-mediarenderer-client ?

wallydz commented 9 years ago

Hello, https://git.popcorntime.io/stash/projects/PT/repos/popcorn-app/browse/src/app/lib/device/dlna.js?at=refs%2Fheads%2Fmaster

and https://git.popcorntime.io/stash/projects/MIR/repos/peerflix/browse/index.js for streamer

Thank you for your time i will keep looking

thibauts commented 9 years ago

Thanks. Could you remove the space near the end of the header here ?

Are you sure getType(file.name) here returns video/mp4 ?

Are you sure the video being played when getting this error is an mp4 ?

These are very important questions to settle once and for all, because once they are validated we can say for sure that it's a matter of unsupported format / codecs.

thibauts commented 9 years ago

Of course, you may want to remove this too, as it will generate a bogus header as it is :

response.setHeader('CaptionInfo.sec', subtitlesUrl)

(unless there always is a subtitle file on the other end and it's encoded in a format the TV set undestands, of course)

wallydz commented 9 years ago

Ok Followed your instructions , for now i disabled CaptionInfo.sec and removed space in the header and i made sure that test video is video/mp4 i will push PR and make them test again

Thank you

thibauts commented 9 years ago

Hi Wally, do you have any feedback about this issue ?

ffMathy commented 9 years ago

Most of the feedback for this issue is located in this forum thread.

https://discuss.popcorntime.io/t/philips-tv-not-working-with-dlna/8664/29

thibauts commented 9 years ago

I think you really need to check the MIME type of the played stream against the device supported MIME types. This way you'll be able to rule out simple incompatibilities and concentrate on real bugs + display a meaningful error message to your user "You TV doesn't support the codecs necessary to play this stream".

ffMathy commented 9 years ago

I agree about that as a good first step. What do you think, @wallydz ?

thibauts commented 9 years ago

No news from @wallydz for a few months, I consider this issue closed.