VMD High Resolution Image and Movie

A nice wiki can be found here. The followings are my take home notes from various blogs and wikies.

High resolution image

Here are some steps which I usually follow to make high quality image from VMD.
  • Set the visualization screen (vmdscene) according to requirement
  • Render the vmdscene  using tachyon mode.
  • File -> Render -> Tachyon
  • Change the default Render command to have something like
  • "/tachyon_path/tachyon_exe" -aasamples 12 %s -format TGA -res 1024 1024 -o %s.tga
    • (The resolution can be tuned by changing the value for -res option (which is 1024 1024 in this case).
  • Enable Ambient occlusion lighting in the Display -> Display Settings window by selecting "on" in "Amb. Occl" and "Shadows" choosers.
  • If AO effect is being used, the choice of  material also affect the final visual effects. Use  "Diffuse", "AOshiny", "AOChalky", or "AOEdgy" materials.
If the image size (dimension) needs to be changed, this can be achieved by resizing the vmd display size. This can be done as


From VMD Main:
  • Extension -> Tk Console
  • Type display resize x y
Set the x y values as per requirement.


Tachyon can also be used in parallel by using the -numthreads flag. To know available options use Tachyon -h commands.

High resolution video

Additional software: ffmpeg
  • First create the .dat file for each frame by choosing the following
  • Extension -> Visualization -> Movie Maker
  • Change the Movie Maker settings as
  • Renderer -> Tachyon
  • Name of the movie frame
  • Movie Settings -> Trajectory with ‘4. Delete image files’ uncheked
  • Format -> Targa Frames
  • Run this to generate the .dat files
  • Now process the *.dat files with the following option as slurm jobs
  • tachyon=/software/vmd-1.9.2-x86_64/lib64/tachyon_LINUXAMD64
  • ${tachyon} -numthreads 16 -aasamples 12 frame.${a}.dat -format TGA -res 512 512 -o frame.${a}.tga;
  • (Change all the numbers accordingly)
  • If a huge number of frames are required, then the job can be split as multiple slurm jobs which will speed up the whole process
  • Finally process all the image files with ffmpeg
  • ffmpeg -threads 16 -r 30 -i frmae.%05d.tga -s 512x512 -vcodec libx264 -b 5000k movie.mpg
  • (by assuming all the frames has dimension 512x512. If the frame dimension has changed by display resize command, then that value needs to be used here)
  • One can also play with the ffmpeg options


N. B. - Please make sure to have enough hard disk space before running these jobs.

One more method for movie (less time consuming)

  • Renderer -> POV-Ray
  • Movie Settings -> Trajectory with ‘4. Delete image files’ uncheked
  • Format TARGA Frame (ImageMagic)
  • ffmpeg -threads 4 -r 30 -i final.frame.%05d.tga -s 512x512 -vcodec libx264 -b 5000k movie.mpg


    Example of tachyon rendered image using the mentioned options




Comments


  1. Hello. Thank you for writing this post. Where to execute these commads?
    tachyon=/software/vmd-1.9.2-x86_64/lib64/tachyon_LINUXAMD64
    ${tachyon} -numthreads 16 -aasamples 12 frame.${a}.dat -format TGA -res 512 512 -o frame.${a}.tga;

    ReplyDelete

Post a Comment

Popular posts from this blog

Inset Plot in GRACE (Xmgrace)