Question 1:
I'm using the latest version.FFmpeg andx264, just compiled, compile no problem, but found error when using FFmpeg library in Linux environment
error C3861: ' uint64_c ': identifier not found
Workaround Add the following definition to the Common.h in the Libavutil directory:
#ifndef Int64_c
#define INT64_C (c) (C # # LL)
#define UINT64_C (c) (C # # ULL)
#endif
Issue 2: Link-based ffmpeg application times error:
/USR/LOCAL/LIB/LIBAVCODEC.A (LIBX264.O): in function ' X264_frame ':
/home/qiuzhongming/disk2/source_pc/ffmpeg-0.6/libavcodec/libx264.c:105:undefined reference to ' X264_encoder_ Encode
/USR/LOCAL/LIB/LIBAVCODEC.A (LIBX264.O): in function ' X264_close ':
/home/qiuzhongming/disk2/source_pc/ffmpeg-0.6/libavcodec/libx264.c:143:undefined reference to ' X264_encoder_close ‘
/USR/LOCAL/LIB/LIBAVCODEC.A (LIBX264.O): in function ' X264_init ':
/home/qiuzhongming/disk2/source_pc/ffmpeg-0.6/libavcodec/libx264.c:153:undefined reference to ' X264_param_default ‘
/home/qiuzhongming/disk2/source_pc/ffmpeg-0.6/libavcodec/libx264.c:295:undefined reference to ' X264_encoder_open_ 83 '
/home/qiuzhongming/disk2/source_pc/ffmpeg-0.6/libavcodec/libx264.c:305:undefined reference to ' X264_encoder_ Headers
Collect2:ld returned 1 exit status
The solution is: compile time did not bring the x264 library, bring on the good.
Issue 3: When using ffmpeg x264 to encode, avcodec_open error:
[libx264 @ 00021bb0]broken ffmpeg default settings detected
[libx264 @ 00021bb0]use an encoding preset (VPRE)
Workaround: Locate the error in the source file encoder/encoder.c of the x264
/* Detect default FFmpeg settings and terminate with an error. */
{
int score = 0;
Score + = H->param.analyse.i_me_range = = 0;
Score + = H->param.rc.i_qp_step = = 3;
Score + = H->param.i_keyint_max = = 12;
Score + = H->param.rc.i_qp_min = = 2;
Score + = H->param.rc.i_qp_max = = 31;
Score + = H->param.rc.f_qcompress = = 0.5;
Score + = Fabs (h->param.rc.f_ip_factor-1.25) < 0.01;
Score + = Fabs (h->param.rc.f_pb_factor-1.25) < 0.01;
Score + = H->param.analyse.inter = 0 && H->param.analyse.i_subpel_refine = = 8;
if (score >= 5)
{
X264_log (H, X264_log_error, "broken ffmpeg default settings detected\n");
X264_log (H, X264_log_error, "Use an encoding preset (vpre) \ n");
return-1;
}
}
We can see this if score >= 5,the function to open the codec would fail.
We must at least set 4 param of the avcodeccontext before open it.
InThe Avcodec_open function adds the following severalInitialization of the Avcodeccontext:
/*default Settings for x264*/
Ctx->me_range = 16;
Ctx->max_qdiff = 4;
Ctx->qmin = 10;
Ctx->qmax = 51;
ctx->qcompress = 0.6;
OK, Fix it.
Introduction to compiling and using FFmpeg x264