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

OutputToPipe fails on macOS #365

Closed
GOATS2K opened this issue Oct 30, 2022 · 2 comments
Closed

OutputToPipe fails on macOS #365

GOATS2K opened this issue Oct 30, 2022 · 2 comments

Comments

@GOATS2K
Copy link

GOATS2K commented Oct 30, 2022

This operation fails on macOS.

await FFMpegArguments
            .FromFileInput(track.FilePath)
            .OutputToPipe(new StreamPipeSink(outputStream), options =>
            {
                options.WithAudioCodec(requestedCodec);
                options.WithArgument(new AudioBitrateArgument(bitrate));
            })
            .ProcessAsynchronously();
The path '/var/folders/n2/5qzqsyf97cq3tz608mpdqw2r0000gn/T/CoreFxPipe_FFMpegCore_1325ce6c-6e8e-497a-8c0a-c46703282209' is of an invalid length for use with domain sockets on this platform.  The length must be between 1 and 104 characters, inclusive. (Parameter 'path')

Actual value was /var/folders/n2/5qzqsyf97cq3tz608mpdqw2r0000gn/T/CoreFxPipe_FFMpegCore_1325ce6c-6e8e-497a-8c0a-c46703282209.

I see this is being addressed by #286, but the PR has been inactive for a while.

@ep1kt3t0s
Copy link
Contributor

I am hitting the same problem. This is a genuine problem on MacOS and related to the generated long socket pipe name.

@rosenbjerg updated the code with this commit below that removed short pipe name generation. Is there a reason of using this long pipe names? It's breaking the code.
3d50530

By default Path.GetTempPath() on MacOS returns a path like /var/folders/n2/5qzqsyf97cq3tz608mpdqw2r0000gn/T which is already long enough. If we also use a long pipe names, where the pipe name is appended to it by the System.IO.Pipes. Reference: https://github.com/dotnet/corefx/blob/master/src/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs#L67-L76

At the moment, the FFMpegCore is unusable for me on MacOS. There is a significant impact. Let's fix this.

@rosenbjerg
Copy link
Owner

PR by @ep1kt3t0s has been merged, so hopefully this will fix your issue.
I have included macos in the os test matrix

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

3 participants