.. -*- coding: utf-8 -*- .. |->| replace:: → ====================== Making movies in VMD ====================== Given a trajectory with maybe hundreds of frame, we can render each frame and then use a movie encoder to combine all frames into a movie. VMD_ has facilities to render and directly pass all the images to a movie encoder of your choice --- here we use the free FFmpeg_ encoder. .. _VMD: http://www.ks.uiuc.edu/Research/vmd/ .. _FFmpeg: https://www.ffmpeg.org Movie encoder: FFmpeg ===================== Install ``ffmpeg`` from https://ffmpeg.org Linux ----- Try installing with your package manager, e.g., on Ubuntu and Debian:: sudo aptitude install ffmpeg or get static build from https://www.ffmpeg.org/download.html and install it in your ``~/bin`` directory. Then make sure that ``ffmpeg`` is found on your :envvar:`PATH`:: echo "export PATH=$HOME/bin:$PATH" >> ~/.profile (You might have to log out and log in for this to have full effect later on.) Mac OS X -------- Get the dmg installer package from https://www.ffmpeg.org/download.html and make sure that ``ffmpeg`` can be found on your :envvar:`PATH`. Windows ------- Get the installer package from https://www.ffmpeg.org/download.html --- make sure you know where the ``ffmpeg.exe`` ended up. AdK transition movie ==================== We use the standard VMD plugin MovieMaker_. 1. Load the AdK transition trajectory from :doc:`dynamics/index`. 2. Use a nice representation, e.g. color the CORE, LID, and NMP domains. You can also find a number of salt bridges (pairs of basic/positively charged and acidic/negatively charge residues) that "zip up" AdK (see the `AdK zipping movie`_ from `Beckstein et al`_ [Beckstein2009]_). 3. Open :menuselection:`Extension --> Visualization --> Movie Maker` 4. Settings * *Renderer:* Snapshot (for "Hollywood"-style movies, use one of the ray tracers such as tachyon + AO) * *Movie Settings:* Trajectory * Set *Format* to MPEG-1 (ffmpeg). (MPEG-2 is better but support for MPEG-2 is not always present and then you cannot display it — but try it!). * Set your *working directory* to e.g. ``~/USERNAME/movies`` (so that you can easily find the finished movie) * *Name* your movie, e.g. ``adk_transition``. 5. *Make Movie*: should step through your trajectory, write out frames, and finally run ``ffmpeg``. 6. Go to your movie directory and play it (e.g., by double clicking or opening from the shell). .. _MovieMaker: http://www.ks.uiuc.edu/Research/vmd/plugins/vmdmovie/ .. _`AdK zipping movie`: http://www.sciencedirect.com/science/MiamiMultiMediaURL/1-s2.0-S0022283609011164/1-s2.0-S0022283609011164-mmc3.avi/272582/FULL/S0022283609011164/7884013894b4ebe37e40973d85374ae3/mmc3.avi .. _`Beckstein et al`: http://www.sciencedirect.com/science/article/pii/S0022283609011164 Advanced movie making ===================== In order to rotate and zoom a movie during a trajectory we can use the VMD ViewChangeRender_ plugin together with MovieMaker_. Open ViewChangeRender_: :menuselection:`Extensions --> Visualization --> ViewChangeRender`. Generate "viewpoints" of your movie: 1. Adjust position in trajectory, rotate, zoom. 2. Save Viewpoint 3. Repeat for as many viewpoints as you want to include. *Add all viewpoints to movie*: The final movie will smoothly interpolate between these points. You can check with *Preview Movie*. (Note that this plugin has a few bugs so you might have to quit and restart when it stops working.) Once you are ready to render the movie: 1. In ViewChangeRender: *Enable* 2. In MovieMaker: 1. *Movie Settings*: **User defined procedure** 2. Adjust other settings as needed... 3. *Make movie* .. _ViewChangeRender: http://www.ks.uiuc.edu/Research/vmd/plugins/viewchangerender/