Search code examples
androidpjsip

Invalid or unsupported video capability (PJMEDIA_EVID_INVCAP)


Invalid or unsupported video capability (PJMEDIA_EVID_INVCAP) In Pjsip in android while setting preview size

                   MediaSize size=new MediaSize();
                    size.setH(200);
                    size.setW(200);
                    SipService.currentCall.vidPrev.start(vidPrevParam);
                    SipService.currentCall. vidPrev.getVideoWindow().setSize(size);

Solution

  • This occurs due to unsupported properties. You can not modify Windows size directly so you should be using codec 264 for encoding video

    To resize the window preview you should be enable codec H264.check this ticket for How to enable codec.

    You should rebuild *.so file with added below line config_site.h.

     define PJMEDIA_HAS_OPENH264_CODEC      1   
    

    After that, you can resize preview windows I refer this doc Modifying video codec parameters for video call

    Now in Android, you resize like below

            VidCodecParam param = JacquesApp.ep.getVideoCodecParam("H264/97");
            MediaFormatVideo formatVideo = param.getEncFmt();
            formatVideo.setHeight(352);
            formatVideo.setWidth(288);
            param.setEncFmt(formatVideo);
            endPoint.setVideoCodecParam("H264/97", param);