[YMCS/YDMP Free Trial Program]Yealink would like to offer Free Trial Program of Yealink device management service for our current eligible customers. You can see the details below.
https://www.yealink.com/ydmp-freetrial-2020


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
T46G - Display IP Cam Picture or MJPG Video Stream via DSS Key
Author Message
dialog-se Offline
Junior Member
**

Posts: 2
Joined: May 2015
Reputation: 0
Post: #8
RE: T46G - Display IP Cam Picture or MJPG Video Stream via DSS Key
(03-13-2017 07:50 PM)jolouis Wrote:  2) Wire up a DSS key to launch an XML browser to the server, and have the server run a script that grabs a single frame from the camera, re-sizes it to what the phone expects, and then displays it. Not ideal in any way, but better than nothing.
3) Give up [...]

That's almost exactly how we tried to do it.
Also the HD camera would not let you grab single jpeg frames over http, but insists in making you use rtsp (actually makes sense regarding bandwith), so we grabbed a single frame from the rtsp stream using a Python script on a Windows VM that calls ffmpeg...

It turned out that the whole process from pressing the DSS button to actually seeing the picture would take almost 10 seconds, and most of that was not caused by ffmpeg having to connect to the camera first (also it didn't look nice as the screen would flash multiple times)

So we abandoned this, however just in case the XML might be useful for someone, here's the script I wrote back then:

Code:
from http.server import HTTPServer, BaseHTTPRequestHandler
import string, subprocess

rtspURL = "rtsp://192.168.0.149:554/ucast/11"

yealink_xml = """<?xml version="1.0" encoding="ISO-8859-1"?>
<YealinkIPPhoneImageScreen Beep="no" Timeout="5" LockIn="no" mode="regular">
    <Image verticalAlign="middle" horizontalAlign="middle">http://192.168.0.120/doorcam.jpg</Image>
</YealinkIPPhoneImageScreen>"""

class DoorCamHTTPRequestHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        if(self.path == "/doorcam.jpg"):
            resultimage = subprocess.check_output("ffmpeg.exe -i " + rtspURL + " -f image2 -vframes 1 -")
            
            self.send_response(200)
            self.send_header('Content-type','image/jpg')
            self.send_header('Connection','close')
            self.send_header('Content-Length', len(resultimage))
            self.end_headers()
            self.wfile.write(resultimage);
        else:
            self.send_response(200)
            self.send_header('Content-type','text/xml')
            self.send_header('Connection','close')
            self.send_header('Content-Length', len(yealink_xml.encode()))
            self.end_headers()
            self.wfile.write(yealink_xml.encode());

print("starting http server")
server_address = ('', 80)
# todo: ThreadingMixIn
httpd = HTTPServer(server_address, DoorCamHTTPRequestHandler)
httpd.serve_forever()

192.168.0.120 being the Windows machine this ran on, .149 the camera.
I think you should add some resize / crop depending on the resolution of your camera image.
04-07-2017 06:43 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
Post Reply 


Messages In This Thread
RE: T46G - Display IP Cam Picture or MJPG Video Stream via DSS Key - dialog-se - 04-07-2017 06:43 AM

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  t46g: intercom over speaker rather than headset? asinshesq 23 80,385 07-28-2021 11:04 PM
Last Post: russman
  Bug on XML Browser Image display Tercio 1 5,829 05-22-2019 02:54 AM
Last Post: Mike_Yealink
  T46G - Disable Line Key Configuration ? timalex 13 44,297 04-12-2019 09:23 AM
Last Post: Johnny88
  T46G Call Fwd DSS Key enables / disables ALL fwd types MintTelecom 4 16,485 02-06-2018 05:28 AM
Last Post: Aishion_Yealink
  Automatic message display on T29G yc12843 2 10,091 01-25-2018 08:58 PM
Last Post: yc12843
  T46G 28.82.0.2.0 -- BUG Tyler 1 6,770 09-29-2017 05:58 AM
Last Post: Lucia_Yealink
  T52S on call DSS key display too short tima 3 10,927 08-22-2017 01:13 AM
Last Post: Aishion_Yealink
  2 T46G Phones; Different BLF behavior phoneguy797 7 38,032 04-13-2017 09:33 AM
Last Post: auch
  T29G Display ghosting Chris708 2 8,561 03-14-2017 01:18 PM
Last Post: Chris708
Sad Updating Network on phone display ebrahimkarimi 4 18,342 11-16-2016 01:43 PM
Last Post: Karl_Yealink

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us   Yealink   Return to Top   Return to Content   Lite (Archive) Mode   RSS Syndication