fifonik / FFMetrics

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

Move tmp to subfolder of FFMetrics #75

Closed tvbrogreat closed 2 years ago

tvbrogreat commented 2 years ago

Thanks for a very useful tool!

The %tmp% is fine for english language windows.

In other encodings, the full path for %tmp% becomes eg in french C:\Users\hôtel\AppData\Local\Temp and because of the circumflex accent ˆ on the username hôtel, ffmpeg fails with error.

Would it be possible to move the temp folder of FFMetrics to FFMetrics/tmp so that it works on all system languages?

Again many thanks for the effort on this software.

fifonik commented 2 years ago

Oh. Thanks fot the suggestion. I will think about how to deal with the issue.

fifonik commented 2 years ago

I think, to allow users to deal with the issue, I will introduce a new command line parameter "-temp-dir=C:\Path\To\Temp"

tvbrogreat commented 2 years ago

Thanks for the fast reply!

Your suggestion is spot-on although it requires extra steps.

I am sorry I was not clear on my original description.

I was testing various files and in some there was failure by ffmpeg. I tried to check the logs so in FFMetrics.log the last line was: 2022-03-07 11:57:35 ffmpeg.exe -hide_banner -nostdin -i C:/FFMetrics/compare.mp4 -i C:/FFMetrics/reference.mp4 -lavfi [0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf='eof_action=endall:n_threads=0:phone_model=0:pool=mean:model_path=C\:/FFMetrics/vmaf-models/vmaf_v0.6.1.json:log_fmt=json:log_path=C\:/Users/hôtel/AppData/Local/Temp/FFMetrics/315e8934-871f-460e-9004-4bdd29c73f52.log' -f null -

Because of the problem mentioned with %tmp%, the file C\:/Users/hôtel/AppData/Local/Temp/FFMetrics/315e8934-871f-460e-9004-4bdd29c73f52.log was not created so I couldn't check what went wrong.

I think I have seen this problem mentioned on other issues here so to avoid more issues about it, perhaps the ffmpeg log path should be set by the code automatically to a subfolder tmp of the FFMetrics next to the vmaf-models subfolder or to C:\temp for a more general solution.

Thanks for taking the time to look into it.

fifonik commented 2 years ago

Sorry for late reply.

I do not like the idea to save temporary files near executable (even in sub-folder). Some system might not have write permissions there.

Ability to specify temp folder using command line option should help in most cases as one who faced the issue will be able to create and use simple CMD/BAT wrapper such as: ffmetrics.exe -temp-dir=C:\Path\To\Temp %*

fifonik commented 2 years ago

I've just published version 1.1.0beta where the temp dir can be specified as command line parameter (as mentioned above).

fifonik commented 2 years ago

I've just published version 1.2.1 beta 1 where you can specify temp dir in FFMetrics.conf (see FFMetrics.conf.example). By doing this you do not need to have the bat-wrapper.