9.2. EnVe Application

The EnVe video editor is a useful, interactive movie editing application built using the Python Qt GUI to demonstrate a subset of the EnVe Module Interface. It is appropriately called EnVe (EnSight Video editor). Note you can modify and convert images with this application, but it is designed for movies. This can be started by opening a cmd window and typing enve or by double clicking on the EnVe 2024 R2 icon.

Simply read in movies that you would like to sequence, convert format, change resolution, or apply fade in / fade out effects. EnVe can read in formats supported by the current UDIL libraries in the EnSight install. Also, we only guarantee that to read in data formats that were written by Ansys tools. For example, we can read an AVI file we wrote, but not necessarily an AVI file that came from the web. This is true of a lot of the multi-codec formats. See the previous examples of listing the codecs.

Using the EnVe Application Interactively

  1. There are three ways of importing movies and images into EnVe:

    • Drag and Drop the media onto the Input movies dialog.

    • Clicking Add.

    • Selecting FileAdd movie (This menu is also used to import images).

  2. Choose FileImport image sequence as a movie... and choose the first file in the sequence to add them all

    OR

    simply select all the files and drag them onto the Input movies field.


Note:  Choose FileImport image sequence as a movie.... and choose the first file in the sequence to add them all or simply select all the files and drag them onto the Input movies field.


This is your sequential list of input movies.


Note:  If the filenames contain L and R then stereo is assumed: file001l.png, file001r.png, ...


This area has info on the output movie.

Choose the output file prefix.


Note:  If you add an extension (for example, .mp4), it will be removed.


Choose the output format, format options, stereo option, frames per second, smoothing option, output dimensions, and/or tiling. EnVe adds the extension based on the output format.

  1. HW Stereo same as EnSight interleaved stereo: two images each frame.

    Other options are anaglyph stereo using colors.

  2. Click on Format to see all the codecs available.

    EnVe codecs are guaranteed to be compatible with all EnSight/EnVideo output on any platform, but may not be able to import all images and movies generated outside the EnSight ecosystem.

  3. Params include format, format options, stereo type, frames per sec (-1 is format default), smoothing toggle, dimensions (0 is use input movie dimensions) and MTM is multi-tile (movie is divided into nxm tiles and a .mtm master text file is written.

    See Multi-Tiled Movie (MTM) File Format.

  1. Toggle to flip image

  2. Enter how many frames to repeat at beginning and end of the selected movies guardrail.evo above.

  3. Choose intensity for a fade of the selected input movie(s).


    Note:  You must press Enter after each field entry!


  1. Copy the visible frame to the clipboard for use elsewhere.

  2. Click to generate output movie with extension appropriate for format.

  3. Use slider to look at your movie frame by frame, or to choose a frame for cropping.

  4. Crop start to make the current frame as the first in your output movie. Move the slider again to the right. Crop end to make that frame the final frame in your output movie. Crop reset to use the whole movie.

EnVe Application Stereo Utilities

EnVe has five other useful stereo utilities completely unrelated to the input movie that you have chosen, or the output movie or parameters that you have chosen.

Pick one of these options and you will be prompted for an input stereo movie and output prefix (these utilities will ignore the extension even if you add it onto the prefix). EnVe will write out an EVO movie using the option you have chosen with an .evo extension.

Using the EnVe Application in Batch

EnVe can be run with no graphical user interface using a python file. Python modules can only be loaded from the sys.path location. EnVe does not include all of the directories in the sys.path that are available in EnSight. EnVe does load the enve module implicitly and can load other python modules only from $CEI/enve242. As such the ens_utils.py high-level utilities are available to be run only with EnSight, and running enve in batch requires the use of lower-level enve routines, thus requires a bit of programming. To run enve without a graphical user interface using a python file, type in the following from the command line:

%enve242 -nogui filename.py

Shown below is an example python that can be run in batch to convert all of the EnVideo format (.evo) files to .avi format. Simply copy/paste this into a file named enve_convert.py and run it as shown below.


Note:  The enve module is implicitly imported into EnVe.


#
# convert evo format movies found in the
# current working directory to avi using EnVe
#
# batch execute like this:
# %enve194 -nogui enve_convert.py
#
#
import os
import glob
# The input movies are expected to be *.evo 
files = glob.glob('*.evo')

# Common target format options: AVI, MPEG, MOV, GIF, EVO
# Set this variable to your format choice from the above list 
targetFormat = "AVI"

for m in files:
    if not os.path.exists(m):
        print("++ Attention, this file doesn't exist: {}".format(m))
        continue

    m1 = enve.movie(enve.MOVIE_READ)
    m1.filename = m
    m1.open()
    
    convertedFile = m[:-4]   
    m2 = enve.movie(enve.MOVIE_WRITE)
    m2.filename = convertedFile
    m2.format = targetFormat 
    m2.addcount(m1)

    print(("++ converting {} to {} to {}".format(m1.filename, m2.filename, str("."+targetFormat)))
    m2.open()
    m2.append(m1); m2.close()
    m1.close()

print("\n++ enveConvert is done")

Using the EnVe Module in EnSight in Batch

Alternatively you can do the same thing using EnSight in batch using the ens_utils.py routines to make much simpler code.

%ensight242 -batch -p movie_convert.py

Shown below is the simpler code

#
#  Run as ensight -batch -p movie_convert.py
#   to convert every evo movie in the current directory
#   to avi format
#
import ens_utils as eu
file_list = eu.get_file_list('./*.evo') 
for fil in file_list:
    fdict = eu.split_filename(fil)
    print("++ converting {} to {}".format(fil, str(fdict['file prefix']+'.avi')))
    eu.convert_movie(fil,fdict['file prefix']+'.avi')
print("\n++ movieConvert is done")