fifonik / FFMetrics

Visualizes Video Quality Metrics (PSNR, SSIM & VMAF) calculated by ffmpeg.exe
562 stars 22 forks source link

Failing to find ffmpeg #122

Open thirteenwings opened 11 months ago

thirteenwings commented 11 months ago

On Windows 10. Ffmpeg version 6.0 stable. Tried using 1.3.1 -- after the initial scan no ffmpeg version is shown. Program still tries to scan media files, no metadata shows. Buttons are inactive. Tried using 1,4.8 beta, it's spent 5 mins on getting ffmpeg version and is still going. In a command prompt, ffmpeg -version shows: ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project)

fifonik commented 11 months ago

Could you follow troubleshooting steps please?

thirteenwings commented 11 months ago

CrashDumps.zip

Program crashes when I start with -log-level=debug. First 2 dumps are 1.4.8, last 2 are 1.3.1.

fifonik commented 11 months ago

As I see, the program does not have permissions to write FFMetrics.log that should be aside of executable. Could you move the whole FFMetrics folder to a location with read/write permissions please?

thirteenwings commented 11 months ago

Okay, so here's what I've tried:

  1. Moved FFMetrics to a different folder with r/w permissions. This fixed the crashing and I got a logfile. However, the logfile said: 2023-09-07 22:52:18 DEBUG: Started 2023-09-07 22:52:18 DEBUG: Initialize finished 2023-09-07 22:52:18 DEBUG: .NET version detected: 480 2023-09-07 22:52:18 DEBUG: InitializeProgramConfig started 2023-09-07 22:52:18 DEBUG: InitializeProgramConfig finished 2023-09-07 22:52:18 DEBUG: InitializeWorkers started 2023-09-07 22:52:18 DEBUG: InitializeWorkers finished 2023-09-07 22:52:18 DEBUG: InitializeCommands started 2023-09-07 22:52:18 DEBUG: InitializeCommands finished 2023-09-07 22:52:18 DEBUG: FF.VersionInfoGet.Started 2023-09-07 22:52:18 ffmpeg.exe -nostdin -filters 2023-09-07 22:52:18 DEBUG: FF.ExecStatus.Started, -nostdin -filters 2023-09-07 22:52:28 DEBUG: FF.ExecStatus.Finished. stdout: , stderr: The system cannot find the file specified(-1) 2023-09-07 22:52:28 DEBUG: FF.VersionInfoGet.Finished: OK 2023-09-07 22:53:48 DEBUG: Finished

  2. I also tried moving the ffmpeg folder. Same result.

  3. When I run "ffmpeg -nostdin -filters" in a command prompt, I get an output as in attachment ffmpeg-output.txt

FFMetrics is still failing to load the ffmpeg version, the tooltip says "The system cannot find the file specified" FFMetrics.log ffmpeg-output.txt

fifonik commented 11 months ago

"The system cannot find the file specified" means exactly what it says. FFMetrics is trying to execute ffmpeg.exe without providing any path. This must work if ffmpeg.exe (and accompanied dlls if you use shared build) is located in program directory (aside of ffmetrics.exe) or in system %path%.

So:

  1. What type of ffmpeg you use -- shared (exe + dlls) or static (single exe)?
  2. Where ffmpeg.exe located -- directly in ...\FFMetrics\ dir aside of ffmetrics.exe or somewhere else?
  3. If it is located not in ...\FFMetrics\ dir, then does the ffmpeg's dir is in the %PATH%? Have you double checked it?
  4. When you moved ffmpeg folder as you mentioned, have you adjusted system %PATH%?

For simplicity I'd recommend to download static ffmpeg build and put it inside ...\FFMetrics\ dir, just aside of ffmetrics.exe

thirteenwings commented 11 months ago

Hi. I just woke up and had a thought while having coffee. I tried running it with admin privileges, and it's working now. I'm not sure if that's in the instructions somewhere and I missed it, but it's here now in case anyone else runs into the same issue.

