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

System.NotSupportedException: Specified method is not supported (MacOS) #89

Open
FinHorsley opened this issue Dec 5, 2024 · 13 comments

Comments

@FinHorsley
Copy link

Hi there,

Sorry in advance if i've missed something obvious, but i've been through the existing issues for this and i'm still hitting the NotSupportedException

Environment
Macos - 15.0.1 (24A348)
M1

I've downloaded ffmpeg from brew

brew install ffmpeg@6 (think i need to use v6, rather than latest, see #70 (comment)). I've also tried with v4 and latest

that installs it to

/opt/homebrew/opt/ffmpeg@6/bin

$ /opt/homebrew/opt/ffmpeg@6/bin/ffmpeg -version
ffmpeg version 6.1.2 Copyright (c) 2000-2024 the FFmpeg developers

i've then set this in the Initialise

FFmpegInit.Initialise(FfmpegLogLevelEnum.AV_LOG_TRACE, libPath: "/opt/homebrew/opt/ffmpeg@6/bin", logger);

and have also tried lib

FFmpegInit.Initialise(FfmpegLogLevelEnum.AV_LOG_TRACE, libPath: "/opt/homebrew/opt/ffmpeg@6/lib", logger);

either way i get the exception

FFmpeg binaries path set to: /opt/homebrew/opt/ffmpeg@6/lib 👈 including for clarity is either /lib or /bin
Unhandled exception. System.NotSupportedException: Specified method is not supported.
   at FFmpeg.AutoGen.DynamicallyLoadedBindings.<>c.<Initialize>b__2_1227()
   at FFmpeg.AutoGen.DynamicallyLoadedBindings.<>c.<Initialize>b__2_516()
   at FFmpeg.AutoGen.ffmpeg.avdevice_register_all()
   at SIPSorceryMedia.FFmpeg.FFmpegInit.SetFFmpegBinariesPath(String path)
   at SIPSorceryMedia.FFmpeg.FFmpegInit.RegisterFFmpegBinaries(String libPath)
   at SIPSorceryMedia.FFmpeg.FFmpegInit.Initialise(Nullable`1 logLevel, String libPath, ILogger appLogger)
   at Program.<Main>$(String[] args) in /REDACTED
   at Program.<Main>(String[] args)
@FinHorsley
Copy link
Author

quite new to ffmpeg, not sure if this is useful
image

@ha-ves
Copy link
Contributor

ha-ves commented Dec 6, 2024

Does it work if its version 6.1.1?

@FinHorsley
Copy link
Author

FinHorsley commented Dec 6, 2024

doesn't look like it, still getting the same error

ffmpeg -version
ffmpeg version 6.1.1-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2023 the FFmpeg developers

for anyone else, downloaded 6.1.1 using https://gist.github.com/isimaka/0a43cbec585a019d3c4550068a288475

side note it looks like -enable-sharing is missing from ffmpeg -buildconf

@ha-ves
Copy link
Contributor

ha-ves commented Dec 6, 2024

static builds don't expose the shared libraries.

Homebrew specifies the shared libraries here:

    # Build and install additional FFmpeg tools
    system "make", "alltools"
    bin.install (buildpath/"tools").children.select { |f| f.file? && f.executable? }
    (share/"ffmpeg").install buildpath/"tools/python"

via ChatGPT:

(share/"ffmpeg").install buildpath/"tools/python":

Copies the python directory from the tools directory of the build path to the share/ffmpeg directory in the Homebrew installation prefix.

Where is the share folder?

The share folder is located inside Homebrew's installation prefix, typically under /usr/local/share on macOS (for Intel Macs) or /opt/homebrew/share on Apple Silicon Macs.

To find its exact location:
Run brew --prefix to get the Homebrew prefix path.

Combine it with share/ffmpeg. For example:
Intel: /usr/local/share/ffmpeg
Apple Silicon: /opt/homebrew/share/ffmpeg

You can try passing the method parameter with those paths.

@sipsorcery
Copy link
Member

The latest nuget package requires FFmpeg version 7.

See the Windows instuctions for the version.

@FinHorsley
Copy link
Author

Thanks for the reply (apologies for my slow reply!). I ended up downgrading to an older ffmpeg version and initialised with FFmpegInit.Initialise(FfmpegLogLevelEnum.AV_LOG_TRACE, libPath: "/opt/homebrew/Cellar/ffmpeg@4/4.4.5_3/lib", logger); which seemed to work well enough to get started. I'll have a play with bumping now i've got it working 🙂

@kevinmershon
Copy link

Getting this same problem on Win11 build 26100 with ffmpeg shared 7.0 installed exactly per the installation instructions and then also manually added to the system path.

@sipsorcery
Copy link
Member

That's weird. I'm on exactly the same Windows version and have been using the FFmpeg package constantly for the last few weeks.

> ffmpeg version
ffmpeg version 7.0-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developer

Is there a chance you have another ffmpeg version installed?

where ffmpeg

@kevinmershon
Copy link

 ffmpeg version
ffmpeg version 7.0-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 13.2.0 (Rev5, Built by MSYS2 project)

And unless I manually put it on the path, where ffmpeg returns empty

@sipsorcery
Copy link
Member

If you do dotnet run on this WebRTC MP4 demo do you get that exception?

@kevinmershon
Copy link

If you do dotnet run on this WebRTC MP4 demo do you get that exception?

I cloned the repo and ran dotnet run on that project but it is non-obvious how to test it to get to a point where the video track would be encoding. Opening port 8081 in a browser didn't load anything.

@kevinmershon
Copy link

I was able to get this output trying to run the receiver

Image

@sipsorcery
Copy link
Member

sipsorcery commented Feb 27, 2025

On my machine:

WebRTC Receive Demo
[22:15:10 INF] FFmpeg binaries found in system path at: C:\Users\AaronClauson\AppData\Local\Microsoft\WinGet\Packages\Gyan.FFmpeg.Shared_Microsoft.Winget.Source_8wekyb3d8bbwe\ffmpeg-7.0-full_build-shared\bin
[22:15:10 INF] FFmpeg version info: 7.0-full_build-www.gyan.dev
Starting web socket server...
Waiting for web socket connections on ws://0.0.0.0:8081...
[22:16:09 DBG] Web socket client connection from 127.0.0.1:53987.
[22:16:10 DBG] No DTLS certificate is provided in the configuration
[22:16:10 DBG] RTCPeerConnection created with DTLS certificate with fingerprint sha-256 A8:A7:80:FD:ED:73:23:03:D9:EC:42:4A:87:48:09:E8:B5:C6:82:30:09:CD:34:1B:3F:F7:47:4E:76:19:1C:E9 and signature algorithm SHA256withECDSA.
[22:16:10 DBG] CreateRtpSocket attempting to create and bind RTP socket(s) on [::]:0.
[22:16:10 DBG] CreateBoundSocket attempting to create and bind socket(s) on [::]:0 using protocol Udp.
[22:16:10 DBG] CreateBoundSocket even port required, closing socket on [::]:63395 and retrying on 63396.
[22:16:10 DBG] Successfully bound RTP socket [::]:63396 (dual mode True).
[22:16:10 DBG] RTPChannel for [::]:63396 started.
[22:16:10 DBG] SCTP windows size for data receiver set at 218.
[22:16:10 DBG] SCTP creating DTLS based association, is DTLS client False, ID 5000:5000:63396.
[22:16:10 DBG] RTP ICE Channel discovered 2 local candidates.

Maybe there's an incorrect version of the FFmpeg.AutoGen nuget package somewhere but I'm only guessing. .NET and native libraries never work that well together. These types of issues have always been a plague.

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