First of all, this sounds like more an ffmpeg question than a VXL question.  I imagine that you would notice similar results if you produced these videos with the ffmpeg command line tool using the same settings.  So you might consider posing this question to the ffmpeg community (leaving out the vidl details).

  There are two things to keep in mind about the video encoding format.  First, there is the container type (.wmv, .avi, .mpg, etc.) which is the file format used to hold a combination of audio and video data.  Second, there is the video codec (msmpeg4v2, wmv9, mjpeg, etc) which specifies how to encoded the video data.  You can mix and match containers and codecs to some degree, but some containers only support certain codecs.  I know avi supports msmpeg4v2, but I am not sure about the wmv container.  There are several versions of wmv codecs designed to work with the wmv container.  I think ffmpeg supports some of the older wmv codecs but not the most recent.  Codec support also depends on the options when you compiled ffmpeg.

  Currently vidl only supports a subset of codecs found in ffmpeg.  There are no wmv codecs in this list.  If you feel adventurous you could try to add wmv codecs to vidl and then submit a patch.  Otherwise, the easier solution is to produce an avi file and then convert it to wmv with the ffmpeg command line tool or your favorite video editor.


P.S.  to add a new ffmpeg encoder to vidl you need to add an entry into the enum


and then make the appropriate mapping between the new enum entry and the corresponding type in ffmpeg.  For example, see vidl_ffmpeg_ostream_v3.txx line 137.

On Tue, Nov 10, 2009 at 10:03 AM, Geoffrey Treen <> wrote:


I would like to write out a .wmv video using ffmpeg_ostream. Here is my code snippet:

vidl_ffmpeg_ostream my_ostream ("video.wmv",
.encoder( vidl_ffmpeg_ostream_params::MSMPEG4V2 )
.frame_rate( (frame_rate) )
.bit_rate (5000));

// iterate through the FIFO from oldest to newest frame
// write the video sequence

while (current->frame != NULL && --i) {

 wframe = current->frame ;
  my_ostream.write_frame(wframe) ;

 current  = current->prev ;


my_ostream.close () ;

The resulting video.wmv is very choppy and doesn't seem to contain every frame. Also, Windows does not seem to be able to read properties like the frame rate or video length. If, however, I switch the extension to ".avi", all of this info is present in the file, and the video plays normally. I'm wondering, are there extra parameters to set when writing WMV files? Or is ffmpeg_ostream not intended for this?

Many thanks,

The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free!

Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
Vxl-users mailing list