On Tue, Aug 24, 2021 at 07:00:54PM -0700, Dan Dennedy wrote:
> On Tue, Aug 24, 2021 at 6:06 PM amindfv--- via Mlt-devel <
> mlt-devel@lists.sourceforge.net> wrote:
> 
> > Thank you, this is exactly the type of clear answer I was hoping for!
> >
> > A couple follow-up questions:
> >
> >   - I seem to be able to, with the calculation on line 371 linked below,
> > get frame-inaccurate results, i.e. dropped or added frames. For example,
> > with the simple timecode "01:01:00.1" at 23.976 fps: I think the un-rounded
> > value should be 87754.5576, so I'd expect the rounded value to be either
> > 87754 or 87755. However, it's 87753! [0] I think this may be caused by
> > using "floor" for the hours and minutes, in combination with the fractional
> > frame rate.
> >
> >
> 23.976 is the rounded form of 24000/1001, which is the more typical value.
> In any case, from here you can see unit tests that exercise this:
> 
> https://github.com/mltframework/mlt/blob/master/src/tests/test_properties/test_properties.cpp#L188
> 
> A few of these cycle through 9999999 frames (over 11 hours at 240 fps) at
> some common frame rates to ensure that when you convert from frame number
> to a clock time value and back that you get the same frame number. But I do
> not think every frame rate is going to work with the limited precision of
> milliseconds.

Awesome!

> 
> 
> >   - It seems `lrint` determines its rounding direction depending on values
> > in the current environment. That seems to mean a user can also lose sample
> > accuracy if, for example, `lrint` rounds one way on my machine and then a
> > friend reads my .mlt file with a different rounding direction. Is this true?
> >
> >
> Not to my understanding. The rounding mode can be set programmatically
> using fesetround() where the "e" refers to an "environment" in the
> documentation, but that is not the same thing as an environment variable.
> It refers to the process runtime state and mentions no environment
> variables. MLT does not call this, and while it is possible an application
> has that seems rather rare.

I'd still wonder about differences in defaults across platforms but this is 
good enough for me, thanks.

Tom



_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to