While the direct answer to your question would be like this:
#!/bin/bash
MOVIES=~/Movies/
find "$MOVIES" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -sameq "${0%%.mp4}.ogg"' {} ;
exit;
I think you might find better results using the VP8 or webm codec as it will give you much better results and is actually preferred in modern versions of Firefox. Given that, you should try this:
#!/bin/bash
MOVIES=~/Movies/
find "$MOVIES" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -sameq "${0%%.mp4}.webm"' {} ;
exit;
Both of these methods WILL result in a loss of quality in your resulting videos as they are re-encoding the already encoded material and, in my opinion, even the webm codec is not nearly as good as a properly encoded MP4 using the h.264 codec.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…