Newest 'x264' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/x264

Les articles publiés sur le site

  • CAVLC or CABAC is popular ? [closed]

    24 décembre 2016, par M SH GOL

    Which one of CAVLC or CABAC is more popular in H264 videos. Do not depend on the container (e.g MKV, MP4 or AVI)? I know that ffmpeg uses CABAC by default, and Google recommends CABAC for YouTube videos.

    I can't find any reference to compare. Who can help me?

  • How to encode h.264 with libavcodec/x264 ?

    23 décembre 2016, par szatmary

    I am attempting to encode video using libavcodec/libavformat. Audio works great, but when I try to encode video I get the following errors:

    [libx264 @ 0x10182a000]broken ffmpeg default settings detected  
    [libx264 @ 0x10182a000]use an encoding preset (vpre)  
    

    easy to fix using the command line ffmpeg, but I am trying to do this in C. my options are

    AVStream *pVideoOutStream = av_new_stream(pOutFormatCtx, 0);  
    AVCodecContext *pVideoOutCodecCtx  = pVideoOutStream->codec;  
    
    pVideoOutCodecCtx->codec_id        = CODEC_ID_H264;    
    pVideoOutCodecCtx->codec_type      = CODEC_TYPE_VIDEO;  
    pVideoOutCodecCtx->bit_rate        = pVideoInCodecCtx->bit_rate;  
    pVideoOutCodecCtx->width           = pVideoInCodecCtx->width;    
    pVideoOutCodecCtx->height          = pVideoInCodecCtx->height;  
    pVideoOutCodecCtx->pix_fmt         = pVideoInCodecCtx->pix_fmt;    
    pVideoOutCodecCtx->sample_rate     = pVideoInCodecCtx->sample_rate;    
    pVideoOutCodecCtx->gop_size        = 30;  
    

    but avcodec_open() fails.

    What other values do I need to set to make x264 happy?

  • How to encode h.264 with libavcodec/x264 ?

    23 décembre 2016, par szatmary

    I am attempting to encode video using libavcodec/libavformat. Audio works great, but when I try to encode video I get the following errors:

    [libx264 @ 0x10182a000]broken ffmpeg default settings detected  
    [libx264 @ 0x10182a000]use an encoding preset (vpre)  
    

    easy to fix using the command line ffmpeg, but I am trying to do this in C. my options are

    AVStream *pVideoOutStream = av_new_stream(pOutFormatCtx, 0);  
    AVCodecContext *pVideoOutCodecCtx  = pVideoOutStream->codec;  
    
    pVideoOutCodecCtx->codec_id        = CODEC_ID_H264;    
    pVideoOutCodecCtx->codec_type      = CODEC_TYPE_VIDEO;  
    pVideoOutCodecCtx->bit_rate        = pVideoInCodecCtx->bit_rate;  
    pVideoOutCodecCtx->width           = pVideoInCodecCtx->width;    
    pVideoOutCodecCtx->height          = pVideoInCodecCtx->height;  
    pVideoOutCodecCtx->pix_fmt         = pVideoInCodecCtx->pix_fmt;    
    pVideoOutCodecCtx->sample_rate     = pVideoInCodecCtx->sample_rate;    
    pVideoOutCodecCtx->gop_size        = 30;  
    

    but avcodec_open() fails.

    What other values do I need to set to make x264 happy?

  • How to wrap a C library parameter ?(Creating x264 .Net wrapper)

    6 décembre 2016, par Rella

    so in dll we have x264_param_t structure\object and a function for its setting up x264_param_apply_profile. in C we use such code to set it up

    x264_param_t param;
    x264_param_default_preset(&param, "veryfast", "zerolatency");
    param.i_threads = 1;
    param.i_width = width;
    param.i_height = height;
    param.i_fps_num = fps;
    param.i_fps_den = 1;
    // Intra refres:
    param.i_keyint_max = fps;
    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");
    

    I want to create wrapper for such.. thing. so I have libx264.dll and visual studio 2010 pro.

    How can I create .Net C# wrapper for it?

    I am a beginner in P\Invoke stuff so I do not get a lot of it...

    what I want to achive is is frame by frame level of working with x264... By now I need only encoding parts... And all needed sample code for doing it in C is in How does one encode a series of images into H264 using the x264 C API? . So I need to write a wrapper only for stuff mentioned there... So I am asking - how to create a wrapper on Parameter and on Function that sets up thap param. And I would love to see how to call that wrapper back from c#. So if you could provide any code in support I'd be glad to see it.

  • How to wrap a C library parameter ?(Creating x264 .Net wrapper)

    6 décembre 2016, par Rella

    so in dll we have x264_param_t structure\object and a function for its setting up x264_param_apply_profile. in C we use such code to set it up

    x264_param_t param;
    x264_param_default_preset(&param, "veryfast", "zerolatency");
    param.i_threads = 1;
    param.i_width = width;
    param.i_height = height;
    param.i_fps_num = fps;
    param.i_fps_den = 1;
    // Intra refres:
    param.i_keyint_max = fps;
    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");
    

    I want to create wrapper for such.. thing. so I have libx264.dll and visual studio 2010 pro.

    How can I create .Net C# wrapper for it?

    I am a beginner in P\Invoke stuff so I do not get a lot of it...

    what I want to achive is is frame by frame level of working with x264... By now I need only encoding parts... And all needed sample code for doing it in C is in How does one encode a series of images into H264 using the x264 C API? . So I need to write a wrapper only for stuff mentioned there... So I am asking - how to create a wrapper on Parameter and on Function that sets up thap param. And I would love to see how to call that wrapper back from c#. So if you could provide any code in support I'd be glad to see it.