[MPlayer-users] Script update

Meino Christian Cramer Meino.Cramer at gmx.de
Wed Jul 21 07:13:15 CEST 2004


From: Loren Merritt <lorenm at u.washington.edu>
Subject: Re: [MPlayer-users] Script update
Date: Tue, 20 Jul 2004 13:34:17 -0700 (PDT)

Hi Loren,

 thank you *very much* for your explanation and your patience with a
 want-to-know-but-currently-do-not-newbie :O)

 Please do not rate my question as any form of doubt -- I simply want to
 know why I am doing something in a certain way and I want to know the
 technique behind it. :) 


> On Tue, 20 Jul 2004, Meino Christian Cramer wrote:
> > From: Martin Collins <martin at mkcollins.org>
> >
> > > >   Why all this "divided by 16". I have no problems watching the
> > > >   results with mplayer. Or is there another trick I dont know yet?
> > >
> > > It's to get the best performance out of the encoder. Your result may
> > > be watchable but it could have been smaller/better quality.
> >
> >   Ah! Got it! Will see, how I can put this into the script without
> >   killing the possibility to not follow the "rule of the sixteen" --
> >   ...if one wants to...
> 
> No! You _always_ encode at resolutions divisible by 16. 
> If you don't want
> to crop off the extra lines, then scale to the next lower resolution. If
> that changes the aspect ratio, then make it anamorphic.
> (with "-lavcopts autoaspect", and/or with mkvmerge (below))
> If you're encoding at high bitrates and don't want to lose detail to
> downscaling or cropping, then even upscaling is better
> (compression efficiency wise) than encoding to non-mod-16 resolutions.

  Is it the compression ratio only I loose or are there are other
  parameters effected when breaking this sweet-sixteen rule ?

> > > If you use -dumpaudio instead then encode the audio using lame or
> > > oggenc you can measure the size of the audio and calculate the
> > > required video bitrate for any target size.
> >
> >   May be a very newbie question, but...
> >   How ?
> 
>   mplayer dvd://42 -alang en -vc null -vo null -ao pcm -aofile foo.wav
>   oggenc -q 4 foo.wav

	Ooops...sorry...my simple "how?" was a little too simple -- I
	broke Einsteins rule of "Make things as simple as possible -- but
	make them not simpler!"...:)

	I meant:
	How can I calculate the bitrate by a given size of an audio file.

	And another question:
	Suppose I want "mp3" as the target format for the audio file, would
	it be possible to do something like:

    mplayer dvd://42 -alang en -vc null -vo null -ao mp3 <some lame
    opts> -aofile foo.mp3

	And if this would be possible...are there any other aspects, which
	contradict this possibility ?


> > > It also allows the use of
> > > vorbis or other audio codecs not directly supported by mencoder.
> >
> >   How to playback then?
> 
> MPlayer supports everything. It's just mencoder that's limited.

  Ah! Oh! Good nes! :)

  By the way: complete different question: Does anyone know, what
  formats others than DVD are supported by the MacOSX ? I read
  soemthing like "Soerenson" -- whatever it is, looks a little
  esoteric to me...but are there others, more common ones, which are
  supported "out of the box" without the need to install
  mlpayer/ffmpeg on MacOXS (I myself runs Linux).

> > > use -oac copy on the two video passes, which maintains sync, then mux
> >
> >   Stop! One moment please...
> >
> >   Mux? What is "mux" and how can I "mux" something?
> >   Container?
> >   ...please...what ?
> 
> "container" is the file you put video and stuff in. A compressed bitstream
> isn't very useful by itself: you need a way to seek, and some headers to
> tell you what compression format/resolution/etc it is.

  Aha! :)

> The most common container format, and the only one supported by mencoder,
> is AVI (and sorta mpeg). But AVI isn't the best container out there. The
> best one IMHO is Matrsoka, (at least until we get around to finalizing
> Nut). 

  What is a "finalizing Nut" -- sorry, English isn't my mother's
  tonque and looking into my dictionary give me two german words for
  "nut" and "finalizing" but the context of both makes no sense, then.

> Matroska supports things like VBR audio (including Vorbis),
> multiple audio streams, subtitles, chapters, seeking without an index,
> and all with less bitrate overhead than AVI.

  That sounds very good...I will try to install the matroska stuff
  here on my box...will see then...
 
> "mux" is to put video and audio and metadata into a container file.

  Good! :)

> To mux:
> Compress video to foo.avi (with perhaps -oac copy to maintain sync,
> though I've never needed it), 

  I thought I should not "-oac copy" and all this three-pass-stuff?
  Instead I should "-dumpaudio" ....

  ( I got a slight headache...;)

> and compress audio separately as above.
> Then:
>   mkvmerge -o foo.mkv -A foo.avi foo.ogg
> 
> (With a bunch more optional parameters if you want the other features I
> mentioned.)
> 
> > > > > This is why I like to see people's scripts; there's always
> > > > > something in them that strikes me as bizarre :-) I see now why you
> > > > > export all your variables.
> > > >
> > > >   Yes...äh...why?
> > >
> > > Opening a new terminal window for each encoding pass is not
> > > necessary.
> > > I do my encoding in the background while I do something else. Having
> > > windows pop up at random could get irritating.
> 
> Likewise.
> I use "nohup nice +19 my_encode_script &" and forget about it for a day.

  HU? Does it take that long ????

> >   That's a matter of personal preferences.
> >   I will make it switcheable...
> >
> > > >   But If you another smooth way to feed more than one file into
> > > >   mencoder seamlessly I am open for any improvement!
> > >
> > > It is usually recommended to either encode straight from the dvd
> >
> >   urks...not with /my/ "drive"... ;)
> >
> > > or use
> > > vobcopy to rip the vobs first or to cat the vobs in to one file before
> > > encoding them.
> >
> >   What is the problem when catting more than one file in comparison
> >   with catting one file?
> >
> >   Does some systems/OSSes hickup?
> 
> It depends on the input format. The only problem I've noticed with vobs is
> that you don't have the vts_*.ifo when catting, so you can't use -slang
> or -alang or -chapter. But really, it's just as easy to use
>   mencoder dvd://42 -dvd-device /path/to/vobs/
> than
>   cat /path/to/vobs/vts_42_*.vob | mencoder -

	I thougth to cat isn't a good idea...

	(my headache increases)

> 
> However, I have yet to find a good way to take multiple avis as input.
> Sometimes hqdn3d just doesn't cut it, so I use Avisynth for filtering,
> and save the intermediate video to huffyuv. But Wine doesn't support
> files bigger than 4GB, avicat is limited to 2GB (doesn't use ODML), and
> you can't just
>   cat *.avi | mencoder -
> (It stops after encoding the first avi.)
> 
> I have tried looking into making mencoder take multiple input files, but
> haven't made heads or tails of the mess that is mencoder.c
> 
> Maybe a libavcodec wrapper for Avisynth is next...

  What is "better":

  libmpeg2 or ffmpeg/lavcode for decoding?

  Any why?

> --Loren Merritt

Meino Cramer




More information about the MPlayer-users mailing list