lucat/leqm-nrt

gcc compile issue

Opened this issue · 7 comments

Hi @lucat.

First, thanks a lot for this tool.

Trying to build it on Linux Mint 19, we had the same compile error described in issue #2, and discovered why.

On this OS, gcc uses by default the --as-needed flag. With this flag, main program must be put before link dependencies on the command line. Otherwise, linked dependencies are dropped.

So, gcc -lsndfile -lm -lpthread leqm-nrt.c fails, but gcc leqm-nrt.c -lsndfile -lm -lpthread works.

This can be fixed for all platforms, enforcing gcc --no-as-needed flag in src/Makefile.in:

leqm_nrt_LDFLAGS = -Wl,--no-as-needed -lsndfile -lm -lpthread

Note: this line was generated automatically using a more recent version of automake tools (1.15.1) on Linux Mint 19 (aclocal + automake).

If you are interrested, I can provide a PR.

Best regards,

lucat commented

Dear Bênoit,

thank you for your interest and suggestion. I already changed this in the following commit almost an year ago before closing issue #2. See here d1dbc96
So I do not really understand why you experienced the problem if this is the solution. You can also see the Makefile.in yourself. Do you see?

By the way there since some time another branch linking against ffmpeg. This enables you to read many more formats including mxf directly. Maybe you are interested in testing this.

Bests regards,

Luca

lucat commented

Excuse-moi pour le glissement d'accent circumflex en avant sur ton nom: Benoît!

Dear Luca,

I cloned the repository again, and cannot reproduce the compile issue. I don't know how I got this error in the first place.

Thanks for the pointer to the ffmpeg branch. I am very interested (I called ffmpeg manually to convert mxf before using leqm-nrt). By the way, it would be even greater to have leqm-nrt bundled directly as a ffmpeg filter (like the ebur128 filter https://ffmpeg.org/ffmpeg-filters.html#ebur128-1 for audio loudness mesure in LUFS).

But I don't know if it is technically easy.

lucat commented

Dear Benoît,

I think there are some unnecessary files lying around that could have caused the issue. I have to clean the repository a bit. But I do not know exactly.

As for the integration into ffmpeg as a filter, it should be feasible may be even simple, but possibly difficult to get the patch accepted. At present I am devoting spare time I have to some experimental code adding other measurement and or gating (level, dialogue). So any attempt by me to integrate into ffmpeg will not happen soon. Before that I even wanted to write a cuda version.

Bests Regards,

Luca

Dear Luca,

I would like to help figure out how we got the bug, but my C skills are very basic.
It could come from a first configure command without alocal/autotools installed, which overrided some files...

Since I don't know C/Cuda, I can't help you, but if I find time, I will port your leqm mesurement code to Rust (one of our dev languages).

Best regards,
Benoît

Second ffmpeg integration, this as a filter in ffmpeg would be fantastic, pretty much everyone using this tool is also using ffmpeg I would imagine. So would help a lot if whatever they are doing..

lucat commented

Hi James,

one could take the ebur128 ffmpeg filter as a template. Basically leq(M) is a much less sofisticated algorithm.
The first thing that one would need to do is to find a polynomial filter of least order that best approximates the M weighting. This is needed to get rid of the computationally expensive convolution calculation that leqm-nrt uses at present. So time permitting I will try that first, adding it as a command line switch option, before even trying to propose a filter for ffmpeg, for which much more study on my part would be needed. And who knows maybe someone else will then catch up from there.

Best Regards,

Luca