Search code examples
ffmpeglibavcodeclibavformatlibx264

What parameters are required to use x264 via ffmpeg?


i have an AVI file, i have decoded it into Raw form first, now i want to encode it in .h264 format. I am using libavcodec.dll and libavformat.dll. The point is when i try to open the codec from avcodec_open(AVCodecContext,AVCodec) It doesnot open. Am i missing some parameters that i need to specify for execution of this method for the lib x264? Any help will be deeply appreciated. Thanks


Solution

  • There are two common ways to encode AVI file to H.264 using x264:

    1, Compile and install ffmpeg, with --enable-shared, then compile and install x264. You'll see lavf: yes when configuring. Then do the converting using x264 cli or something else(such as DirectX264).

    2, Compile and install x264, with --enable-shared, then compile and install ffmpeg with --enable-libx264. Then you will be able to convert using ffmpeg cli or something else(such as WinFF).

    And btw .h264 is not a sufficient suffix, please use ".mkv", ".mp4" or something instead.