[MEncoder-users] framerate denominator and numerator got much bigger after encoding

Corey Hickey bugfood-ml at fatooh.org
Wed Apr 23 09:10:03 CEST 2008


RC wrote:
> On Wed, 23 Apr 2008 09:06:38 +0800
> JRaSH <jrash06 at 163.com> wrote:
> 
>> Could anyone tell me how I can control the behaviour of MEncoder so
>> that the denominator and numerator will stay the same as the source?
> 
> There is no numerator or denominator.  There is only a single frame-rate
> value stored in the file.  There are millions of possible different ways
> to represent that number it, for the sake of humans.  

In AVI, samplerate and framerate are stored as a numerator and
denominator: dwRate and dwScale.

http://msdn2.microsoft.com/en-us/library/ms902872.aspx

-----------------------------------------------------------------------
dwScale
    Used with dwRate to specify the time scale that this stream will
use. Dividing dwRate by dwScale gives the number of samples per second.
For video streams, this rate should be the frame rate. For audio
streams, this rate should correspond to the time needed for nBlockAlign
bytes of audio, which for PCM audio simply reduces to the sample rate.
dwRate
    See dwScale.
-----------------------------------------------------------------------

To the original poster: what values are you seeing? Run "mplayer -v
outputfile.avi" and look for a block like this:


====== STREAM Header =====
Type: vids   FCC: xvid (64697678)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 24000/1001 = 23.976           <---------look at this line
Start: 0   Len: 83093
Suggested BufferSize: 108990
Quality 10000
Sample size: 0
==========================

In general, mplayer will simply copy the input framerate to the output
framerate, unless you specify -ofps. I think the problem is in the
avisynth demuxer, but I can't test it. Try the attached patch. Maybe
it'll work; maybe it'll segfault; maybe it won't compile.

You can additionally try removing the line right above the lines my
patch adds:
sh_video->fps = (float) ((float) AVS->video_info->fps_numerator / ...

-Corey
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: avs_dwratescale.diff
URL: <http://lists.mplayerhq.hu/pipermail/mencoder-users/attachments/20080423/91c1f855/attachment.txt>


More information about the MEncoder-users mailing list