# How to make a video of a gromacs gmx dump standard output with VMD

I did gmx trjconv on GROMACS trr file to generate a .xtc file, and then used gmx dump and saved its standard output in a file. Then I tried to make a movie with VMD using the file. As a result, it does not work properly. The error in the terminal is as follows.

gromacsplugin) Cannot read header fromm '/Users/kondouakira/mount/Lab/1ns_sim/md_0_1_noPBC3.trj', no error


I use following command.

gmx trjconv -s md.tpr -f md.trr -o md_0.trr -pbc mol -ur compact -b 1 -force
gmx dump -f md_0.trr > md_0.trj


No need to use gmx dump, you can simply load a xtc or trr trajectory in VMD using:

vmd path/to/gro_file.gro other/path/to/trajectory_file.xtc


As always you can also use the GUI to first open your gro file, then right click on the molecule and select Load data into molecule before selecting your xtc or trr file.

After putting the representations as you see fit, if you want to export this as a movie (GIF, MP4, others...) you can go in Extensions -> Visualization -> Movie Maker. See Trajectories and Movie Making VMD official tutorial for more details.

• Thank you for your answering! But I want to draw a video using a trj file.There is also a trj file option in the VMD file format. Therefore, I would like to know how to perform this to create a video. May 15 at 14:11

I don't think that the output of gmx dump can be read by VMD: the goal of this command is to provide a human-readable output, not to convert one trajectory format into another.

trj files are NOT the output of gmx dump. trj files were used in "old" versions of GROMACS to store trajectories (see trj file format documentation of GROMACS 5), and this is what VMD is awaiting, not the output of gmx dump. This is also why it tells you the header is wrong.

In recent versions of GROMACS trj files are no longer supported, probably as they were not in a binary format, hence took too much disk space (see Trajectory files formats in GROMACS 2021 documentation). Converting a .trr in a .trj was done by gmx trjconv, but I don't think this is possible anymore (see gmx trjconv supported trajectory formats in GROMACS 5 vs GROMACS 2021).

Why would you absolutely need gmx dump output to be read by VMD? The only reason I can see is a handmade script doing modifications to your trajectory. In this case I would recommend to instead look into some molecular dynamics python libraries, like MDAnalysis, PyTraj or MDTraj, which will also allow you to make minute modifications to the trajectory file while still reading it in its original format. You can also look harder into GROMACS tools, as they are quite complete.