ost
2nd March 2009, 17:38
Is it possible to get similar quality and hardware player compliant mpeg2 files from Mencoder like from HCencoder ?
I have Linux box which is on all the day(proxy sever), it would be great that I can use it for encoding purposes also.
To find out closest Mencoder settings I encode part of video with HCencoder and then with Mencoder with similar
settings(I think). After compare them to each other:vbitrate=4000,vrc_maxrate=8500 .
First of all I try this batch:
E:\progra~1\mplayer\mencoder.exe -of mpeg -ovc lavc -nosound -lavcopts vcodec=mpeg2video:vmax_b_frames=2:vb_strategy=1:b_sensitivity=2:sc_threshold=-10000:top=0:alt:keyint=15:aspect=4/3:ildct:vrc_buf_size=1835:intra_matrix=8,8,8,9,11,13,14,17,8,8,9,11,13,13,14,17,8,8,11,12,13,14,17,94,9,11,13,13,14,17,17,94,11,11,13,13,14,17,94,94,13,13,14,16,17,20,94,94,13,13,14,17,94,94,94,94,13,14,17,94,94,94,94,94:inter_matrix=12,12,13,14,15,16,22,26,12,13,14,15,16,22,26,32,13,14,15,16,22,26,32,41,14,15,16,22,26,32,41,53,15,16,22,26,32,41,53,94,16,22,26,32,41,53,70,94,22,26,32,41,53,70,94,94,26,32,41,53,94,94,94,94:vpass=1:vbitrate=%3:vrc_maxrate=%4 %1 -o %2 of rawvideo -ffourcc MPG2
E:\progra~1\mplayer\mencoder.exe -of mpeg -ovc lavc -nosound -lavcopts vcodec=mpeg2video:vmax_b_frames=2:mbd=2:dc=9:cmp=258:precmp=258:preme=2:ildctcmp=258:b_sensitivity=2:sc_threshold=-10000:top=0:alt:keyint=15:aspect=4/3:ildct:vrc_buf_size=1835:intra_matrix=8,8,8,9,11,13,14,17,8,8,9,11,13,13,14,17,8,8,11,12,13,14,17,94,9,11,13,13,14,17,17,94,11,11,13,13,14,17,94,94,13,13,14,16,17,20,94,94,13,13,14,17,94,94,94,94,13,14,17,94,94,94,94,94:inter_matrix=12,12,13,14,15,16,22,26,12,13,14,15,16,22,26,32,13,14,15,16,22,26,32,41,14,15,16,22,26,32,41,53,15,16,22,26,32,41,53,94,16,22,26,32,41,53,70,94,22,26,32,41,53,70,94,94,26,32,41,53,94,94,94,94:vratetol=4000:vstrict=0:vpass=2:vbitrate=%3:vrc_maxrate=%4 %1 -o %2 of rawvideo -ffourcc MPG2
Result was similar with HCencoder except in static areas(walls) and scenes with high motion is noticeable macroblocking.
Then I tune batch with adaptive quantization settings:
E:\progra~1\mplayer\mencoder.exe -of mpeg -ovc lavc -nosound -lavcopts vcodec=mpeg2video:vpass=1:turbo:vqmin=3:vqscale=2:vrc_maxrate=%4:vrc_buf_size=1835:keyint=15:vqcomp=0.9:vmax_b_frames=2:vb_strategy=1:b_sensitivity=2:vb_qfactor=1.0:vb_qoffset=0.0:vi_qfactor=1.0:me_range=128:preme=2:dia=2:predia=2:mbd=2:mv0:dc=9:aspect=4/3:inter_matrix=12,12,13,14,15,16,22,26,12,13,14,15,16,22,26,32,13,14,15,16,22,26,32,41,14,15,16,22,26,32,41,53,15,16,22,26,32,41,53,94,16,22,26,32,41,53,70,94,22,26,32,41,53,70,94,94,26,32,41,53,94,94,94,94:intra_matrix=8,8,8,9,11,13,14,17,8,8,9,11,13,13,14,17,8,8,11,12,13,14,17,94,9,11,13,13,14,17,17,94,11,11,13,13,14,17,94,94,13,13,14,16,17,20,94,94,13,13,14,17,94,94,94,94,13,14,17,94,94,94,94,94:vlelim=-2:vcelim=3:ildct:sc_threshold=-10000:top=0:alt %1 -o %2 -of rawvideo -ffourcc MPG2
E:\progra~1\mplayer\mencoder.exe -of mpeg -ovc lavc -nosound -lavcopts vcodec=mpeg2video:vpass=2:vqmin=3:vrc_maxrate=%4:vrc_buf_size=1835:keyint=15:vqcomp=0.9:vmax_b_frames=2:b_sensitivity=2:bidir_refine=1:vb_qfactor=1.0:vb_qoffset=0.0:vi_qfactor=1.0:me_range=128:last_pred=1:preme=2:dia=2:predia=2:mbd=2:mv0:nssew=1000:mv0_threshold=128:dc=9:aspect=4/3:inter_matrix=12,12,13,14,15,16,22,26,12,13,14,15,16,22,26,32,13,14,15,16,22,26,32,41,14,15,16,22,26,32,41,53,15,16,22,26,32,41,53,94,16,22,26,32,41,53,70,94,22,26,32,41,53,70,94,94,26,32,41,53,94,94,94,94:intra_matrix=8,8,8,9,11,13,14,17,8,8,9,11,13,13,14,17,8,8,11,12,13,14,17,94,9,11,13,13,14,17,17,94,11,11,13,13,14,17,94,94,13,13,14,16,17,20,94,94,13,13,14,17,94,94,94,94,13,14,17,94,94,94,94,94:lumi_mask=0.05:dark_mask=0.3:tcplx_mask=0.1:scplx_mask=0.1:vlelim=-2:vcelim=3:naq:vbitrate=%3:vratetol=4000:vstrict=0:ildct:sc_threshold=-10000:top=0:alt:threads=1 %1 -o %2 -of rawvideo -ffourcc MPG2
Mencoder in some places report that there were rc buffer underflows. First ~200 frames looks ugly, but later result
outperform HCencoder, until I notice - in ~middle of the file artifact: at the top part of screen very heavy macroblocking
which tend to increase in size in following frames.
Mencoder:
9539
HCencoder:
9540
What was wrong with my batch files?
I’m sorry for my English!
I have Linux box which is on all the day(proxy sever), it would be great that I can use it for encoding purposes also.
To find out closest Mencoder settings I encode part of video with HCencoder and then with Mencoder with similar
settings(I think). After compare them to each other:vbitrate=4000,vrc_maxrate=8500 .
First of all I try this batch:
E:\progra~1\mplayer\mencoder.exe -of mpeg -ovc lavc -nosound -lavcopts vcodec=mpeg2video:vmax_b_frames=2:vb_strategy=1:b_sensitivity=2:sc_threshold=-10000:top=0:alt:keyint=15:aspect=4/3:ildct:vrc_buf_size=1835:intra_matrix=8,8,8,9,11,13,14,17,8,8,9,11,13,13,14,17,8,8,11,12,13,14,17,94,9,11,13,13,14,17,17,94,11,11,13,13,14,17,94,94,13,13,14,16,17,20,94,94,13,13,14,17,94,94,94,94,13,14,17,94,94,94,94,94:inter_matrix=12,12,13,14,15,16,22,26,12,13,14,15,16,22,26,32,13,14,15,16,22,26,32,41,14,15,16,22,26,32,41,53,15,16,22,26,32,41,53,94,16,22,26,32,41,53,70,94,22,26,32,41,53,70,94,94,26,32,41,53,94,94,94,94:vpass=1:vbitrate=%3:vrc_maxrate=%4 %1 -o %2 of rawvideo -ffourcc MPG2
E:\progra~1\mplayer\mencoder.exe -of mpeg -ovc lavc -nosound -lavcopts vcodec=mpeg2video:vmax_b_frames=2:mbd=2:dc=9:cmp=258:precmp=258:preme=2:ildctcmp=258:b_sensitivity=2:sc_threshold=-10000:top=0:alt:keyint=15:aspect=4/3:ildct:vrc_buf_size=1835:intra_matrix=8,8,8,9,11,13,14,17,8,8,9,11,13,13,14,17,8,8,11,12,13,14,17,94,9,11,13,13,14,17,17,94,11,11,13,13,14,17,94,94,13,13,14,16,17,20,94,94,13,13,14,17,94,94,94,94,13,14,17,94,94,94,94,94:inter_matrix=12,12,13,14,15,16,22,26,12,13,14,15,16,22,26,32,13,14,15,16,22,26,32,41,14,15,16,22,26,32,41,53,15,16,22,26,32,41,53,94,16,22,26,32,41,53,70,94,22,26,32,41,53,70,94,94,26,32,41,53,94,94,94,94:vratetol=4000:vstrict=0:vpass=2:vbitrate=%3:vrc_maxrate=%4 %1 -o %2 of rawvideo -ffourcc MPG2
Result was similar with HCencoder except in static areas(walls) and scenes with high motion is noticeable macroblocking.
Then I tune batch with adaptive quantization settings:
E:\progra~1\mplayer\mencoder.exe -of mpeg -ovc lavc -nosound -lavcopts vcodec=mpeg2video:vpass=1:turbo:vqmin=3:vqscale=2:vrc_maxrate=%4:vrc_buf_size=1835:keyint=15:vqcomp=0.9:vmax_b_frames=2:vb_strategy=1:b_sensitivity=2:vb_qfactor=1.0:vb_qoffset=0.0:vi_qfactor=1.0:me_range=128:preme=2:dia=2:predia=2:mbd=2:mv0:dc=9:aspect=4/3:inter_matrix=12,12,13,14,15,16,22,26,12,13,14,15,16,22,26,32,13,14,15,16,22,26,32,41,14,15,16,22,26,32,41,53,15,16,22,26,32,41,53,94,16,22,26,32,41,53,70,94,22,26,32,41,53,70,94,94,26,32,41,53,94,94,94,94:intra_matrix=8,8,8,9,11,13,14,17,8,8,9,11,13,13,14,17,8,8,11,12,13,14,17,94,9,11,13,13,14,17,17,94,11,11,13,13,14,17,94,94,13,13,14,16,17,20,94,94,13,13,14,17,94,94,94,94,13,14,17,94,94,94,94,94:vlelim=-2:vcelim=3:ildct:sc_threshold=-10000:top=0:alt %1 -o %2 -of rawvideo -ffourcc MPG2
E:\progra~1\mplayer\mencoder.exe -of mpeg -ovc lavc -nosound -lavcopts vcodec=mpeg2video:vpass=2:vqmin=3:vrc_maxrate=%4:vrc_buf_size=1835:keyint=15:vqcomp=0.9:vmax_b_frames=2:b_sensitivity=2:bidir_refine=1:vb_qfactor=1.0:vb_qoffset=0.0:vi_qfactor=1.0:me_range=128:last_pred=1:preme=2:dia=2:predia=2:mbd=2:mv0:nssew=1000:mv0_threshold=128:dc=9:aspect=4/3:inter_matrix=12,12,13,14,15,16,22,26,12,13,14,15,16,22,26,32,13,14,15,16,22,26,32,41,14,15,16,22,26,32,41,53,15,16,22,26,32,41,53,94,16,22,26,32,41,53,70,94,22,26,32,41,53,70,94,94,26,32,41,53,94,94,94,94:intra_matrix=8,8,8,9,11,13,14,17,8,8,9,11,13,13,14,17,8,8,11,12,13,14,17,94,9,11,13,13,14,17,17,94,11,11,13,13,14,17,94,94,13,13,14,16,17,20,94,94,13,13,14,17,94,94,94,94,13,14,17,94,94,94,94,94:lumi_mask=0.05:dark_mask=0.3:tcplx_mask=0.1:scplx_mask=0.1:vlelim=-2:vcelim=3:naq:vbitrate=%3:vratetol=4000:vstrict=0:ildct:sc_threshold=-10000:top=0:alt:threads=1 %1 -o %2 -of rawvideo -ffourcc MPG2
Mencoder in some places report that there were rc buffer underflows. First ~200 frames looks ugly, but later result
outperform HCencoder, until I notice - in ~middle of the file artifact: at the top part of screen very heavy macroblocking
which tend to increase in size in following frames.
Mencoder:
9539
HCencoder:
9540
What was wrong with my batch files?
I’m sorry for my English!