Newest 'x264' Questions - Stack Overflow
Les articles publiés sur le site
-
x264 Encoding use x264_picture_clean crash
5 mai 2017, par Wong SamWhen I use iphone encoding CMSampleBufferRef To H264, it offen crash at
x264_picture_clean
I dont't know how to deal itx264_picture_t* pPic_in;
here is my init about pPic_in
pPic_in = (x264_picture_t*)malloc(sizeof(x264_picture_t)); pPic_out = (x264_picture_t*)malloc(sizeof(x264_picture_t)); x264_picture_init(pPic_out); x264_picture_init(pPic_in); x264_picture_alloc(pPic_in, csp, pParam->i_width, pParam->i_height); pPic_in->img.i_stride[0] = width; pPic_in->img.i_stride[1] = width / 2; pPic_in->img.i_stride[2] = width / 2; pPic_in->img.i_plane = 3;
and i set data here
picture_buf = yuv420_data; pPic_in->img.plane[0] = picture_buf; pPic_in->img.plane[1] = picture_buf + y_size; pPic_in->img.plane[2] = picture_buf + y_size*5/4;
it looks well , when i run it on my iphone,but sometimes it will crash at
x264_picture_clean
here is more detail abuot pPic_in when crash occer enter image description here
Thank u very much
-
x264 Encoding use x264_picture_clean crash
5 mai 2017, par Wong SamWhen I use iphone encoding CMSampleBufferRef To H264, it offen crash at
x264_picture_clean
I dont't know how to deal itx264_picture_t* pPic_in;
here is my init about pPic_in
pPic_in = (x264_picture_t*)malloc(sizeof(x264_picture_t)); pPic_out = (x264_picture_t*)malloc(sizeof(x264_picture_t)); x264_picture_init(pPic_out); x264_picture_init(pPic_in); x264_picture_alloc(pPic_in, csp, pParam->i_width, pParam->i_height); pPic_in->img.i_stride[0] = width; pPic_in->img.i_stride[1] = width / 2; pPic_in->img.i_stride[2] = width / 2; pPic_in->img.i_plane = 3;
and i set data here
picture_buf = yuv420_data; pPic_in->img.plane[0] = picture_buf; pPic_in->img.plane[1] = picture_buf + y_size; pPic_in->img.plane[2] = picture_buf + y_size*5/4;
it looks well , when i run it on my iphone,but sometimes it will crash at
x264_picture_clean
here is more detail abuot pPic_in when crash occer enter image description here
Thank u very much
-
Manually generate "empty" h264 p-frame
26 avril 2017, par leavittxLet's call a p-frame frame empty if it doesn't change any pixels in the currently decoded video (i.e. no motion vectors, nothing).
What I need is to be able to manually insert empty p-frame into the video stream on request (need to send frames to the streaming client with a constant framerate, however the frame source on the streaming server can supply frames with a different/lower one).
So I need to be able to correctly form the byte sequence which represents the empty p-frame for the current resolution (I wonder which other parameters could be needed?)
Ideally, I prefer to have an encoder-independent solution, since I use two different ones: nvenc via Nvidia Video SDK and x264 via FFmpeg.
Where should I look to?
-
Manually generate "empty" h264 p-frame
26 avril 2017, par leavittxLet's call a p-frame frame empty if it doesn't change any pixels in the currently decoded video (i.e. no motion vectors, nothing).
What I need is to be able to manually insert empty p-frame into the video stream on request (need to send frames to the streaming client with a constant framerate, however the frame source on the streaming server can supply frames with a different/lower one).
So I need to be able to correctly form the byte sequence which represents the empty p-frame for the current resolution (I wonder which other parameters could be needed?)
Ideally, I prefer to have an encoder-independent solution, since I use two different ones: nvenc via Nvidia Video SDK and x264 via FFmpeg.
Where should I look to?
-
How to achieve 2 pass encoding using x264 ?
6 avril 2017, par Kim Kardashianis there a parameter in the x264_param_t structure or do I have to send frames to x264 dll twice.. ? Because I just use encoder_encode function and that returns nal units . Im guessing it should be a combination of a parameter and using encoder_encode twice.
Here is how i initialize params and link to libx264
InitializeSettings(){ x264_param_default_preset(&m_pXParam, "medium", "zerolatency"); x264_param_apply_profile(&m_pXParam, "baseline"); m_pXParam.i_width = cx; m_pXParam.i_height = cy; m_pXParam.i_fps_num = fps; m_pXParam.i_fps_den = 1; // rate control m_pXParam.i_keyint_max = fps - 5; //m_pXParam.rc.f_rf_constant_max = fps + 5; // rate control m_pXParam.rc.i_qp_constant=18; m_pXParam.rc.i_qp_min=18; m_pXParam.rc.i_qp_max=18;} x264_picture_alloc(&m_xPicture, X264_CSP_I420 , m_pXParam.i_width, m_pXParam.i_height); m_xPicture.img = x264img; m_iframe_size = x264_encoder_encode(m_xEncoder, &m_xNals, &m_iNal, &m_xPicture, &m_xPictureOut);
@nobody555 Thanks! I had another question about x264_param_apply_fastfirstpass function:
/* x264_param_apply_fastfirstpass: * If first-pass mode is set (rc.b_stat_read == 0, rc.b_stat_write == 1), * modify the encoder settings to disable options generally not useful on * the first pass. */
what options are they talking about ?