I introduced you to how to automatically retrieve the text message of the specified user, and use the html template to automatically play the text message on the qt control. However, in the smart mirror, we can also push the video message to the specified user and display the video in real time. The news, here to further introduce how to achieve automatic retrieval and playback of video messages on the magic mirror based on the dragonboard 410c.
Similar to retrieving a text message, the path of the video message is saved in the pushInfo table in the smart mirror database we built. If the field in the table is infoType==1, it is a video message, and this time in the pushInfo table. The filePath will record the specific address of the video, which can be either the cloud or the local video path, and can be supported. Also in the video message, the fields isTop and viewWight still play their role, which can control the playback of the video. Sequence and whether to play, if isTop is 1 means that the video will play preferentially. If isTop of multiple video messages is 1, then it will be sorted according to chronological order. If viewWight is 0, the message has been played and is no longer played, according to the above rules. This article builds the getTextMessageList(self,userID) function in the database class to complete the retrieval of the video message of the specified user. The specific implementation code is as follows:
Def getUserVideoMessageList(self,userID):
Format="select pushID,filePath from pushInfo where ownerID==%u and isTop==1 and infoType==1 order by pushTIme desc"
Values=(userID)
querySQL1=format % values
Self.cu.execute(querySQL1)
Result1=self.cu.fetchone()
#print result
Format="select pushID,filePath,pushTIme from pushInfo where ownerID=%u and isTop==0 and infoType==1 order by pushTIme desc"
Values=(userID)
querySQL2=format % values
Self.cu.execute(querySQL2)
Result2=self.cu.fetchone()
If result1!=None and result2 != None:
#result=result1+result2
Return result1+result2
Elif result1==None and result2!=None:
#result=result2
Return result2
Elif result1!=None and result2 == None:
#resutl=result1
Return result1
Else:
#result==None
Return None
In the above code, the ID of the message will be returned: infoID, and the video path: filePath will be returned in the form of a list. After the user obtains the list, the video player can be called to load the video list and play it. Here we use mplayer video playback. To realize the video playback, the specific usage and control method of the player can refer to the content of the blog I used to write the video using mplayer on the 410c board. Here we directly upload the code, the specific playback is as follows :
#show message end get video message info
If videoMsgList!=None:
Print("start play video msg")
i=0
For videoMsg in videoMsgList:
If i%2==0:
Print(videoMsg)
self.push_video_userID.append(videoMsg)
Else:
Print(videoMsg)
self.videoPathList.append(videoMsg)
i=i+1
Videocmd="mplayer -vo x11 -playlist "
For video in self.videoPathList:
Videocmd=videocmd+' '+video
Os.system(videocmd)
This code is integrated into the text message display code segment, and the video can be automatically played in order after the text message is loaded. At the same time, the text message can also be played back in the loop, and the video will automatically exit after the video is played. .
Here we have realized the core functions of the message display and video playback of the smart mirror. We will further introduce how to integrate the face recognition technology introduced before, get the user ID through face detection, and then according to ID completes the user's video, text message retrieval, display and playback.
Tempered glass refers to the formation of compressive stress on the surface of ordinary glass through chemical or physical means in order to increase the strength of the glass. When the tempered glass is subjected to external forces, it will first offset the surface stress, thereby improving the load-bearing capacity and enhancing the wind pressure resistance, cold and heat resistance, and impact properties of the glass itself.
The impact strength of tempered glass of the same thickness is 3 to 5 times that of ordinary glass, and the bending strength is 3 to 5 times that of ordinary glass. Tempered glass has good thermal stability, can withstand a temperature difference of 3 times that of ordinary glass, and can withstand a temperature difference of 300°C.
High polymer impact resistant material, high elasticity and high toughness, 360° bending without deformation. At the same time, it can effectively disperse the impact, strengthen the edges, and prevent the mobile phone from breaking the screen.
Full screen strong adsorption, full coverage without seams, no white edges and no dust.
Ultra-thin thickness, as thin as invisible, does not increase the thickness of the phone. At the same time strengthen the hardness, wear resistance and scratch resistance.
Ultra-high-definition visual experience, upgraded original color display technology, high-definition and high transparency, more realistic colors, and more shocking vision.
9D Glass Film,Tempered glass film,Toughened film,Mobile phone screen film
Shenzhen Customized Technology Co., Ltd. , https://www.protectionfilm6.com