


Some forum posts suggest “crf” is a better approach, as it’s adaptive and generally results in smaller files for the same quality results I found this to be accurate. Again with smaller values, the quality can be drastically improved. A “1” value gives me more sampling than I need I’ve not played with the value to determine what would be optimal. A “0” value is lossless, but not all profiles support this. Using smaller values increases quality via increasing the bitrate (and other things?). To avoid repeating what’s in a lot of forum posts, I’ll just note that “crf” defaults to 23, which seems not to be adequate for my purposes (very large images with high-frequency content, used as still images to be encoded). Notably, “crf” causes variable bitrate, and “qp” causes a constant bitrate. Of particular importance for controlling quality are the “crf” (Constant Rate Factor) or “qp” (Quantization Parameter) options, which are named as they are in the command-line ffmpeg (and thus referenced in numerous posts/forums). Eventually, I looked at the source for FFmpeg’s libx264.c ( ), and found that there’s a rather large set of parameters/controls/options for x264 that are not part of the general encoder API:ħ54 static const AVOption options = ,Īv_opt_set(c->priv_data, "crf", "1", AV_OPT_SEARCH_CHILDREN) The problem was that I was not aware of the mapping between ffmpeg command-line parameters and the API. So I was convinced my goal is achievable. There’s a *lot* of info on command-line ffmpeg usage, with details on controlling quality for x264 encoding. I’m posting what I’ve learned so far, so that perhaps this will help others, or allow others to provide some more useful feedback. Good suggestion.I’ll try to create a minimal implementation to post.īut now my questions may be a bit more educated. Next message: Setting bitrate for x264 encoder?.Previous message: Setting bitrate for x264 encoder?.Setting bitrate for x264 encoder? Philip Schneider pjschneider at
