andrew-ld / smart-tv-telegram

stream movies from telegram to smart tv
GNU Affero General Public License v3.0
177 stars 54 forks source link

Streaming not working on Sony KD-55XE9005 #16

Closed Jake-double-one closed 1 year ago

Jake-double-one commented 3 years ago

Hello! I really like this bot and enjoy it in my office. But my smart TV in my living room is driving me crazy ;-)

Environment: Docker container on Synology DS718+ Problem-TV: Sony KD-55XE9005

Forwarding the video and the bot lists the TV twice (tried both). On TV nothing happens. Telegram prints error message. Same video(s) working on my office TV.

Here is the error log from docker: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/smart_tv_telegram/bot.py", line 183, in _select_device await device.stop() File "/usr/local/lib/python3.9/site-packages/smart_tv_telegram/devices/upnp_device.py", line 92, in stop raise error File "/usr/local/lib/python3.9/site-packages/smart_tv_telegram/devices/upnp_device.py", line 89, in stop await stop.async_call(InstanceID=0) File "/usr/local/lib/python3.9/site-packages/async_upnp_client/client.py", line 521, in async_call raise UpnpError('Error during async_call(), status: %s, body: %s' % async_upnp_client.client.UpnpError: Error during async_call(), status: 500, body: <?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>701</errorCode><errorDescription>Action Stop failed </errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope

Error message in Telegram: Error during async_call(), status: 500, body: <?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>701</errorCode><errorDescription>Action Stop failed </errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>

ini-file: [discovery] upnp_enabled=1 upnp_scan_timeout=3 chromecast_enabled=1 chromecast_scan_timeout=3 xbmc_enabled=0 xbmc_devices=[{"host": "192.168.42.140", "port": 8080},] vlc_enabled=0 vlc_devices=[{"host": "127.0.0.1", "port": 4212, "password": "123"},] device_request_timeout=3

I hope this information are enough to help me with this problem and hope it's not my TV ;-)

Cheers! Jake

andrew-ld commented 3 years ago

interesting, apparently this tv sends a non-standard stop error

andrew-ld commented 3 years ago

try with this commit

https://github.com/andrew-ld/smart-tv-telegram/commit/e62be82b8436331cfb9ef5a1ec8c14f169e2032b

Jake-double-one commented 3 years ago

I redownloaded the docker image and emptied the container, but it's still not working. Additionally, I tried to find the file "upnp_device.py" in the container unsuccessfully.

I'm not sure how to make the changes because I'm not very experienced. For any additional info I would be very thankful! Many thanks in advance!

andrew-ld commented 3 years ago

gives the same problem?

Jake-double-one commented 3 years ago

Unfortunately not.

TV still listed twice after forwarding. Choosing one (tried both), the play and pause button appear, TV is switching and message "Video kann nicht abgespielt werden" [German, "Video cannot be played."] appears on TV.

Log from docker (reversed):

2021-04-21 17:07:09 | stdout | </errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
2021-04-21 17:07:09 | stdout | async_upnp_client.client.UpnpError: Error during async_call(), status: 500, body: <?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>701</errorCode><errorDescription>Action Pause failed
2021-04-21 17:07:09 | stdout | raise UpnpError(
2021-04-21 17:07:09 | stdout | File "/usr/local/lib/python3.9/site-packages/async_upnp_client/client.py", line 557, in async_call
2021-04-21 17:07:09 | stdout | await play.async_call(InstanceID=0)
2021-04-21 17:07:09 | stdout | File "/usr/local/lib/python3.9/site-packages/smart_tv_telegram/devices/upnp_device.py", line 208, in handle
2021-04-21 17:07:09 | stdout | await device_function.handle()
2021-04-21 17:07:09 | stdout | File "/usr/local/lib/python3.9/site-packages/smart_tv_telegram/bot.py", line 163, in _device_player_function
2021-04-21 17:07:09 | stdout | await handler.callback(self.client, *args)
2021-04-21 17:07:09 | stdout | File "/usr/local/lib/python3.9/site-packages/pyrogram/dispatcher.py", line 217, in handler_worker
2021-04-21 17:07:09 | stdout | Traceback (most recent call last):
2021-04-21 17:07:09 | stdout | </errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
2021-04-21 17:07:09 | stdout | ERROR:pyrogram.dispatcher:Error during async_call(), status: 500, body: <?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>701</errorCode><errorDescription>Action Pause failed
2021-04-21 17:06:35 | stdout | (Press CTRL+C to quit)

No error message in Telegram.

It took me a bit to understand in Synology Docker the commits are not chronological. So this one was at the bottom of the version list to pick

andrew-ld commented 3 years ago

in this case it means that the video has been encoded in a format that is not supported by the TV, I don't support transcoding because the bot is mainly running on an arm board and it would be computationally impossible to do so.

Jake-double-one commented 3 years ago

Oh, that's bad news. I really don't know the effort of it, but how about making this a setting and the user can decide? I would guess even a Rasp Pi 4 would decode pretty smooth.

andrew-ld commented 3 years ago

let's say it's a bit complex to manage because I should pass the buffer received from mtproto to ffmpeg, if it was a sequential stream it was easy but I have to implement the stream seek

Jake-double-one commented 3 years ago

Well, if this is no option for you, then you can close this one here. Unfortunately, that screen is the biggest in my house... Otherwise, leave it open, and I can do the tests for you. But I won't be at home for the next two weeks.

However, thank you for your help :-)