[theora-dev] MPLayer export to encoder

emaillist at dogphilosophy.net emaillist at dogphilosophy.net
Thu Sep 26 23:33:30 PDT 2002



On Thursday 26 September 2002 08:51 pm, Monty wrote:
> A micro-micro howto is alreade in the README. Feel free to add to it.

I should be able to at least add some specific command-line examples
and 'tricks', if nothing else...

> One question I haven't found an answer to, though: When outputiing
> from mplayer into yuv4mpeg format, mplayer will not fill in frames the
> original encoding dropped (eg, decoding a DiVX with dropped frames to
> meet the bitrate target).  Because yuv4mpeg2 contains no timing
> information, there's no way to tell the theora decoder that video just
> lost sync with audio.
>
> Is there an easy way that I'm missing to have mplayer fill in the
> dropped frames?  If not, I'll have to hack one...

Hmmmmm.  That one I'm not sure about - but would running the original
through mencoder help 'fill in' the missing frames?:

mencoder -oac copy -ovc copy -ofps 29.970 -o fixeddivx.avi dropframesdivx.avi

?  Don't know, personally, but it seemed like a possibility.  I've used this
trick to 'correct' framerates in divx and other files before, so it might.  
Unfortunately, mplayer doesn't seem to have the -ofps option, so it can't,
as far as I know, be done 'on the fly'.

One problem I seem to be running into is that I cannot seem to get the example
encoder to read the pcm data from a fifo (it reads the video data from there
just fine.)  It's a trick I picked up from the mencvcd script that comes with
mplayer for making SVCD's with the mp2enc and mpeg2enc files from the mjpeg
project:

mkfifo -m 660 stream.yuv
mkfifo -m 660 stream.wav

mplayer -ao pcm -aofile stream.wav -vo yuv4mpeg file_to_transcode.avi

encoder_example -a 1 -v 1 stream.wav stream.yuv > output.ogg

doing this, encoder_example just sits there.  'top' shows no activity from
either mplayer or encoder_example.  If I either exclude audio altogether or
use a 'finished' .wav file instead of a fifo, the encode seems to go okay,
so it seems to be specifically the .wav file (stream.yuv works as a fifo for
encoder_example just fine.)  mp2enc is able to read from the stream.wav as a
fifo okay.  Is mp2enc simply making reasonable 'assumptions' about the stream
that the stream itself isn't supplying?

Not a big deal - for the file I'm test-encoding right now, I just dumped the 
audio to a .wav file, and have encoder_example read from that 'finished' file
while I have mplayer exporting to the stream.yuv fifo (and -ao null -nosound).

I'm currently test-encoding a 12-minute mpeg2 video (~300MB) from the
Prelinger archives, but it's past my bedtime, so I'll check the results
in the morning...

Here's another 'general' question - is there any way to correlate the audio
and video bitrates that result (approximately) with the 'quality settings'?
I.E. -a 1 approximately 64-72kbps, -v 1 approximately 550-600kbps (etc.)?
(On reflection, I suppose that's a stupid question, as I imagine it depends
on framerate and size...perhaps a 'table' of approximations at different rates 
and sizes?  That's what I get for trying to think past my bedtime....)
--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'theora-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Theora-dev mailing list