MediaView

External Video Decoder

External Video Decoder

Previous topic Next topic Expand/collapse all hidden text  

External Video Decoder

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Beginning with version 11.0, MediaView can open video files which were unreadable in previous versions by using external programs as format translators, which create an AVI file using the MJPEG codec.  The old, unreadable file is left intact and a new file is created and loaded.  This functionality is available both on Windows and Linux. If you attempt to load an unreadable file into MediaView and HyperWorks is not able to directly read the file, it will display a prompt, asking you if it can perform an external conversion.  If you answer yes, then the script or batch file specified in the preference statement *ExternalConverter() will run.  An output file is displayed, either in the directory specified in the first argument of the preference statement *ConverterOutputSettings(), or in a subdirectory called Altair_Video, which is located in the same directory as the location of the unreadable video file.  When the conversion is complete, MediaView loads the converted video file.  If the second argument in *ConverterOutputSettings() is set to 1, then MediaView attempts to reload previously converted files rather than re-converting them each time they are loaded.

Prerequisites

A compiled version of ffmpeg, mplayer or both is needed to convert an unreadable file. Ffmpeg is preferred, as version 0.6.1 or later has Indeo version 5 support.  If you need ffmpeg for Windows, there are already precompiled versions available from many places on the Web.  Here is a currently valid link for a precompiled Windows ffmpeg:

http://ffmpeg.arrozcru.com/autobuilds/

You can also obtain source code from the Web for ffmpeg and compile it yourself (see http://www.ffmpeg.org).  If you need Linux support, you will need to use the source and compile it, as the availability of ffmpeg builds for specific Linux versions is scarce.

hmtoggle_plus1Use the external video decoder:
1.Obtain the ffmpeg or mplayer (see Prerequisites for more information).
2.From the [install_directory]/hw/prefinc folder, view the preferences_video.mvw file and verify that the *ExternalConverter() command is present and that a batch (Windows) or script file (Linux) exists in the location specified by the command.  By default, this file will be named ffmpeg_codec_converter.
3.Edit the file located in the path from the *ExternalConverter() statement.  For Windows, edit the file with a .BAT extension.  The default command in the ffmpeg_codec_converter command is c:\\zvideo\\ffmpeg_converter\\ffmpeg -i %1 -y -vcodec mjpeg %2.  You will need to replace the path ahead of ffmpeg with the path where your ffmpeg.exe is located.  See the Relevant Statements section below for more information.
4.Start HyperWorks and attempt to open a video file that was unreadable in version 10.0 or older.
5.When prompted, click Yes to start the external conversion process.
6.You should soon see your video in HyperWorks (version 11.0 or later).

Relevant Statements in preferences_video.mvw

Below are brief descriptions of the Preference statements that are used with the external video decoder.  You can also click on the name of the statement to view them the on-line help for them.

For the external video decoder to work properly, you will need to modify the paths in these statements to point to the location of the scripts, which are located in [install_directory]/hw/examples/video.  You will also need to modify the path to ffmpeg or mplayer in those scripts to point at the actual location where you have your ffmpeg binary.

*ConverterOutputSettings(output_dir, use_existing, keep_jpegs)

output_dir is the directory to be used to hold the output of the conversion process (jpeg files and video).  If no directory is specified, an Altair_Video subdirectory will be created in the same directory as the input video file.
use_existing is a flag meaning that if there are already converted files found in the output directory, they should be reused instead of re-running the conversion.  The value can be either ‘1’ to reuse files, or ‘0’ to ignore old files and re-convert each time.
keep_jpegs is currently ignored.

*ExternalConverter(path) - The path to a script to be launched for converting a non-readable video file to an MJPEG file.

See Also

External Video Decoder - Linux 32-bit Compatibility