mbebenita / Broadway

A JavaScript H.264 decoder.
Other
2.73k stars 424 forks source link

onPictureDecode not firing the callback #249

Open irwansyah195 opened 1 year ago

irwansyah195 commented 1 year ago

hii , i want show RTSP stream video using SignalR and show it in web view using broadway , i already have the data from SignalR but onPictureDecode not firing my callback , please correct me if i wrong ?

Data After convert : Data rawframe after convert

Data Before Convert : Data rawframe before convert

CCTV Config : CCTV config is my NAL Units is correct and my CCTV encode is support broadway decoder ?

  var connection = new signalR.HubConnectionBuilder().withUrl("/VideoStreamHub").build();
        var decoder = new Decoder({
            rgb: true,
            sliceMode: 0
        })

        decoder.onPictureDecoded = function (buffer, width, height) {
            console.log("onPictureDecoded")
        };

        connection.on("ReceiveFrame", function (frameData) {
            try {
                var data = toUint8Array(frameData);

                console.log(data);
                decoder.decode(data);

            } catch (error) {
                console.log(error)
            }

        });

        var toUint8Array = function (parStr) {
            var raw = window.atob(parStr);
            var rawLength = raw.length;
            var array = new Uint8Array(new ArrayBuffer(rawLength));

            var i;
            for (i = 0; i < rawLength; i++) {
                array[i] = raw.charCodeAt(i);
            }

            return array;
        };

can someone help me , i have stuck with this more than 1 week .

stoefln commented 7 months ago

Same here! Did you find any solution @irwansyah195 ?

wakawaka666 commented 3 weeks ago

兄弟 解决了吗