radek-k / FFMediaToolkit

FFMediaToolkit is a cross-platform video decoder/encoder library for .NET that uses FFmpeg native libraries. It supports video frames extraction, reading stream metadata and creating videos from bitmaps in any format supported by FFmpeg.
MIT License
352 stars 56 forks source link

Unable to load DLL 'avutil.56' error #100

Closed srht closed 2 years ago

srht commented 2 years ago

I'm trying to use the library in asp.net web application that runs with .net framework 4.7.2. I set FFmpegLoader.FFmpegPath to the dll files that I downloaded win64 modes from https://github.com/BtbN/FFmpeg-Builds/releases My application is 64 bit. Then it gives Unable to load DLL 'avutil.56' error. How can I solve this?

NurulloSulaymonov commented 2 years ago

same with me

NurulloSulaymonov commented 2 years ago

@srht here is the solution https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/192#issuecomment-1018171060

Ruslan-B commented 2 years ago

@srht which release you downloaded? I guess for a while you have to stick to 4.4. As I updated foundation library for FFMediaToolkit just yesterday.

Norc89 commented 2 years ago

When this is planned to be fixed ?

radek-k commented 2 years ago

I've updated the package.

Norc89 commented 2 years ago

I've updated the package.

Fix is updated in 4.4 or 5.0 version ?

radek-k commented 2 years ago

5.0

Norc89 commented 2 years ago

5.0 I have try now in dotnet application which i run on windows and is working how it should. After i copy everything to RaspberrPi there i get again: "Unable to load DLL 'avutil.57 under /home/pi/DigitalSignageV2/ffmpeg/':" Should I use there any other dlls? or what approach should i use for RaspberryPi?

radek-k commented 2 years ago

Which FFmpeg build have you downloaded? Try installing FFmpeg using apt, then set the FFmpegPath to "/usr/local/lib/"

Norc89 commented 2 years ago

Which FFmpeg build have you downloaded? Try installing FFmpeg using apt, then set the FFmpegPath to "/usr/local/lib/"

Is possible that we continue this conversation in private chat?

Norc89 commented 2 years ago

Which FFmpeg build have you downloaded? Try installing FFmpeg using apt, then set the FFmpegPath to "/usr/local/lib/"

I have try both builds gpl-shared and lgpl-shared. I really need to get this working on raspberry. I don't even know if is possible to get running dlls on Raspi.

hey-red commented 2 years ago

I think you need ARM build for RPI. Do you download right version?

Ruslan-B commented 2 years ago

RPI linux distributive has to have package manager in any normal linux version (if assembled by hand I would expect OP knows what do) - what could possible go wrong?

tottaka commented 2 years ago

Has anyone gotten this to work? I'm having the same exact issue on the Raspberry PI 4 (Debian Bullseye). I installed ffmpeg from apt (ffmpeg is already the newest version (7:4.3.4-0+deb11u1+rpt1))

I ran ldd /usr/bin/ffmpeg which told me the .so files were located in "/lib/aarch64-linux-gnu/" so I tried that first, same error.

I then tried setting ffmpeg path "/usr/local/lib/" and still got the error. I couldn't find the "Prefer 32-bit" option in VS2022 so I tried building for ARM64 which still gave me the same error.

Running command file `which ffmpeg` gives me: /usr/bin/ffmpeg: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=1e9e84ad62abcf8f99020bdcbf9b7d5a79e529a4, for GNU/Linux 3.7.0, stripped

Running ldd /usr/bin/ffmpeg | grep "avutil" outputs: libavutil.so.56 => /lib/aarch64-linux-gnu/libavutil.so.56 (0x0000007f9289f000)

So maybe that's where the problem occurs? Is there a way to get version .57 instead of .56?

hey-red commented 2 years ago

@tottaka Your installed ffmpeg version is 4.3.4, but latest FFMediaToolkit works only with 5.x.x Possible solutions:

tottaka commented 2 years ago

@hey-red I got it working by building ffmpeg 5.0 from source. I did have to include build option --enable-shared otherwise the .so files were not generated. Also I think running ldconfig made links to the libs in "/usr/local/lib" so I was able to set FFmpegLoader.FFmpegPath to that instead of the full path to ffmpeg.

It's a shame the default apt repository is using an outdated ffmpeg version...

Thank you!