This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Video effects and LC_NUMERIC

Tags: None
(comma "," separated)
grzes
Registered Member
Posts
7
Karma
0

Video effects and LC_NUMERIC

Mon Nov 22, 2010 3:05 pm
There is a problem with video effects and Polish localization.

I'm not sure if I post to the correct forum, but it's definitely not a Translation issue.

In LC_NUMERIC=pl_PL, comma stands as decimal point (pi is "3,14159", not "3.14159").

1. The kdenlive itself, when passes knob values and other variables (like "brightness", "contrast", "start") to video effects, apparently ignores the locale and serializes them with point as decimal point, e.g. brightness as string "0.9". (I observed this)

2. The mlt, however, does apply the locale when parsing these strings, and expects ',' as decimal point, not '.'; it's because it calls atof() from glibc, which in turn is locale-aware and with LC_NUMERIC=pl_PL, atof("0.9") returns 0, not 0.9 (to get 0.9, one should call atof("0,9")). Therefore, for any serialized x, it returns Entier(x) of x instead of x itself. (I traced this)

3. frei0r apparently is also locale-aware and expects commas. (I observed this)

The overall effects of above is that hardly any effect works properly. For example, "brightness (keyframable)" generates a pitch black image for brightness < 1.0, passes the picture as-is for 1.0 <= brigtness < 2.0, and doubles the luma (for most cases overburning the picture) for 2.0 <= brightnes < 3.0.

The workaround is to always run kdenlive with LC_NUMERIC=C. (works for me)

The caveat is that all *.kdenlive projects created with LC_NUMERIC=pl_PL need some perling or seding to convert all numbers from "x,xxx" to "x.xxx", otherwise they will not open properly with LC_NUMERIC=C. (I tried this with my files)

Sincerely,
Grzegorz Borowiak
grzes
Registered Member
Posts
7
Karma
0

Re: Video effects and LC_NUMERIC

Mon Nov 22, 2010 3:07 pm
* I'm not sure if I post to the correct forum, but this definitely has nothing to do with Translation.
ttill
Registered Member
Posts
372
Karma
0

Re: Video effects and LC_NUMERIC

Sun Dec 19, 2010 2:31 pm
To avoid such problems in mainwindow.cpp we do the following:

setlocale(LC_NUMERIC, "POSIX");

Not sure why it does not work in your case.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]