nesterenkodm / pjsip

PJSIP is Open Source SIP, Media, and NAT Traversal Library
495 stars 220 forks source link

Incorrect video view #88

Closed fatenumber25 closed 4 years ago

fatenumber25 commented 5 years ago

First thank you very much for great framework.

I am using version 2.9.0.2 of PJSIP to make audio call and video call.

The audio call working great, but in video call the video view showing incorrect as bellow. But same code working perfectly in version 2.6.1. Please tell me how to fix this issue. And how to setting params to make HD video call.

IMG_0259

IMG_7379

welljsjs commented 5 years ago

Hey @fatenumber25,

thanks for reporting.

You'll make our maintainers' lives way easier if you'd use the provided template when creating an issue. Would you mind filling out our template?

As for now, afaik, it depends on the codec that you're using. H.264 supports HD video transmission. https://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__CODEC__VID__CODECS.htm

fatenumber25 commented 5 years ago

Hey @welljsjs

Thanks for quick reply and sorry about reporting without template.

I'm glad to report again as bellow.

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expected Behavior

Current Behavior

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. pjsua_init and pjsua_start without any setting of pjmedia_vid_codec_param
  2. Make audio call as bellow
    pjsua_call_setting_default(&call_opt);
    call_opt.aud_cnt = 1;
    call_opt.vid_cnt = 0;
    pjsua_call_make_call(my_acc_id, &dest, &call_opt, NULL, NULL, &callId);
  3. When audio call connected, update to video call for self and partner with under code
    pjsua_call_setting_default(&call_opt);
    call_opt.aud_cnt = 1;
    call_opt.vid_cnt = 1;
    pjsua_call_update2(callId, &call_opt, NULL);
  4. After got callback of video update using default_mod_on_rx_response, start stream video with under code
    pjsua_call_set_vid_strm(callId, PJSUA_CALL_VID_STRM_START_TRANSMIT, NULL);
  5. After got callback of media update using on_call_media_state, start display window incoming video as below
    if ( ci.media[mi].type == PJMEDIA_TYPE_VIDEO && ci.media[mi].status == PJSUA_CALL_MEDIA_ACTIVE ){
    displayWindow(ci.media[mi].stream.vid.win_in);
    }
  6. Finally I got the video view as attachment image

※ I'm tried to setting pjmedia_vid_codec_param as bellow too, but got any lucky.

const pj_str_t codec_id = {"H264", 4};
pjmedia_vid_codec_param param;
pjsua_vid_codec_get_param(&codec_id, &param);
param.enc_fmt.det.vid.size.w = 640;
param.enc_fmt.det.vid.size.h = 480;
//    param.enc_fmt.det.vid.fps.num = 30;
//    param.enc_fmt.det.vid.fps.denum = 1;
////    param.enc_fmt.det.vid.avg_bps = 512000;
////    param.enc_fmt.det.vid.max_bps = 1024000;
param.dec_fmt.det.vid.size.w = 640;
param.dec_fmt.det.vid.size.h = 480;
//    param.dec_fmt.det.vid.fps.num = 30;
//    param.dec_fmt.det.vid.fps.denum = 1;
//    param.dec_fmtp.cnt = 2;
//    param.dec_fmtp.param[0].name = pj_str("profile-level-id");
//    param.dec_fmtp.param[0].val = pj_str("42e01e"); //pj_str("42e01f");
//    param.dec_fmtp.param[1].name = pj_str("packetization-mode");
//    param.dec_fmtp.param[1].val = pj_str("1");
pjsua_vid_codec_set_param(&codec_id, &param);

※ When I'm did same thing in version 2.6.1, I'm got correctly incoming video, but it's not HD video. I'm tried to change setting encode, decode video size too but got more bad quality of video. I don't know why and how to fix that. Please help me!!

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

welljsjs commented 5 years ago

Thanks for the update. Unfortunately, your issue is not related to this repository.

As stated in the README and as you apparently mistakenly confirmed by checking "I'm reporting the issue to the correct repository as it is related to this repository and not to the official pjsip repository" in the prerequisites section of the issue, this repository aims to provide compiled pjsip libraries, available via Cocoapods, for Apple platforms.

However, we are not responsible for nor maintaining any part of the original source code related to pjsip.

I hope this made things a little clearer.

Anyhow, I think the reason why your video is not hd is that you're explicitly setting the video size.

Have a look at the following docs: https://www.pjsip.org/pjmedia/docs/html/structpjmedia__video__format__detail.htm

You're setting it to 640x480, that's not HD.

github-actions[bot] commented 4 years ago

This issue is stale because it had been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Meonardo commented 3 years ago

@fatenumber25 got any solutions for the issue? I currently have delay issue with video decoding(8-10s in general), when I upgrade to the latest version(2.9.0.2). works great when downgrade to 2.8.0.

SaurabhForcebolt commented 1 year ago

Hi @fatenumber25 I am also getting the same issue but works great when downgraded to 2.8.0. but it is working only on MacOS(Designed for iPhone) but when I try it on a real device crash app.

libsp.dylib`spd_checkin_socket.cold.1: 0x1f9211364 <+0>: adrp x8, 150347 0x1f9211368 <+4>: adrp x9, 0 0x1f921136c <+8>: add x9, x9, #0xa3f ; "Linked against modern SDK, VOIP socket will not wake. Use Local Push Connectivity instead" 0x1f9211370 <+12>: str x9, [x8, #0xd80] -> 0x1f9211374 <+16>: brk #0x1

How to resolve this issue?