[x264-devel] Rescaling in real-time

SiPing Tao anhuitsp at mail.ustc.edu.cn
Tue Jun 7 08:27:14 CEST 2011


Hi Diego,

I have a similar part-time task to do as yours, where I need to use less CPU cost to do spatial transcoding.
In my opinion, the best solution is to write a special transcoder, however, I don't have enough time and resource. One trade-off solution is cascading: decoding+encoding, and FFMpeg can provide most of the required features. My task is just in design step, and I am learning how to use FFMpeg.

I have video background and familar with x264 codec, I think we can keep in touch and help each other since we are doing similar thing. My gtalk is Siping.Tao at gmail.com.

btw: I am in China now.

Thanks,
Siping


> -----Original E-mail-----
> From: "Diego Carvalho Domingos" <diego.cdomingos2010 at gmail.com>
> Sent Time: 2011-6-6 22:28:30
> To: x264-devel at videolan.org
> Cc: 
> Subject: [x264-devel] Rescaling in real-time
> 
> I have a complex task to do. I'm receiving h264 rtp packets from the
> internet and I need to change their resolution before forwarding them.
> I've created a class to create a frame from the packets, decode it
> with libavcodec, rescale it with libswscale, reencode it with libx264
> and finally convert the frame to packets again and forward them. It's
> working (altough with medium quality) but I don't know if this is the
> best solution to achieve my goal (this approach uses a lot of CPU
> process time). Is there a way to rescale a h264 frame without decoding
> it? Another issue is that I am not sure about the parameters I am
> using to encode (I couldn't find much information about this on the
> internet) and I think that it is the reason of the medium quality
> video:
> 
> param = new x264_param_t;
> x264_param_default_preset(param, "veryfast", "zerolatency");
> param->i_threads = 2;
> param->i_width = m_OutWidth;
> param->i_height = m_OutHeight;
> param->i_fps_num = 25;
> param->i_fps_den = 1;
> // Intra refres:
> param->i_keyint_max = 25;
> param->b_intra_refresh = 1;
> //Rate control:
> param->rc.i_rc_method = X264_RC_CRF;
> param->rc.f_rf_constant = 25;
> param->rc.f_rf_constant_max = 35;
> //For streaming:
> param->b_repeat_headers = 1;
> param->b_annexb = 1;
> x264_param_apply_profile(param, "baseline");
> x264_encoder = x264_encoder_open(param);
> 
> pic_in = new x264_picture_t;
> x264_picture_alloc(pic_in, X264_CSP_I420, m_OutWidth, m_OutHeight);
> pic_in->i_type = X264_TYPE_AUTO;
> pic_in->i_qpplus1 = 0;
> 
> What would be the best parameters? I appreciate any help or suggestions. Thanks.
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> http://mailman.videolan.org/listinfo/x264-devel



More information about the x264-devel mailing list