Unable to use QWebView to view ip camera feeds?
-
Hello all,
i'm a beginner in programming. I came across Qt Project as it can support various systems.
I tried using QWebView in my GUI and tested sites like Google and YouTube. Both websites are working fine.
However, my aim of the project is to receive the feeds from IP camera(mjpeg).@ui->webCam->load(QUrl("http://192.168.1.23:50001/videofeed"));
ui->webCam->show();@I tried the code as shown above, but the results is shown below.
--Ba4oTvQMY8ew04N8dcnM Content-Type: image/jpeg ÿØÿàJFIFÿÛC (1#%(:3=<9387@H\N@DWE78PmQW_bghg>Mqypdx\egcÿÛC//cB8BccccccccccccccccccccccccccccccccccccccccccccccccccÿÀð@"ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚâãäåæçèéêòóôõö÷øùúÿÚ?±Ò“RÖ&À)àqL§ƒÅ0Šn)ÆšEÒçÜÑÖÎi@¦Ž)ÚSíIKE0ƒE” ):“¥¦h¥4†€–’ŒÐ(¤ šm-!4†£jy¦51=0ŠúÓ4¦ÍHi>´€aRÒBi)i¦i†œi¦€iŒ¹© !Ñæ”
¥%´‚Ú˜‚šiM%4Òf† p(—4‚@¢Š)€QŠP( â—¥¤&€šM úP0h=( ¤¥4Ú
QE“´iâ¢<šÓH¦dS HÇ°¨È DmQÔÅDMÒh&›Ö šCKI@4Šu5 i¦Š oŠwJhâ”sHc§Š‹¥H¼Ðâšiôc4ÄCŠB´ÜP1)E.1@ IFhi ¤Í%4„ÑIšZ))hRQEŒQGZÚZ(†Š)ˆi¦O4Ö4€ŒÔliìj3Å#4Âiæ˜i€Ê(4ibÒæšh ¤ÇsNÅ4õ ëF)h<ÒtRÓzÓñHbSÒš)GÀ˜t¥Å1ZŸLBbšE<Óh„QšqÓHbQIFhQšJJ-RPÑEQE€ÑÚƒILú ZJ(è))(„Ó =©”ÃL"¤5P"3íL"¤Å0ÐdSI§ša B ”RbŠC@ HhÍ(éH ÕìQKšC¤ÍÍÀU5(5Ó³M“4”Ðihi u¥4ŒŒSjFÂ)CIKŠ1@Ä¥¢ŠQI@ (£4„Ð ¤¢‚h(¢Š
4ÑE! 4†ƒHzP!Í4Ó© #ja§µ7 a+S ÒŠ:š ¦ŸzZC@ E%nn§šŽž8#Iš â’˜ 4üÔc=hâœ)´áLw RÐiZ~) ##ÓRL"ÆÑš)(¹£4”Pš)(QE(¢š%! š 4ÓM8Óh†šiÔÓ@ "˜iÆšhƨHÔÃ@ ¦šu6 E%-!¦ÓñM4µNš:RHc‰¥£Í(4 §Qæ€hu4ñP«T¡©€áJ)£4ÀZJ3EÓ >“†FE4Ô„TfŠJ(i3IK@“©¥ 4”RS¤ÍñI@„¤&”Óh)(ëHM1j3O4ÓHDmL4òi„f€HiM4Ð!(¤4PæšzÒö¤ ŒàRf›ÞŽ´†(äÓ…b‚h&€ÔÂrh U¹©¸ªÀ✖•©ÙªÂJp’Àœp¨ƒSÃñ@R”€ñFi€˜¦0§ÓH¤2#IRM"ÆÑE ’Š;PM¥Í4ÐFh¤¦!¦ƒÒƒHM!¦ÒæÐ!)¬)Ý8¦š0ÓO4ãL&€E0óO4Ú4ÒRÓq@ÖŠ1Ekb”RÒRM¥&’€)§Kši4‡ŠMÝi ¦HcÃbœ%ÅB[Š…ž—„ù©VZËY©Rj.;ªù§†ªÍÅXI3T˜¬XÎMµ?4ÄƧgµ!ë@ÈȤ§°¦š‘ˆ}) /zC@ IEfž(Å!¦!¦Ó0óÅ JZCÒ€˜M; ¦Ð!¦˜iæ˜Gz4Ó§ÓM0ÑÒ–šy šL⊠lša4óQšC4™âŒRJPx¤<Ð8-FE0‚MXÛÅ4¥+?Âjß•“A@)¦SƒƒVEBÆ*¾*ÌRÕ1Á§«bšI&jPÜUߊ°š¤ÄXÝJ D§4ðsÅP‡u¤"–Ði¦ži†Ä4”J/Zi4¹Å0šJhâ—9¤ AM4¤ÒP!½i )⓵4ñM=)Çši¦!†’œi¦€E6žÔÚm´™ ¢)¤SéâM¥ÇÃÅ!ˆ)Úa 6(\ÑQ¥/@bC#ã4Žõ]ß4‡¨‹æ£fæ4Ž$ö¤1Ã-kÛhr2î“9=©n4rƒ#4X.Œ¥fQE
8©8uÁëQÒ©Á¦È ¶õRdV¬¨$JÈž3™ìi›|H´¦ŸU¢|ŠœD¹ÎeéPŠzšÝǺ‡Rê¶<·Á¨î"ÆF(ìpÌ$´Z:•™Ë(¬ÃÁ¬ö4Z“¥¢SRT€uŠCLBSM)¦šNô‡š@¥&h4(¤£µ&hM2”ô¤è(;Ð;Ò´¸ šn)ÇÚ›Ú€Ži¤w§œ aæ€/ 75j±mv'¥Iq3±jÎݦp£ñ®ªÎÝ
ˆ¦—f"@ÄsZb©Y¯…ES9Å¢’ŠZ(¢˜SŠ†ê"’œF ¨»3I‰Êš´®É¥¾·Ï̽köèÃlq÷ºS5äçØÓ[…-ŒÕ…Mqypdx\egcÿÛC//cB8BccccccccccccccccccccccccccccccccccccccccccccccccccÿÀð@"ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…*Chrome, Safari, Firefox are all able to view http://192.168.1.23:50001/videofeed
I tried using QMediaPlayer too, but there is error when opening up the url.
So am i on the right track using QWebView? or should i use some other widget? or can QWebView support mjpg? (plugins or ?)
Thank you.
-
An MJPEG stream over HTTP is a series of JPEG images separated by a MIME-style boundary (See "M-JPEG_over_HTTP [Wikipedia]":http://tinyurl.com/cqleg2c). Qt has no M-JPEG decoder image plugin. You need to pull the stream apart at the boundaries and deal with the individual JPEG images.
What you have shown is a Content-Type header followed by a valid looking JPEG file payload (treated as text). The gibberish before "Content-Type" is probably the preceding boundary marker, making this the second or later image.
-
Thanks Chris.. I saw this post regarding qimagegrabber too. Do you have any idea how to use it?