Changes between Version 44 and Version 45 of Video_Users_Guide
- Timestamp:
- Mar 21, 2012 5:07:56 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Video_Users_Guide
v44 v45 26 26 {{{ 27 27 $ ./configure --enable-shared --disable-static --enable-memalign-hack 28 # add other options if needed, e.g: optimization, install dir, search path particularly CFLAGS and LDFLAGS for x264 28 # add other options if needed, e.g: optimization, install dir, search path 29 # particularly CFLAGS and LDFLAGS for x264 29 30 # to enable H264, add "--enable-gpl --enable-libx264" 30 31 $ make && make install … … 32 33 1. Optional for H.264: [http://www.videolan.org/developers/x264.html libx264]. We tested with the latest from git (as of October 2011): 33 34 {{{ 34 $ ./configure --enable-static 35 $ ./configure --enable-static # add options if needed, e.g: optimization, install dir, search path 35 36 $ make && make install-lib-static # default install dir is /usr/local 36 37 }}} … … 297 298 {{{ 298 299 const pj_str_t codec_id = {"H264", 4}; 299 pjmedia_vid_codec_param *param;300 pjmedia_vid_codec_param param; 300 301 301 302 pjsua_vid_codec_get_param(&codec_id, ¶m); … … 311 312 {{{ 312 313 /* Sending 1280 x 720 */ 313 p jmedia_vid_codec_param.enc_fmt.vid.size.w = 1280;314 p jmedia_vid_codec_param.enc_fmt.vid.size.h = 720;314 param.enc_fmt.vid.size.w = 1280; 315 param.enc_fmt.vid.size.h = 720; 315 316 }}} 316 317 Note that there is a possibility that the value will be adjusted to follow remote capability. For example, if remote signals that maximum resolution supported is 640 x 480 and locally the encoding direction size is set to 1280 x 720, then 640 x 480 will be used. … … 321 322 {{{ 322 323 /* 1st preference: 352 x 288 (CIF) */ 323 p jmedia_vid_codec_param.dec_fmtp.param[n].name = pj_str("CIF");324 param.dec_fmtp.param[n].name = pj_str("CIF"); 324 325 /* The value actually specifies framerate, see framerate section below */ 325 p jmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("1");326 param.dec_fmtp.param[n].value = pj_str("1"); 326 327 /* 2nd preference: 176 x 144 (QCIF) */ 327 p jmedia_vid_codec_param.dec_fmtp.param[n+1].name = pj_str("QCIF");328 param.dec_fmtp.param[n+1].name = pj_str("QCIF"); 328 329 /* The value actually specifies framerate, see framerate section below */ 329 p jmedia_vid_codec_param.dec_fmtp.param[n+1].value = pj_str("1");330 param.dec_fmtp.param[n+1].value = pj_str("1"); 330 331 }}} 331 332 - H264, the size is implicitly specified in H264 level (check the standard specification or [http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels this]) and on SDP, the H264 level is signalled via H264 SDP fmtp [http://tools.ietf.org/html/rfc6184#section-8.1 profile-level-id], e.g: 332 333 {{{ 333 334 /* Can receive up to 1280×720 @30fps */ 334 p jmedia_vid_codec_param.dec_fmtp.param[n].name = pj_str("profile-level-id");335 param.dec_fmtp.param[n].name = pj_str("profile-level-id"); 335 336 /* Set the profile level to "1f", which means level 3.1 */ 336 p jmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("xxxx1f");337 param.dec_fmtp.param[n].value = pj_str("xxxx1f"); 337 338 }}} 338 339 … … 344 345 {{{ 345 346 /* Sending @30fps */ 346 p jmedia_vid_codec_param.enc_fmt.vid.fps.num = 30;347 p jmedia_vid_codec_param.enc_fmt.vid.fps.denum = 1;347 param.enc_fmt.vid.fps.num = 30; 348 param.enc_fmt.vid.fps.denum = 1; 348 349 }}} 349 350 Note that there is a possibility that the value will be adjusted to follow remote capability. For example, if remote signals that maximum framerate supported is 10fps and locally the encoding direction framerate is set to 30fps, then 10fps will be used. … … 354 355 {{{ 355 356 /* 3000/(1.001*2) fps for CIF */ 356 p jmedia_vid_codec_param.dec_fmtp.param[m].name = pj_str("CIF");357 p jmedia_vid_codec_param.dec_fmtp.param[m].value = pj_str("2");357 param.dec_fmtp.param[m].name = pj_str("CIF"); 358 param.dec_fmtp.param[m].value = pj_str("2"); 358 359 /* 3000/(1.001*1) fps for QCIF */ 359 p jmedia_vid_codec_param.dec_fmtp.param[n].name = pj_str("QCIF");360 p jmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("1");360 param.dec_fmtp.param[n].name = pj_str("QCIF"); 361 param.dec_fmtp.param[n].value = pj_str("1"); 361 362 }}} 362 363 - H264, similar to size/resolution, the framerate is implicitly specified in H264 level (check the standard specification, or http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels) and the H264 level is signalled via H264 SDP fmtp {{{profile-level-id}}}, e.g: 363 364 {{{ 364 365 /* Can receive up to 1280×720 @30fps */ 365 p jmedia_vid_codec_param.dec_fmtp.param[n].name = pj_str("profile-level-id");366 p jmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("xxxx1f");366 param.dec_fmtp.param[n].name = pj_str("profile-level-id"); 367 param.dec_fmtp.param[n].value = pj_str("xxxx1f"); 367 368 }}} 368 369 … … 374 375 {{{ 375 376 /* Bitrate range preferred: 512-1024kbps */ 376 p jmedia_vid_codec_param.enc_fmt.vid.avg_bps = 512000;377 p jmedia_vid_codec_param.enc_fmt.vid.max_bps = 1024000;377 param.enc_fmt.vid.avg_bps = 512000; 378 param.enc_fmt.vid.max_bps = 1024000; 378 379 }}} 379 380 … … 385 386 {{{ 386 387 /* H263 specific maximum bitrate 512kbps */ 387 p jmedia_vid_codec_param.dec_fmtp.param[n].name = pj_str("MaxBR");388 p jmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("5120"); /* = max_bps / 100 */388 param.dec_fmtp.param[n].name = pj_str("MaxBR"); 389 param.dec_fmtp.param[n].value = pj_str("5120"); /* = max_bps / 100 */ 389 390 }}} 390 391