This maybe attributed to incorrect parameters such as bit_rate, rate, width or height . The specified parameters such as bitrate, audio sampling rate or audio channels number are not allowed for the specified codec. Also, often this error appears when specified bitrate is too low.
Knowledge Base
Find your answers here.