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

[BUG] : ffmpeg issue on MacOS #589

Closed
lordelan opened this issue Sep 21, 2021 · 23 comments
Closed

[BUG] : ffmpeg issue on MacOS #589

lordelan opened this issue Sep 21, 2021 · 23 comments
Labels
bug Something isn't working

Comments

@lordelan
Copy link

It shows a warning that "No FFmpeg found at path" and this error when downloading a song:

com.github.kokorin.jaffree.JaffreeException: Failed to start process. at com.github.kokorin.jaffree.process.ProcessHandler.execute(ProcessHandler.java:148) at com.github.kokorin.jaffree.ffmpeg.FFmpeg.execute(FFmpeg.java:400) at com.shabinder.common.core_components.media_converter.DesktopMediaConverter$convertAudioFile$2.invokeSuspend(DesktopMediaConverter.kt:34) at com.shabinder.common.core_components.media_converter.DesktopMediaConverter$convertAudioFile$2.invoke(DesktopMediaConverter.kt) at com.shabinder.common.core_components.media_converter.DesktopMediaConverter$convertAudioFile$2.invoke(DesktopMediaConverter.kt) at com.shabinder.common.core_components.parallel_executor.ParallelExecutor$Operation.execute(ParallelExecutor.kt:170) at com.shabinder.common.core_components.parallel_executor.ParallelExecutor$launchProcessor$1.invokeSuspend(ParallelExecutor.kt:113) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.selects.SelectBuilderImpl.resumeWith(Select.kt:304) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) Caused by: java.io.IOException: Cannot run program "ffmpeg": error=2, No such file or directory at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071) at com.github.kokorin.jaffree.process.ProcessHandler.execute(ProcessHandler.java:141) ... 14 more Caused by: java.io.IOException: error=2, No such file or directory at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:319) at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:250) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)

@lordelan lordelan added the bug Something isn't working label Sep 21, 2021
@lordelan
Copy link
Author

Installed ffmpeg with brew but still no luck.

@Shabinder
Copy link
Owner

can u simple run ffmpeg in console ?

share screenshot after executing ffmpeg in Terminal

@lordelan
Copy link
Author

Screenshot 2021-09-22 at 10 44 53

@lordelan
Copy link
Author

Yes I can :) (iTerm2)

@Shabinder
Copy link
Owner

Shabinder commented Sep 22, 2021

Before I upstream the issue to Jaffree Library can you check once again after closing the program(refreshes Path if FFmpeg was added later) and restarting your pc

@lordelan
Copy link
Author

Did with no success unfortunately.

@Shabinder
Copy link
Owner

Ohk then, seems an Issue with Jaffree, will upstream the issue there

@Shabinder
Copy link
Owner

Here it is, kokorin/Jaffree#223

@lordelan
Copy link
Author

Thanks a lot!

@kokorin
Copy link

kokorin commented Sep 23, 2021

@lordelan @Shabinder
An exception clearly says: "No such file or directory".
It's hard to add anything else having only exception. Are there any logs available?

Usually it happens if ffmpeg was installed after JVM started or if JVM was started from a console which in it's turn was launched before ffmpeg installation. To be 100% sure I would suggest full reboot if possible.

@Shabinder
Copy link
Owner

@kokorin

An exception clearly says: "No such file or directory".

this happens bcuz it tries to reference a file named ffmpeg in his path whereas actually, one doesn't exist.
But if that is the case how is he able to run ffmpeg ? 🤔

Usually it happens if ffmpeg was installed after JVM started or if JVM was started from a console which in it's turn was launched before ffmpeg installation. To be 100% sure I would suggest full reboot if possible.

I thought so too and suggested same, but @lordelan says issues persisted

@Shabinder
Copy link
Owner

Shabinder commented Sep 23, 2021

@lordelan

can you share the path of ffmpeg , call which ffmpeg
It will return Path to FFmpeg if it actually is in PATH, if returns nothing then call locate ffmpeg and add its output to Mac's PATH and restart App to see if it works

@lordelan
Copy link
Author