fifonik commented 11 months ago

Hm. Everything should work without admin privileges and it works in my case.

tormento commented 1 month ago

I have almost the same problem.

On some runs, it fails to recognize ffmpeg capabilities. Thus start is disabled.

Until now I simply launched it once, closed it and launched a second time but someone else is having a similar problem so I decided to finally report.

fifonik commented 1 month ago

The same question: have you followed troubleshooting steps?

Have you tried to follow this?

tormento commented 1 month ago

Have you tried to follow this?

I can't complete the analyze step as FFMetrics can't find ffmpeg capabilities.

As I told you, starting the program twice in a row fixes the issue.

If I run after some time, the issue presents again.

  1. Tried both static and dynamic, both stable and nightly, both BtbN and GyanD.
  2. FFMpeg is in FFMetrics directory

Log:

2024-06-29 12:55:49 DEBUG: Started
2024-06-29 12:55:49 DEBUG: Initialize finished
2024-06-29 12:55:49 DEBUG: .NET version detected: 480
2024-06-29 12:55:49 DEBUG: InitializeProgramConfig started
2024-06-29 12:55:49 DEBUG: InitializeProgramConfig finished
2024-06-29 12:55:49 DEBUG: InitializeWorkers started
2024-06-29 12:55:49 DEBUG: InitializeWorkers finished
2024-06-29 12:55:49 DEBUG: InitializeCommands started
2024-06-29 12:55:49 DEBUG: InitializeCommands finished
2024-06-29 12:55:50 DEBUG: FF.VersionInfoGet.Started
2024-06-29 12:55:50 ffmpeg -nostdin -filters
2024-06-29 12:55:50 DEBUG: FF.ExecStatus.Started, -nostdin -filters
2024-06-29 12:55:55 DEBUG: FF.ExecStatus: External program not exited, trying to close it
2024-06-29 12:55:55 DEBUG: FF.ExecStatus: External program closing failed. Killing it
2024-06-29 12:56:03 DEBUG: FF.ExecStatus.Finished. stdout: , stderr: Timed out(-2)
2024-06-29 12:56:03 DEBUG: FF.VersionInfoGet.Finished: OK
2024-06-29 12:56:37 DEBUG: Finished
fifonik commented 1 month ago

I was referring to option --debug and providing log. As I see from the log, "ffmpeg -nostdin -filters" not finished in 5 seconds, so timed out.

Some things to consider/investigate:

I do not have any other ideas now, unfortunately.

If you try above steps and they not help, I can try to create ffmetrics.exe that use slightly different way to run ffmpeg.exe for testing.

zjDrummond commented 1 month ago

I've had similar problems off and on for months. I have been using the 1.4.9b app, and sometimes the VMAF checkbox is unselectable. Other times FFMpeg isn't found by the app, and I have had to reinstall FFMpeg for it to pick it up at next launch of FFmetrics.

fifonik commented 1 month ago

You should not reinstall ffmpeg for that. Have you tried to follow suggestions I posted in this thread?

tormento commented 1 month ago

@fifonik too much people is having the very same problem.

If we can help to debug, ask.

It appears every single time that I launch it, after some time I didn't.

At the second launch, it works perfectly.

I have other programs using ffmpeg and ffprobe and none have the same behaviour.

fifonik commented 1 month ago

Just add a timeout as I mentioned. If this fix the issue, I can change in-build timeout.

I have other programs using ffmpeg and ffprobe and none have the same behaviour.

I cannot discuss unknown programs with unknown behaviour, sorry. If I remove feature checks at the program startup it will be no such issues at all during startup and during metrics calculating (timeout is much bigger for that operation). However, some issues may appear when user click 'Run' button such as: no selected model, ffmpeg not found, etc. So I decided to do all checks on startup.

fifonik commented 1 month ago

too much people is having the very same problem.

Are you sure that the issue is the same? I have not seen any technical details provided for the last case and my crystal ball is broken at this moment.