Changeset 790:db0b1a806f4a in mediastreamer2


Ignore:
Timestamp:
Dec 2, 2009 4:49:37 PM (3 years ago)
Author:
smorlat <smorlat@…>
Branch:
default
Message:

update to work with new versions of x264

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@778 3f6dc0c8-ddfe-455d-9043-3cd528dc4637

Location:
linphone/mediastreamer2/plugins/msx264
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • linphone/mediastreamer2/plugins/msx264/NEWS

    r525 r790  
     1Wednesday December 2, 2009: msx264-1.3.0 
     2        - use new official x264 support of multislicing (forked version no more required) 
     3 
    14Friday July 4, 2009 : msx264-1.2.0 
    25        - modified to compile against new multisliced version of x264 to allow packetization-mode=0 
  • linphone/mediastreamer2/plugins/msx264/README

    r525 r790  
    22It is based on ffmpeg for decoding and x264 for encoding. 
    33 
    4 It works with any version of x264. However if you want better performance and interroperability, it is  
    5 highly recommended to use the modified multiscling-enabled x264 available from linphone.org. 
    6 This patch enables multi-slicing, ie smaller video packets that fit into the network mtu. 
    7 It enables RFC3984 packetization-mode=0 to work. 
    8 You can download this special x264 here: 
    9 http://download.savannah.gnu.org/releases/linphone/plugins/sources/x264-snapshot-20090704-linphone-org.tar.gz 
     4It works with x264 version later to september 2009.  
     5So: 
    106 
    11 So: 
    12 * compile x264-snapshot-20090704-linphone-org.tar.gz with ./configure && make && make install 
    13 * compile msx264 with ./configure --enable-hacked-x264 && make && make install 
     7* compile msx264 with ./configure && make && make install 
    148 
    159 
     
    2014The linphone.org version of x264 was inspired by a patch submitted on x264-devel mailing list: 
    2115http://mailman.videolan.org/pipermail/x264-devel/2008-April/004427.html 
     16http://download.savannah.gnu.org/releases/linphone/plugins/sources/x264-snapshot-20090704-linphone-org.tar.gz 
     17This version is no more required since in august 2009, x264 team introduces new parameters 
     18controlling slicing. 
  • linphone/mediastreamer2/plugins/msx264/configure.ac

    r584 r790  
    11dnl Process this file with autoconf to produce a configure script. 
    2 AC_INIT([msx264],[1.2.0]) 
     2AC_INIT([msx264],[1.3.0]) 
    33 
    44AM_INIT_AUTOMAKE([tar-ustar]) 
     
    6161PKG_CHECK_MODULES(MEDIASTREAMER, mediastreamer >= 2.1.0) 
    6262 
    63 PKG_CHECK_MODULES(X264, x264 >= 0.58.0) 
     63PKG_CHECK_MODULES(X264, x264 >= 0.67.0) 
    6464 
    65 AC_ARG_ENABLE(hacked-x264, 
    66 [  --enable-hacked-x264       Turn on compilation over a patched x264 that allows multislicing [default=no]], 
    67 [hacked_x264=$enableval], 
    68 [hacked_x264=no] 
    69 ) 
    7065 
    7166dnl test for ffmpeg presence 
  • linphone/mediastreamer2/plugins/msx264/src/msx264.c

    r699 r790  
    7171        EncData *d=(EncData*)f->data; 
    7272        x264_param_t params; 
     73         
    7374        rfc3984_init(&d->packer); 
    7475        rfc3984_set_mode(&d->packer,d->mode); 
    7576        rfc3984_enable_stap_a(&d->packer,FALSE); 
     77         
    7678        x264_param_default(&params); 
     79        params.i_threads=1; 
     80        params.i_sync_lookahead=0; 
    7781        params.i_width=d->vsize.width; 
    7882        params.i_height=d->vsize.height; 
    7983        params.i_fps_num=(int)d->fps; 
    8084        params.i_fps_den=1; 
    81 #ifdef HACKED_X264 
    82         ms_message("Lucky guy, you have a hacked x264 lib that allows multislicing !"); 
    83         params.i_max_nalu_size=ms_get_payload_max_size()-100; /*-100 security margin*/ 
    84 #endif 
     85        params.i_slice_max_size=ms_get_payload_max_size()-100; /*-100 security margin*/ 
    8586        /*params.i_level_idc=30;*/ 
     87         
    8688        params.rc.i_rc_method = X264_RC_ABR; 
    8789        params.rc.i_bitrate=(int)( ( ((float)d->bitrate)*0.8)/1000.0); 
     
    9092        params.rc.i_vbv_buffer_size=params.rc.i_vbv_max_bitrate; 
    9193        params.rc.f_vbv_buffer_init=0.5; 
     94        params.rc.i_lookahead=0; 
    9295        /*enable this by config ?*/ 
    9396        /* 
     
    109112        for (i=0;i<num_nals;++i){ 
    110113                m=allocb(xnals[i].i_payload+10,0); 
    111                 /* 
    112                 x264_nal_encode(m->b_wptr, &bytes, 0, &xnals[i] ); 
    113                 m->b_wptr+=bytes; 
    114                 */ 
    115                 *m->b_wptr=( 0x00 << 7 ) | ( xnals[i].i_ref_idc << 5 ) | xnals[i].i_type; 
    116                 m->b_wptr++; 
    117                 memcpy(m->b_wptr,xnals[i].p_payload,xnals[i].i_payload); 
    118                 m->b_wptr+=xnals[i].i_payload; 
     114                 
     115                memcpy(m->b_wptr,xnals[i].p_payload+4,xnals[i].i_payload-4); 
     116                m->b_wptr+=xnals[i].i_payload-4; 
    119117                if (xnals[i].i_type==7) { 
    120118                        ms_message("A SPS is being sent."); 
     
    150148                        xpic.i_qpplus1=0; 
    151149                        xpic.i_pts=d->framenum; 
     150                        xpic.param=NULL; 
    152151                        xpic.img.i_csp=X264_CSP_I420; 
    153152                        xpic.img.i_plane=3; 
     
    160159                        xpic.img.plane[2]=pic.planes[2]; 
    161160                        xpic.img.plane[3]=0; 
    162                         if (x264_encoder_encode(d->enc,&xnals,&num_nals,&xpic,&oxpic)==0){ 
     161                        if (x264_encoder_encode(d->enc,&xnals,&num_nals,&xpic,&oxpic)>=0){ 
    163162                                x264_nals_to_msgb(xnals,num_nals,&nalus); 
    164163                                rfc3984_pack(&d->packer,&nalus,f->outputs[0],ts); 
     
    270269        .id=MS_FILTER_PLUGIN_ID, 
    271270        .name="MSX264Enc", 
    272 #ifdef HACKED_X264 
    273271        .text="A H264 encoder based on x264 project (with multislicing enabled)", 
    274 #else 
    275         .text="A H264 encoder based on x264 project.", 
    276 #endif 
    277272        .category=MS_FILTER_ENCODER, 
    278273        .enc_fmt="H264", 
Note: See TracChangeset for help on using the changeset viewer.