Dealing with FFMPEG Error while opening codec for output stream…

This specific content was written 11 years ago. Please keep this in mind as it may be outdated and not adhering to best-practices.

Quick post about the ffmpeg error message: “Error while opening codec for output stream #0.0 – maybe incorrect parameters such as bit_rate, rate, width or height” .

We received some video files from a partner in the Safecity project, which did not play in all media players.
We tried VLC, windows media player, and a variety of other players but nothing worked.

Checking the file with a hex editor, I saw there was data within the video, and thought to try converting with FFMPEG using commands such as:

ffmpeg -i “damaged_file.avi” converted_file.mp4

However, ffmpeg  failed with the following error message:

Error while opening codec for output stream #0.0 – maybe incorrect parameters such as bit_rate, rate, width or height

More