[MEncoder-users] 2-pass encoding causes loop near end

John Brown johnbrown105 at hotmail.com
Sat Feb 17 22:06:42 CET 2007


I am using MPlayer/MEncoder dev-SVN-r22220-4.1.2 on Kubuntu 6.10 with a 
Pentium IV 3 GHz CPU and a Radeon 9200SE (RV280) video card, and on-board 
Realtek AC'97 audio.

Compiler info:
gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
GNU assembler 2.17 Debian GNU/Linux
GNU ld version 2.17 Debian GNU/Linux

For example, when I specify -endpos 20:

Pass 1:

a) mplayer -identify reports length = 16.47
b) Movie plays 20.2 seconds with message:

a52: CRC check failed!  0.008 ct:  0.068 475/472  1%  0%  0.5% 0 0
a52: error at resampling
A:  20.2 V:  20.1 A-V:  0.011 ct:  0.073 482/479  1%  0%  0.5% 0 0

at the end, but otherwise plays normally.

Pass 2:

a) mplayer -identify reports the same incorrect length
b) Movie plays 20.2 seconds with message:

a52: CRC check failed!  0.219 ct:  0.304 254/251  1%  0%  0.6% 0 0
a52: error at resampling
A:  20.2 V:  20.1 A-V:  0.021 ct:  0.353 266/263  1%  0%  0.5% 0 0

then loops back to (apparently) 16.47 s and then continues to the end (20.2 
s).

If I specify -endpos 30, the problem occurs at about 25 seconds, but it 
happens near the end when I encode the full episode, and with other files.

I use the following script:
################### encode_dvd.sh
MPLAYER=mplayer
MENCODER=mencoder
if [ !$ABITRATE ]; then
   ABITRATE=192
fi
#echo "ABITRATE = "$ABITRATE
if [ !$VBITRATE ]; then
   VBITRATE=2000
fi
#echo "VBITRATE = "$VBITRATE
if [ "" = "$INNER" ]; then
   INNER=656:448
fi
#echo "INNER = "$INNER
if [ "" = "$OUTER" ]; then
   OUTER=704:480
fi
#echo "OUTER = "$OUTER
if [ "" = "$EXTRAS"  ]; then
   EXTRAS="-quiet"
fi
#echo "EXTRAS = "$EXTRAS
echo `date` "Started  Encoding $1 to $2 ..."
echo `date` "Started  Encoding $1 to $2 ..." >> log.txt
#$MENCODER "$1" $EXTRAS -of mpeg -mpegopts format=dvd:telecine -vf 
scale=$INNER,\
#expand=$OUTER,harddup -oac lavc -ovc lavc -lavcopts vcodec=mpeg2video:\
#aspect=4/3:vbitrate=$VBITRATE:vrc_maxrate=5000:acodec=ac3:abitrate=$ABITRATE:\
#vrc_buf_size=1835:keyint=12:nr=100:trell:mv0:mbd=2:cbp:dc=10:predia=2:dia=2:\
#vrc_eq="(tex+10^8*mcVar)^0.6":vpass=1:turbo -ofps 24000/1001 -srate 48000 \
#-af lavcresample=48000 -aspect 4/3 -o $2 >> log.txt 2>&1
echo `date` "Pass 2   Encoding $1 to $2 ..."
echo `date` "Pass 2   Encoding $1 to $2 ... " >> log.txt
$MENCODER "$1" $EXTRAS -of mpeg -mpegopts format=dvd:telecine -vf 
scale=$INNER,\
expand=$OUTER,harddup -oac lavc -ovc lavc -lavcopts vcodec=mpeg2video:\
aspect=4/3:vbitrate=$VBITRATE:vrc_maxrate=5000:acodec=ac3:abitrate=$ABITRATE:\
vrc_buf_size=1835:keyint=12:nr=100:trell:mv0:mbd=2:cbp:dc=10:predia=2:dia=2:\
vrc_eq="(tex+10^8*mcVar)^0.6":vpass=2       -ofps 24000/1001 -srate 48000 \
-af lavcresample=48000 -aspect 4/3 -o $2 >> log.txt 2>&1
echo "Removing Log file..."
#rm divx2pass.log
echo "Extracting video..."
mplayer -really-quiet -dumpvideo -dumpfile video $2
echo 'Extracting audio...'
mplayer -really-quiet -dumpaudio -dumpfile audio "$2" >> log.txt 2>&1
echo "Muxing video and audio..."
#mplex -f 8 -S 0 -v 0 -o $2 video audio >> log.txt 2>&1
rm video > nul
rm audio > nul
echo `date` "Finished Encoding $1 to $2"
echo `date` "Finished Encoding $1 to $2" >> log.txt
################### encode_dvd.sh

