How do I convert MP4 to OGV while still retaining the same quality using FFMPEG?

I'm not familiar with FFMPEG at all and would like to know how to convert MP4 to OGV format while still keeping the same video and audio quality?


Basic command is

ffmpeg -i input.mp4 -c:v libtheora -q:v 7 -c:a libvorbis -q:a 4 output.ogv

You'll have to fiddle with the q values for video and audio if the result's not acceptable. Lower values are better but produce bigger files. For libtheora, it's the opposite - higher values are better. Range is 0-10.