[MEncoder-users] WMV file - removing stream

Grégory SCHMITT gy.schmitt at gmail.com
Tue Sep 16 03:37:35 CEST 2008

----- Original Message -----
> Date: Sun, 14 Sep 2008 21:24:49 -0400
> De: Grégory SCHMITT <gy.schmitt at gmail.com>
> À: mencoder-users at mplayerhq.hu
> Sujet: WMV file - removing stream

> Hello,
> First of all, I'm a bit of a newbie when it comes to advanced video
> manipulations, so please bear with me if I ask a stupid question.
> I have a bunch of wmv files (which are the result of a daily, free tv
> show available on the Internet). The show is offered for streaming via
> a mms protocol. So far, I was downloading them using mplayer and the
> -dumpstream option, so I could save it for later use and burn on a
> dvd-rom.
> Until September, the wmv simply had a video stream (at 290kbps) and an
> audio stream, everything muxed together in a wmv container. Since
> early September, the broadcaster has decided to bring a change and
> offer the show in two different video qualities, 377kbps and 177kbps,
> with two different streams, still with a single audio stream, in one
> file. I have successfuly isolated the two video by using the
> -dumpvideo option, with -vid 02 and -vid 03, and indeed, vid 02 is
> more than two times the size of vid 03. I can however barely notice
> the quality difference between the two streams (quality is not a
> concern here, 177kbps is good enough for my needs).
> Now my question: I want to download AND save only one video stream,
> not both. Worst case scenario, I'll dump the complete stream and
> modify it to remove vid 02.
> I've tried using the -dumpvideo and -dumpaudio options, which work
> fine and have now two dumps; however, according to mplayer doc, these
> dumps won't be of any use to me. Is there any way to re-multiplex
> them into a single file ? 
> I also tried using mencoder with -ovc copy and -oac copy directly from
> the wmf file to an avi file, but the resulting file behaves erraticaly
> (tons of error messages during encoding, choppy play...).
> Thanks for any help you could bring me.

OK, I found my answers.

Partial downloading (mplayer -dumpstream -aid x -vid x
mms://some_stuff) doesn't work; the full stream needs to be downloaded.

For encoding,  the solution is

/usr/bin/mencoder -aid 1 -vid 3 -ovc copy -oac copy -of lavf -o dump.mkv dump.wmv 1>/dev/null 2>/dev/null 

It works pretty well for my needs and is extremely quick to do (15s on
my 800mhz computer). It does output a lot of error messages though
regarding skipped frames, and using an avi container will result in a
choppy play, when matroska is perfect.

Grégory SCHMITT <mailto:gy.schmitt at gmail.com>

More information about the MEncoder-users mailing list