Support and General Use > Plugins/Viewers
Mencoder and VBR MPEG-2 settings for Mpegplayer
nonoitall:
Some of the videos I'm encoding are about 90% still scenes, with high motion in between. If I don't set a maximum bitrate, the in-between areas will use an unacceptably high bitrate that will result in jerky playback. The target players I do have have revealed this.
Llorean:
What target bitrate are you using, and what player are you encoding for?
nonoitall:
My desired average bitrate varies from target to target, but for smaller screen sizes (176x132 or under) I'm using ~200kbps. 320x240 targets, 300-400kbps, and others somewhere in between. For 220x176 targets (the ones I've been working on the most) it seems like a buffer size of 46KB works well for my 200-250kbps (with 400kbps maximum bitrate) encodes. (I dug that size out of some IRC log of the RB developers.)
However, the same doesn't hold true for 320x240 encodes, which throw out many buffer underflow warnings even when I quadruple that buffer size. I was doing some experimenting and it seems that in those cases, the maximum bitrate is not respected. (I can set an average of 300kbps and a maximum of 400kbps, but the file will still have a peak bitrate of over 1Mbps.)
I can post the command lines I'm using and the results I'm getting tomorrow if that would help.
Llorean:
I asked for specific targets, not target screen size. For example our 320 by 240 players have vastly varying performance. I'd also need to know what frame rate you're encoding at For each one.
nonoitall:
Gigabeat, iAudio X5, iPod Color/Photo, iPod Nano, iPod Video, iriver H10 5/6GB, iriver H10 20GB, iriver H120, iriver H300, Sansa c200, Sansa e200.
The video is 23.976 fps.
I finally did manage to get mencoder to do the 320x240 encode earlier this afternoon, but I had to bump the buffer size up past 65,536 kbits (8,000 KB) to do it. This seems awfully excessive, since it's over 35 times the size that DVD video uses. Here are my attempts:
--- Code: ---#220x166 easily encodes:
#First pass
mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=200:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=376:vpass=1 \
-vf scale=220:166,harddup -o /dev/null
# ^ this goes fine
#Second pass
mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=200:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=376:vpass=2 \
-vf scale=220:166,harddup -o test.m2v
# ^ this goes fine
--- End code ---
--- Code: ---#Now for 320x240...
mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=376:vpass=1 \
-vf scale=320:240,harddup -o /dev/null
# ^ results in buffer underflow warnings (maybe 15-20 of them)
mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=376:vpass=2 \
-vf scale=320:240,harddup -o test.m2v
# ^ results in tons and tons and tons of buffer underflow warnings
--- End code ---
--- Code: ---mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=1507:vpass=1 \
-vf scale=320:240,harddup -o /dev/null
# ^ this goes fine
mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=1507:vpass=2 \
-vf scale=320:240,harddup -o test.m2v
# ^ results in tons and tons and tons of buffer underflow warnings
--- End code ---
--- Code: ---mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=1835:vpass=1 \
-vf scale=320:240,harddup -o /dev/null
# ^ this goes fine
mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=1835:vpass=2 \
-vf scale=320:240,harddup -o test.m2v
# ^ results in tons and tons and tons of buffer underflow warnings
--- End code ---
--- Code: ---mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=8192:vpass=1 \
-vf scale=320:240,harddup -o /dev/null
# ^ this goes fine
mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=8192:vpass=2 \
-vf scale=320:240,harddup -o test.m2v
# ^ results in tons and tons and tons of buffer underflow warnings
--- End code ---
--- Code: ---mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=65536:vpass=1 \
-vf scale=320:240,harddup -o /dev/null
# ^ this goes fine
mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=65536:vpass=2 \
-vf scale=320:240,harddup -o test.m2v
# ^ results in tons and tons and tons of buffer underflow warnings
--- End code ---
--- Code: ---mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=524288:vpass=1 \
-vf scale=320:240,harddup -o /dev/null
# ^ this goes fine
mencoder intro.avi -of rawvideo -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=300:vmax_b_frames=4:vrc_maxrate=400:vrc_buf_size=524288:vpass=2 \
-vf scale=320:240,harddup -o test.m2v
# ^ this goes fine - finally!!!
--- End code ---
Oddly, even though the last encode didn't spout out any complaints, mplex still warns that there are frame data under-runs detected when I mux the video with its audio, and the video's bitrate peak is over 1.7 Mbps.
Navigation
[0] Message Index
[*] Previous page
Go to full version