Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: undefined reference while building FFmpeg with libvmaf #569

Closed
hemrajchauhan opened this issue May 11, 2020 · 6 comments
Closed

Error: undefined reference while building FFmpeg with libvmaf #569

hemrajchauhan opened this issue May 11, 2020 · 6 comments

Comments

@hemrajchauhan
Copy link

config.log

I tried to build ffmpeg with libvmaf and i get this errors:

C:/msys64/mingw64/lib/libvmaf.a(svm.cpp.o):svm.cpp:(.rdata$_ZTV6Kernel[_ZTV6Kernel]+0x10): undefined reference to __cxa_pure_virtual' C:/msys64/mingw64/lib/libvmaf.a(svm.cpp.o):svm.cpp:(.rdata$_ZTV6Kernel[_ZTV6Kernel]+0x18): undefined reference to __cxa_pure_virtual'
collect2.exe: error: ld returned 1 exit status
ERROR: libvmaf >= 1.3.9 not found using pkg-config

Please see the full attached log for details.

Kindly help to configure FFmpeg correctly for libvmaf.

@1480c1
Copy link
Contributor

1480c1 commented May 11, 2020

You need to link it with -lstdc++. You can try adding it to your CFLAGS while compiling FFmpeg or add it to your pkg-config file

@hemrajchauhan
Copy link
Author

Thank you very much for the help and prompt response.

I configured ffmpeg using
$ ../configure --enable-shared --disable-static --enable-libvmaf --enable-version3 --extra-libs="-lstdc++" --prefix="/build/ffmpeg"

and it worked.

@hemrajchauhan
Copy link
Author

After compiling FFmpeg with libvmaf, when i try to run following command using ffmpeg:
ffmpeg.exe -i output.mp4 -i input.mp4 -lavfi libvmaf -f null -

I get this error: No such filter: 'libvmaf'. Error initializing complex filters.

It seems that ffmpeg is not compiled with libvmaf even though configuring it with that.
Please help if there is anything else which needs to be done besides mentioning --enable-libvmaf --enable-version3 during configuration step.

ffmpeg version N-97727-g7a92147f87 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8.3.0 (Rev2, Built by MSYS2 project)
configuration: --prefix=/build --extra-cflags='-std=c++11' --extra-libs=-lstdc++ --enable-libvmaf --enable-version3
libavutil 56. 44.100 / 56. 44.100
libavcodec 58. 83.100 / 58. 83.100
libavformat 58. 43.100 / 58. 43.100
libavdevice 58. 9.103 / 58. 9.103
libavfilter 7. 80.100 / 7. 80.100
libswscale 5. 6.101 / 5. 6.101
libswresample 3. 6.100 / 3. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
Metadata:
major_brand : mp42
minor_version : 512
compatible_brands: isomiso2mp41
creation_time : 2020-05-13T12:50:06.000000Z
encoder : HandBrake 20191111091450-163ecac-master 2019111101
Duration: 00:00:37.31, start: 0.000000, bitrate: 3668 kb/s
Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 3663 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc (default)
Metadata:
creation_time : 2020-05-13T12:50:06.000000Z
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 2 kb/s (default)
Metadata:
creation_time : 2020-05-13T12:50:06.000000Z
handler_name : Stereo
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
creation_time : 2019-11-19T16:35:35.000000Z
Duration: 00:00:37.33, start: 0.000000, bitrate: 18672 kb/s
Stream #1:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 18375 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
Metadata:
creation_time : 2019-11-19T16:35:35.000000Z
handler_name : ?Mainconcept Video Media Handler
encoder : AVC Coding
Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
Metadata:
creation_time : 2019-11-19T16:35:35.000000Z
handler_name : #Mainconcept MP4 Sound Media Handler
[AVFilterGraph @ 0000000002696340] No such filter: 'libvmaf'
Error initializing complex filters.
Invalid argument

@hemrajchauhan hemrajchauhan reopened this May 13, 2020
@HolyWu
Copy link
Contributor

HolyWu commented May 13, 2020

You need --enable-pthreads --disable-w32threads while configuring FFmpeg because of this since you are using MSYS2 on Windows and hence FFmpeg will select w32threads rather than pthreads.

@li-zhi
Copy link
Collaborator

li-zhi commented May 13, 2020

@HolyWu is it worth adding this instruction to a doc, for example, this page below?
https://github.com/Netflix/vmaf/blob/master/resource/doc/ffmpeg.md

@hemrajchauhan
Copy link
Author

Thanks @HolyWu it worked. It would be nice if you add this information in the doc because i am sure it will save time for other people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants