Hi Fedot, The default h264 level in pjmedia_vid_codec_h264_parse_fmtp() is an attempt to follow this line in rfc6184 8.1: --- If no profile-level-id is present, the Baseline profile, without additional constraints at Level 1, MUST be inferred. --- So I think pjsip behaves properly here, and changing the default h264 level can be risky. The ideal way is to fix the remote endpoint setting. As Bo Shi described, the default video size setting for outgoing is specified in the encoded format field in the codec param, i.e: pjmedia_vid_codec_param.enc_fmt.vid.size. And as H264 level limits the video size, the remote H264 SDP fmtp "profile-level-id" *of remote* should allow this size. If the remote endpoint is also pjsip, the SDP fmtp, e.g: "profile-level-id", can be set in pjmedia_vid_codec_param.dec_fmtp. Note that modifying the default codec param should be done using pjmedia_vid_codec_mgr_set_default_param(), instead of changing the pjsip code directly. The outgoing frame-rate setting can be set the same way as video size setting above, e.g: for 10 fps, just set pjmedia_vid_codec_param.enc_fmt.vid.fps to {10, 1} then pjmedia_vid_codec_mgr_set_default_param(). Regarding quality, usually increasing bitrate will solve the problem. And high packet loss issue is normally caused by network bandwidth limitation. BR, nanang On Mon, Feb 13, 2012 at 11:48 PM, Fedot Fedotov <fedot.fedotov at gmail.com> wrote: > Good day, Bo Shi! > > 1. "profile-level-id in both sides' ffmpeg_codec_desc". Do you mean this > structure?(in ffmepg_codec.c file): > #if PJMEDIA_HAS_FFMPEG_CODEC_H264 > ? ?{ > ? ? ? ?{PJMEDIA_FORMAT_H264, PJMEDIA_RTP_PT_H264, {"H264",4}, > ? ? ? ? {"Constrained Baseline (level=30, pack=1)", 39}}, > ? ? ? ?0, ? ? ?256000, ? ?512000, > ? ? ? ?&h264_packetize, &h264_unpacketize, &h264_preopen, &h264_postopen, > ? ? ? ?&pjmedia_vid_codec_h264_match_sdp, > ? ? ? ?/* Leading space for better compatibility (strange indeed!) */ > ? ? ? ?{2, { {{"profile-level-id",16}, ? ?{"42e01e",6}}, > ? ? ? ? ? ? ?{{" packetization-mode",19}, ?{"1",1}}, } }, > ? ?}, > #endif > > I experimented with bit rate values: set 1024000 and 2048000 instead of 256000 > and 512000 respectively. - it helps. > I changed "Constrained Baseline (level=30, pack=1)" to "Constrained Baseline > (level=31, pack=1)", but it doesn't help. Should it help at all? > I changed "42e01e" to "42e01f" - helped, because "1e" mean 30th level of H.264 > encoder and "1f" mean 31st level. > Are you agree with my settings? > > 2. "default Encoded format (code line 914 of ffmepg_codec.c )" > Yes. It helps. I set "1280, 720, 30000,1001" instead of "720, 480, 30000, 1001". > > 3. Next question: how can I change frame rate? for example I do not need 25 FPS, > I need only 10 FPS. Should I set "1280, 720, 30000, 3000"?(code line 914 of > ffmepg_codec.c) Or I should change some other hard coded code? > > 4. I also tried to configure values: > - PJMEDIA_MAX_MTU 4000 (default 1500) - helps seems like max packet size should > more than default for greater resolution. > - PJMEDIA_MAX_FRAME_DURATION_MS 200 (default 200) - doen't help. > > I achieved video 1280x720, but I dislike quality of video stream: > - high action video causes frames lost, (it even visible by statistics after end > of call) > - after significantly change the frame(when re-paint most part of frame) - video > stream has low resolution quality and appear a lot of bad coded square areas. > > Thank for advice. > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org