H.264 video encoder confiduration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, PJSIP community!

Question about H.264 encoder configuration still not closed!
I successfully build pj-project, downloaded from svn - revision 4025.
According to advices, given to me, about H.264 encoder configuration, I
added only ONE method to native code of revision 4025:
---------------------------------------------------------------------------------------------------------------
PJ_DEF(pj_status_t) setHD(void)
{
 pj_status_t status;
 const pj_str_t codec_id = {"H264", 4};
 pjmedia_vid_codec_param param;
 status = pjsua_vid_codec_get_param(&codec_id, &param);
 if(status!= PJ_SUCCESS) {
  //PJ_ERROR() get codec param
  return status;
 }
 param.enc_fmt.det.vid.size.w = 1280;
 param.enc_fmt.det.vid.size.h = 720;
 param.enc_fmt.det.vid.fps.num = 5;
 param.enc_fmt.det.vid.fps.denum = 1;
 param.enc_fmt.det.vid.avg_bps = 1024000;
 param.enc_fmt.det.vid.max_bps = 2048000;
 status=pjsua_vid_codec_set_param(&codec_id, &param);
 if(status!= PJ_SUCCESS){
  //PJ_ERROR() set codec param
  return status;
 }
}
---------------------------------------------------------------------------------------------------------------
this method declared in ffmpeg_codecs.h
PJ_DECL(pj_status_t) setHD(void);
I do not need decoding at pjsua side - so I did not use configuration for
decoder  param.dec_fmtp.param[0].name = pj_str("profile-level-id");
param.dec_fmtp.param[0].val = pj_str("42e033"); - this is really not needed
by me.

I call method setHD from method
static int main_func(int argc, char *argv[]) (file main.c)
after execution lines
 if (app_init(argc, argv) != PJ_SUCCESS)
     return 1;

Also I have to change one line in implementetion method
PJ_DEF(pj_status_t) pjmedia_vid_codec_h264_parse_fmtp(const
pjmedia_codec_fmtp *fmtp, pjmedia_vid_codec_h264_fmtp *h264_fmtp)

to stream REAL HD, but not 176x144(updated code):

    /* When profile-level-id is not specified, use default value "42000A" */
    if (h264_fmtp->profile_idc == 0) {
 h264_fmtp->profile_idc = 0x42;
 h264_fmtp->profile_iop = 0x00;
 //h264_fmtp->level = 0x0A;
 h264_fmtp->level = 0x1F;
    }
SO my results:
1. Latency is more than 5 second and increasyng permanently after start
streaming.
2. video quality is not good - encoder works not stable: image become gray,
after that sharpness is not good for HD resolution.
QUESTION1: Why I cannot stream HD video with quality of 1 Mbps?
3. log of video call
  [DISCONNCTD] To: sip:6003 at 192.168.2.134;tag=as152ce637
    Call time: 00h:02m:40s, 1st res in 1132 ms, conn in 1885ms
    #0 audio GSM @8kHz, sendrecv, peer=192.168.2.134:19994
       SRTP status: Not active Crypto-suite: (null)
       RX pt=3, last update:00h:00m:00.983s ago
          total 7.8Kpkt 258.9KB (572.9KB +IP hdr) @avg=13.2Kbps/29.2Kbps
          pkt loss=0 (0.0%), discrd=0 (0.0%), dup=0 (0.0%), reord=0 (0.0%)
                (msec)    min     avg     max     last    dev
          loss period:   0.000   0.000   0.000   0.000   0.000
          jitter     :   0.125   6.267  12.250   5.750   1.190
       TX pt=3, ptime=20, last update:00h:00m:01.061s ago
          total 63pkt 2.0KB (4.5KB +IP hdr) @avg=105bps/234bps
          pkt loss=3 (4.5%), dup=0 (0.0%), reorder=0 (0.0%)
                (msec)    min     avg     max     last    dev
          loss period:  60.000  60.000  60.000  60.000   0.000
          jitter     :  37.750 115.367 264.125  38.000  55.454
       RTT msec      :   0.579   1.147   3.261   1.556   0.473
    #1 video H264, sendrecv, peer=-
       SRTP status: Not active Crypto-suite: (null)
       RX pt=97, size=720x480, fps=22.00, last update:00h:00m:05.312s ago
          total 0pkt 0B (0B +IP hdr) @avg=0bps/0bps
          pkt loss=0 (0.0%), discrd=0 (0.0%), dup=0 (0.0%), reord=0 (0.0%)
                (msec)    min     avg     max     last    dev
          loss period:   0.000   0.000   0.000   0.000   0.000
          jitter     :   0.000   0.000   0.000   0.000   0.000
       TX pt=97, size=1280x720, fps=5.00, last update:00h:00m:00.310s ago
          total 15.7Kpkt 20.23MB (20.86MB +IP hdr) @avg=1.03Mbps/1.06Mbps
          pkt loss=7193 (31.4%), dup=0 (0.0%), reorder=0 (0.0%)
                (msec)    min     avg     max     last    dev
          loss period:   0.000   2.031   4.000   3.000   0.951
          jitter     :   0.000   0.000   0.000   0.000   0.000
       RTT msec      :   1.632   7.245  19.287   2.334   4.540
QUESTION2: Why package loss is to high?
P.S.: I can decrease packege loss only after configured encoder with next
paramanters: 3 FPS, 64-128 kbps.
In other video encoders increasing bitrate usually not cause increasyng
latency, and usually just increasing video sharpness.
QUESTION3: Why here I cannot see this encoder behaviour?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20120406/8a9df241/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux