slhck / ffmpeg-normalize

Audio Normalization for Python/ffmpeg
MIT License
1.25k stars 117 forks source link

Improving progress bar #131

Closed manus693 closed 4 years ago

manus693 commented 4 years ago

Is your feature request related to a problem? Please describe. It is a bit annoying that the progress bar leaves so many lines in CMD.

Describe the solution you'd like I would like the progress bar to be like in ffmpeg.

Describe alternatives you've considered Alternatively is of course to remove the -pr option, but I like to see the progress.

Additional context Add any other context or screenshots about the feature request here. screenshot

slhck commented 4 years ago

Thanks for including the picture. But please, instead of deleting the template, fill it out completely. I need to know your OS and Python version. And which terminal you are using. And the compete debug output from the ffmpeg normalize command.

manus693 commented 4 years ago

Maybe I have misunderstood, everything is working correctly, incredible work on the ffmpeg-normalize. Love it. This was just a request if possible to change the progress bar to a one-liner. Or isnt this how it shows for everyone else?

slhck commented 4 years ago

No, actually this is a bug, that's why I'm asking. It is supposed to stay on one line. If you can provide more info I can look into why that happens.

manus693 commented 4 years ago

Python 3.8.3 64bit Windows 1909 18363.900 ffmpeg version 4.3 64bit ffmpeg-normalize v1.19.0 Just installed the latest versions today of ffmpeg zeranoe and python. Here is my bat-file using standard CMD

setlocal EnableExtensions EnableDelayedExpansion @ECHO OFF chcp 65001 for %%a in ("*.avi") do if not exist "%%~na.wav" echo "%%~dpna.avi" && ffmpeg-normalize "%%~dpna.avi" -v -vn -pr -o "%%~dpna.wav" pause

Same results if i do just this:

for %%a in ("*.avi") do ffmpeg-normalize "%%~dpna.avi" -v -vn -pr -o "%%~dpna.wav"

Here is the result from 50 sec video: debug.txt screenshot

slhck commented 4 years ago

Thanks for that extra info. Seeing that this is Windows, I believe the issue could be related to what is written here: https://pypi.org/project/tqdm/#faq-and-known-issues

Windows: additionally may require the Python module colorama to ensure nested bars stay within their respective lines.

I’m not sure what that means for my code but I’ll investigate.

manus693 commented 4 years ago

Yes, youre correct, installing colorama fixed it, thanks a lot! Just ran pip3 install colorama in cmd.. :)

Probably everyone using windows without this knowledge has the same issue. Probably many dont ever see it as a problem, as they might not add the -pr ? Maybe somehow make it as a dependency? or inform about it in the readme?

Now it shows like this: screenshot

Everything is perfect now! GREAT!

manus693 commented 4 years ago

And thank you so much! i just sent you a coffee! :)

slhck commented 4 years ago

Thank you, that is much appreciated! I will try to provide a fix by automatically including colorama (although I don't think I can do that for Windows users only … but it's a minor dependency anyway).

manus693 commented 4 years ago

No problem, biggest thank is to you for your work with ffmpeg-normalize! :)

But just adding it to the readme, "For Windows user: install colorama for python" And maybe add a link to this site [(https://pypi.org/project/colorama/] and maybe: pip3 install colorama or pip install colorama And everything is ok, no? :)

manus693 commented 4 years ago

And also one thing, this warning was the reason I added progress bar, "WARNING: Output folder normalized is ignored for input file" Was thinking there was something wrong. This only appears when using -o as I understand, maybe remove it? Or change the text?

slhck commented 4 years ago

I fixed that too, thank you for bringing that to my attention!