@Shabinder
which ffmpeg throws me the correct (and expected) path
/usr/local/bin/ffmpeg

@Shabinder
Copy link
Owner

which ffmpeg throws me the correct (and expected) path
/usr/local/bin/ffmpeg

@kokorin
if above is the case do you know if there could be any reason why Jaffree would throw File Not Found Exception for ffmpeg?

@kokorin
Copy link

kokorin commented Sep 24, 2021

@Shabinder It could be so that the app runs under another user, or it could have another PATH var

@lordelan
Copy link
Author

lordelan commented Oct 5, 2021

Interestingly enough I had the same issue in Windows but I solved it by downloading the bin folder of ffmpeg and pointing a path environment variable to it.

@Shabinder
Copy link
Owner

Interestingly enough I had the same issue in Windows but I solved it by downloading the bin folder of ffmpeg and pointing a path environment variable to it.

Yup that's how one adds a path to ffmpeg, seems like some specific issue in your mac installation.

@lordelan
Copy link
Author

lordelan commented Oct 18, 2021

I updated my Mac to Big Sur, installed ffmpeg again, rebooted but it still won't work.
However, this might be a very individual bug on my end for which I don't know the cause since it's working on my Windows PC so I don't feel like this has to stay as an open issue here.

I'd like to thank u guys for your support though.

@1xKarthik
Copy link

the same issue on Mac M1, tried both installs of homebrew and manual static install of ffmpeg. The path is available and ffmpeg works in cmd, but the app is not able to detect it on both instances.
From the error message, its checking the ffmpeg in a folder, can you let us know which folder it is looking for?
image

com.github.kokorin.jaffree.JaffreeException: Failed to start process. at com.github.kokorin.jaffree.process.ProcessHandler.execute(ProcessHandler.java:148) at com.github.kokorin.jaffree.ffmpeg.FFmpeg.execute(FFmpeg.java:400) at com.shabinder.common.core_components.media_converter.DesktopMediaConverter$convertAudioFile$2.invokeSuspend(DesktopMediaConverter.kt:34) at com.shabinder.common.core_components.media_converter.DesktopMediaConverter$convertAudioFile$2.invoke(DesktopMediaConverter.kt) at com.shabinder.common.core_components.media_converter.DesktopMediaConverter$convertAudioFile$2.invoke(DesktopMediaConverter.kt) at com.shabinder.common.core_components.parallel_executor.ParallelExecutor$Operation.execute(ParallelExecutor.kt:172) at com.shabinder.common.core_components.parallel_executor.ParallelExecutor$launchProcessor$1.invokeSuspend(ParallelExecutor.kt:114) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.selects.SelectBuilderImpl.resumeWith(Select.kt:304) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) Caused by: java.io.IOException: Cannot run program "ffmpeg": error=2, No such file or directory at java.base/java.lang.ProcessBuilder.start(Unknown Source) at java.base/java.lang.ProcessBuilder.start(Unknown Source) at com.github.kokorin.jaffree.process.ProcessHandler.execute(ProcessHandler.java:141) ... 14 more Caused by: java.io.IOException: error=2, No such file or directory at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) at java.base/java.lang.ProcessImpl.<init>(Unknown Source) at java.base/java.lang.ProcessImpl.start(Unknown Source) ... 17 more

@kokorin
Copy link

kokorin commented Nov 9, 2021

@Shabinder there is new Jaffree version available, it logs some system information if failed to start ffmpeg/ffprobe process.
Please, update dependency and configure logging to log at least warning level of com.github.kokorin package.

@Shabinder
Copy link
Owner

@Shabinder there is new Jaffree version available, it logs some system information if failed to start ffmpeg/ffprobe process. Please, update dependency and configure logging to log at least warning level of com.github.kokorin package.

I am actually rewriting the whole app, so was looking to build that a release the updated version with that.

But if it gets delayed then will release a new hotfix in Spotiflyer itself

@henryteng07
Copy link

@1xKarthik did you find a solution?

@enricobachiorrini
Copy link

This solved the problem for me: #891 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants