These are chat archives for AxisCommunications/locomote-video-player

8th
Sep 2016
BHAVIN SHAH
@India_bhavin_twitter
Sep 08 2016 12:50
This message was deleted
This message was deleted
This message was deleted
This message was deleted
This message was deleted
This message was deleted
This message was deleted
Thanks @insonifi Regarding MJPEG support from RTSP. We have done so far like read rtsp packets from network and remove rtp header from packet. Now get payload data from packet using rtppkt.getPayload() and add into one Byte Array variable. When we get marker is set to 1(means last frame) we will put one suitable MJPEG header all payload data in another Byte Array variable .Now convert this Byte Array of frame into Base64 string and display on <img> in HTML. We are getting Image but not in proper format. We have compare with Wireshark and its look like last packet of frame is not matching. What could be the possible way to solve this?
blob
BHAVIN SHAH
@India_bhavin_twitter
Sep 08 2016 12:55
'code'var rtppkt:RTP = new RTP(pkgData, sdp, rtpTiming);
          var mydata:ByteArray = rtppkt.getPayload();
          var packetlength:int = mydata.length;
          Logger.log("getPayload: ", rtppkt.getPayload().length);
          // Logger.log("my image packetlength: ", packetlength);
          // Logger.log("-2: ", data[packetlength - 2]);
          // Logger.log("-1: ", data[packetlength - 1]);
          // var newBytes:ByteArray = new ByteArray();
          // newBytes.writeBytes(mydata, 12);  
            //Logger.log("newBytes", newBytes.length);
        // // Logger.log("newBytes",newBytes);


            var payloadlengthsofar:uint = myImagepayload.length;
            mydata.readBytes(myImagepayload, payloadlengthsofar);
            Logger.log("payloadlengthsofar", payloadlengthsofar);
            if(rtppkt.getmarker() === 1) { 
                var temp:ByteArray = new ByteArray();            
                Logger.log("myimageheader",myimageheader.length);
                myimageheader.readBytes(myfinalimage, 0);
                var finalimagelengthsofar:uint = myfinalimage.length;
                myImagepayload.readBytes(myfinalimage, finalimagelengthsofar);
                Logger.log("myfinalimage length", myfinalimage.length);
                myfinalimage.readBytes(temp, 0);
                myfinalimage.clear();
                myfinalimage = temp;

                 var b64:Base64Encoder = new Base64Encoder();
                 b64.encodeBytes(myfinalimage);


                var we:String = b64.toString();
                ExternalInterface.call("my_function",we);