[x264-devel] Rescaling in real-time
Edward Richards
edward at edwardandalison.com
Mon Jun 6 17:00:21 CEST 2011
Have a look in x264.c or x264cli.c (I can't remember which) for the
command line parser. In it is the profile switch statement. Match what
"slow" etc does for better quality.
_________________
Sent from my iPhone... So sorry for typos!
On Jun 6, 2011, at 7:28 AM, Diego Carvalho Domingos <diego.cdomingos2010 at gmail.com
> wrote:
> 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