[MPlayer-users] Using mplayer/mencoder/ogmtools to make an ogm

Martin Collins martin at mkcollins.org
Tue Oct 21 01:07:44 CEST 2003


On Mon, 20 Oct 2003 23:16:34 +0200
Vladimir Niksic <vniksic at inet.hr> wrote:

> If I decompress the AC3 sound with mplayer to pcm, and
> then encode it to ogg, I have a problem with setting the video
> bitrate. If I use similar bitrates with ogg and mp3, and then use
> the video recommendation bitrate that I got from the first pass, and
> use ogmmerge to dump the mp3 and put the ogg audio file in it's
> place, it is always screwed up. Either I get 705+ mb movie, or 680-.
> Is there a calculator around, so I can calculate the video bitrate
> that is optimal?

Why bother with mp3? Don't do three pass. Just calculate the video
bitrate by target_size-ogg_size and do two pass with -oac copy.

Here's my calculator:

OGG_SIZE=`ogginfo $NAME.ogg | grep data | cut -d' ' -f4`
OVERHEAD=`echo "$TARGET_SIZE / 100 * 1024 * 1024 * 1.5" | bc`
VIDEO_SIZE=`echo "$TARGET_SIZE * 1024 * 1024 - $OGG_SIZE - $OVERHEAD" | bc`
MINS=`ogginfo $NAME.ogg | grep Playback | cut -d' ' -f3 | cut -dm -f1`
SECS=`ogginfo $NAME.ogg | grep Playback | cut -d' ' -f3 | cut -d: -f2 | cut -ds -f1`
DURATION=`echo "$MINS * 60 + $SECS" | bc`
BITRATE=`echo "$VIDEO_SIZE * 8 / $DURATION / 1000" | bc`

Martin




More information about the MPlayer-users mailing list