Normally, all the statements are executed. I have commented out a few lines 
for testing.

MPlayer -v output after Pass 1:
A:  19.8 V:  19.8 A-V:  0.005 ct:  0.068 474/471  1%  0%  0.5% 0 0
A:  19.9 V:  19.9 A-V:  0.006 ct:  0.068 475/472  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
a52: CRC check failed!
a52: error at resampling
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  19.9 V:  19.9 A-V:  0.005 ct:  0.068 476/473  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  19.9 V:  19.9 A-V:  0.012 ct:  0.069 477/474  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.0 V:  20.0 A-V:  0.009 ct:  0.070 478/475  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.0 V:  20.0 A-V:  0.010 ct:  0.070 479/476  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.1 V:  20.1 A-V:  0.011 ct:  0.071 480/477  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.1 V:  20.1 A-V:  0.008 ct:  0.071 481/478  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.2 V:  20.1 A-V:  0.013 ct:  0.072 482/479  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: video)
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: video)
A:  20.2 V:  20.1 A-V:  0.013 ct:  0.073 482/479  1%  0%  0.5% 0 0
EOF code: 1

Uninit audio filters...
[libaf] Removing filter dummy
Uninit audio: liba52
Uninit video: libmpeg2
vo: uninit ...

Exiting... (End of file)


MPlayer output after Pass 2:
==================
A:  19.8 V:  19.6 A-V:  0.219 ct:  0.261 563/560  1%  0%  0.6% 0 0
A:  19.9 V:  19.6 A-V:  0.224 ct:  0.265 564/561  1%  0%  0.6% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
a52: CRC check failed!
a52: error at resampling
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  19.9 V:  19.7 A-V:  0.225 ct:  0.269 565/562  1%  0%  0.6% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  19.9 V:  19.7 A-V:  0.226 ct:  0.273 566/563  1%  0%  0.6% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.0 V:  19.8 A-V:  0.215 ct:  0.278 567/564  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.0 V:  19.8 A-V:  0.220 ct:  0.282 568/565  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.1 V:  19.9 A-V:  0.217 ct:  0.286 569/566  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.1 V:  19.9 A-V:  0.214 ct:  0.290 570/567  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.2 V:  19.9 A-V:  0.219 ct:  0.294 571/568  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.2 V:  20.0 A-V:  0.188 ct:  0.298 572/569  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.2 V:  20.0 A-V:  0.146 ct:  0.303 573/570  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.2 V:  20.1 A-V:  0.104 ct:  0.307 574/571  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.2 V:  20.1 A-V:  0.062 ct:  0.311 575/572  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
A:  20.2 V:  20.1 A-V:  0.021 ct:  0.313 576/573  1%  0%  0.5% 0 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: audio)
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: video)
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: video)
A:  20.2 V:  20.1 A-V:  0.021 ct:  0.315 576/573  1%  0%  0.5% 0 0
EOF code: 1

Uninit audio filters...
[libaf] Removing filter dummy
Uninit audio: liba52
Uninit video: libmpeg2
vo: uninit ...

Exiting... (End of file)

This output does not show MPlayer looping back to 16.47 s, but it does. VLC 
does not loop, but the picture is garbled at the end. Kaffeine loops and 
displays the following error:

xine: cannot find input plugin for MRL 
[mms://63.250.197.146/p08r15/119/__S__/LAUvpwm9/10/5121431.wmv?StreamID=5121431&pl_auth=d79e761d913550355d63319629ee4064&ht=3630&xdata=Eyn8J0.fyfuV36ip45Kw3A-16880510-1453478966&b=9e0q77l1c33ef&s=396500550]
xine: input plugin cannot open MRL 
[mms://63.250.197.146/p08r15/119/__S__/LAUvpwm9/10/5121431.wmv?StreamID=5121431&pl_auth=d79e761d913550355d63319629ee4064&ht=3630&xdata=Eyn8J0.fyfuV36ip45Kw3A-16880510-1453478966&b=9e0q77l1c33ef&s=396500550]
libmmsh: http status not 2xx: >401 Unauthorized<
xine: found input plugin  : mms streaming input plugin
200 frames delivered, 0 frames skipped, 3 frames discarded
video_out: throwing away image with pts 472140 because it's too old (diff : 
6823).
video_out: throwing away image with pts 468465 because it's too old (diff : 
10498).
video_out: throwing away image with pts 464790 because it's too old (diff : 
14173).
xine: found demuxer plugin: MPEG program stream demux plugin
xine: found input plugin  : file input plugin

_________________________________________________________________
Find what you need at prices you’ll love. Compare products and save at MSN® 
Shopping. 
http://shopping.msn.com/default/shp/?ptnrid=37,ptnrdata=24102&tcode=T001MSN20A0701




More information about the MEncoder-users mailing list