I’m trying to encode video with ffmpeg and x264. I know ffmpeg can use x264 presets when using the program ffmpeg from command line. But is it possible to easily use these presets when encoding with ffmpeg in code?
If not, what is the best way to set the x264 parameters from ffmpeg code? Is it just using the properties of the AVCodecContext? Are all the x264 options available through this?
Thank you!
Sorry for the very late answer but I had the same question and I want to share the solution that I found.
Yes, it is possible to pass many of the x264 options through the command-line and API, at least when using libav (I can´t confirm with ffmpeg now). By issuing avconv –help you can find this:
When using the AVCodecContext struct, you can also set those options like -rc-lookahead can be set at AVCodecContext::rc_lookahead, but I´m not sure about -preset now.
Hope this can help