cmxl / FFmpeg.NET

.NET wrapper for common ffmpeg tasks
MIT License
611 stars 99 forks source link

Running on Mac OS in Development #75

Open jh197033 opened 1 year ago

jh197033 commented 1 year ago

I see your instructions to add your NuGet package, done that and made reference to it, but then the rest of your instructions are using Windows directory links

ie... var ffmpeg = new Engine("C:\ffmpeg\ffmpeg.exe");

I am using VSCode to develop an ASPNET Core app on Mac OS, so where to I reference the .exe?

I see the FFmpeg.NET.dll in the /bin folder but how do I reference it?

Regards

James

jh197033 commented 1 year ago

EDIT: Also when I add

using FFmpeg.NET;

or

using xFFmpeg.NET;

or

using xFFmpeg;

I get build errors on "MediaFile"

var inputFile = new MediaFile ("test.mp4");

Cannot create an instance of the abstract type or interface 'MediaFile'

What am I doing wrong?

KANekT commented 11 months ago

example:

private static string GetPathToMpeg()
{
    if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
    {
        return Environment.GetEnvironmentVariable("IntraConfigPath", EnvironmentVariableTarget.Machine).ThrowIfNull();
    }

    if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
    {
        return "/usr/bin";
    }

    return "/usr/local/bin";
}