I use AVS/Express a lot to produce movies on my Linux machine. After some experiment I have found a method to create better quality movies. This effort started from the problems I had with the AVS/Express image_capture module.
The two methods offered by AVS/Express image_capture module have the following problems:
Instead mencoder (found on the MPLAYER page) can create standard MPEG4 compressed movies starting from a sequence of images or the above mentioned nonstandard ZLIB compressed AVI movies.
To create movies compatible with the PC Windows platform mencoder can even use the Microsoft MPEG4 V2 codec found on every Windows machine.
The following suggestions are general and useful also outside AVS/Express usage.
~/.mplayer
directory:mencoder
text filesubfont.ttf
. I have
copied arial.ttf
font file from a Windows machine~/.mplayer/font
subdirectory)LD_LIBRARY_PATH
and PATH
definitions to point to the installed mencoder libraries and executable.Select the coding method you want to use. Basically you have two choices:
This is the most convenient movie generation mode from AVS/Express on Linux. The recipe is implemented in the mencoder_zlib.sh script:
avs.avi
).
Then press Generate Movie.optimal_bitrate = 50 * 25 * width * height / 256For a standard 768x576 format the optimal bitrate will be: 2160000
frameno.avi
movie if present. It can interfere with the two pass compression.opt="vbitrate=2160000:mbd=2:keyint=132:vqblur=1.0:cmp=2:subcmp=2:dia=2:mv0:last_pred=3" mencoder -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=1:$opt -nosound -o /dev/null avs.avi mencoder -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=2:$opt -nosound -o output.avi avs.aviFor the mpeg4 codec:
opt="vbitrate=2160000:mbd=2:keyint=132:v4mv:vqmin=3:lumi_mask=0.07:dark_mask=0.2:scplx_mask=0.1:tcplx_mask=0.1:naq" mencoder -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:$opt -nosound -o /dev/null avs.avi mencoder -ovc lavc -lavcopts vcodec=mpeg4:vpass=2:$opt -nosound -o output.avi avs.avi
rm -f divx2pass.log
output.avi
movie! On Linux you can use
mplayer to play it. Its quality is far better
than xine (another Linux AVI player).Here is the recipe implemented in the mencoder.sh script:
convert
command.
For example:
convert AVS:Img0000.x Img0000.sgiThe SGI RGB format has been selected because it is not compressed and does not fail for a mencoder bug that affects the PNG format.
optimal_bitrate = 50 * 25 * width * height / 256For a standard 768x576 format the optimal bitrate will be: 2160000
opt="vbitrate=2160000:mbd=2:keyint=132:v4mv:vqmin=3:vlelim=-4:vcelim=7:lumi_mask=0.07:dark_mask=0.10:\ naq:vqcomp=0.7:vqblur=0.2:mpeg_quant"For scientific visualization movies (lot of hard edges) I have found interesting also the following set of parameters:
opt="vbitrate=2160000:mbd=2:keyint=132:v4mv:vqmin=3:lumi_mask=0.07:dark_mask=0.2:mpeg_quant:scplx_mask=0.1:\ tcplx_mask=0.1:naq"Anyway, I plan to test various sets of parameters to find the best one at least on common (for me) cases.
opt="vbitrate=2160000:mbd=2:keyint=132:vqblur=1.0:cmp=2:subcmp=2:dia=2:mv0:last_pred=3"
frameno.avi
movie if present. It can interfere with the two pass compression.mencoder -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=1:$opt -mf type=sgi:fps=25 -nosound -o /dev/null mf://\*.sgi mencoder -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=2:$opt -mf type=sgi:fps=25 -nosound -o output.avi mf://\*.sgiFor the mpeg4 codec:
mencoder -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:$opt -mf type=sgi:fps=25 -nosound -o /dev/null mf://\*.sgi mencoder -ovc lavc -lavcopts vcodec=mpeg4:vpass=2:$opt -mf type=sgi:fps=25 -nosound -o output.avi mf://\*.sgiTo change the movie speed change the fps=25 parameter
rm -f divx2pass.log Imag*.sgi
output.avi
movie!Other useful suggestions on how to create and compress movies with mencoder can be found here:
DOCS/en/encoding.html
and DOCS/en/documentation.html
-mf
option usage as documented here is
no longer valid)Much more experimentation should be done, but for now it is a good starting point, at least for me. Please let me know if you have suggestions or more experiences.