hozuki / MonoGame.Extended2

A collection of extensions for MonoGame
BSD 3-Clause Clear License
38 stars 8 forks source link

Unable to load a shared library ‘libavformat.so.59’ or one of it’s dependencies. #7

Open BrienKing opened 1 year ago

BrienKing commented 1 year ago

I've downloaded the code and compiled it. I then reference the two assemblies in the bin directory.

I'm running on Raspberry Pi. When I try to load the video file I get this error:

System.DllNotFoundException: Unable to load shared library 'libavformat.so.59' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibavformat.so.59: cannot open shared object file: No such file or directory
   at System.Runtime.InteropServices.NativeLibrary.LoadByName(String libraryName, QCallAssembly callingAssembly, Boolean hasDllImportSearchPathFlag, UInt32 dllImportSearchPathFlag, Boolean throwOnError)
   at System.Runtime.InteropServices.NativeLibrary.LoadLibraryByName(String libraryName, Assembly assembly, Nullable`1 searchPath, Boolean throwOnError)
   at System.Runtime.InteropServices.NativeLibrary.Load(String libraryName, Assembly assembly, Nullable`1 searchPath)
   at Sdcb.FFmpeg.Raw.ffmpeg.DllImportResolver(String libraryName, Assembly assembly, Nullable`1 searchPath)
   at System.Runtime.InteropServices.NativeLibrary.LoadLibraryCallbackStub(String libraryName, Assembly assembly, Boolean hasDllImportSearchPathFlags, UInt32 dllImportSearchPathFlags)
   at Sdcb.FFmpeg.Raw.ffmpeg.avformat_alloc_context()
   at MonoGame.Extended.VideoPlayback.DecodeContext..ctor(String url, DecodingOptions decodingOptions) in D:\Development\GitHub\MonoGame.Extended2-master\Sources\MonoGame.Extended.VideoPlayback\DecodeContext.cs:line 35
   at MonoGame.Extended.Framework.Media.Video..ctor(String url, DecodingOptions decodingOptions) in D:\Development\GitHub\MonoGame.Extended2-master\Sources\MonoGame.Extended.VideoPlayback\Media\Video.cs:line 24
   at MonoGame.Extended.VideoPlayback.VideoHelper.LoadFromUrl(String url, DecodingOptions decodingOptions) in D:\Development\GitHub\MonoGame.Extended2-master\Sources\MonoGame.Extended.VideoPlayback\VideoHelper.cs:line 53
   at MonoGame.Extended.VideoPlayback.VideoHelper.LoadFromFile(String path, DecodingOptions decodingOptions) in D:\Development\GitHub\MonoGame.Extended2-master\Sources\MonoGame.Extended.VideoPlayback\VideoHelper.cs:line 32
   at MonoGame.Extended.VideoPlayback.VideoHelper.LoadFromFile(String path) in D:\Development\GitHub\MonoGame.Extended2-master\Sources\MonoGame.Extended.VideoPlayback\VideoHelper.cs:line 19

On the pi I run the ffmpeg -version and get the following:

ffmpeg -version
ffmpeg version 4.3.6-0+deb11u1+rpt1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 10 (Raspbian 10.2.1-6+rpi1)
configuration: --prefix=/usr --extra-version=0+deb11u1+rpt1 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --libdir=/usr/lib/arm-linux-gnueabihf --cpu=arm1176jzf-s --arch=arm
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100

It says it can't find libavcodec.o.59, but if I'm reading that correctly shouldn't it be libavcodec.o.58?

autious commented 11 months ago

You have a version mismatch, the version on your raspberry i ffmpeg 4.3.6, but the library is looking for ffmpeg 5.1.x