-
Notifications
You must be signed in to change notification settings - Fork 25
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
Cannot access file path on MacOS #61
Comments
Does the Some helpful commands: # List devices provided using AVFoundation in MacOS
ffmpeg -f avfoundation -list_devices true -i ""
# And then try to capture some video
ffmpeg -f avfoundation -i "0:" output.mp4 |
Hi thank you for your feedback, I have tried the suggested commands, and it does list the webcam under the video devices However, when I try to run the capture video command I get the following error It does request access to the camera though and I allow it. I have then set the framerate in the command and it worked like below When I tried to do the same in code in FFmpegCameraSource.cs it did not work Can you advise further? |
Hmm, can you enable the FFmpeg logger on Some helpful code: // Use Microsoft.Extensions.Logging package
ILoggerFactory logfactory = LoggerFactory.Create(config => {
// Use Microsoft.Extensions.Logging.Console package
config.AddSimpleConsole().SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
});
// Initialise FFmpeg librairies
FFmpegInit.Initialise(
logLevel: FfmpegLogLevelEnum.AV_LOG_TRACE,
appLogger: logfactory.CreateLogger("FFMPEG Log")); |
Thank you for the suggestions, I have done so and this is how the log looks just after crashing once it hits It only seems to be with a camera source though, screen and file do not have this issue. |
Okay, it seems because of the default behavior of FFMPEG, seems it fails to get the correct supported mode. If you can find a way to retrieve the "Supported Modes" of the device and then use the first one as the option "framerate", then it should be able to open the decoder context. I don't have a MacOS ready, I can't test the suggested solution. |
Also to you give authorization to your app to have access to video devices ? |
Hi, a great library for use within MacOS and WebRTC.
I am trying to run the example project FFmpegFileAndDevicesTest.
It works fine when pointing to the external video source file, however, when I switch the source to use my Mac camera, it cannot get the path. It does get the list of cameras and selects the correct one with the correct name, but the path is returned as "0:"
Is there a way to resolve this?
I have installed all the relevant FFMPEG libraries and dependencies on my Mac, via homebrew.
After which the application crashes when trying hitting the InitialiseDecoder() method in the FFmpegCameraSource class, specifically on the
if (ffmpeg.avformat_open_input(&pFormatContext, _sourceUrl, _inputFormat, &options) < 0) in the FFmpegVideoDecoder class.
The text was updated successfully, but these errors were encountered: