Twinklebear / fbed

Python FFmpeg Batch Encoding Dashboard
MIT License
125 stars 14 forks source link

decouple from urwid? #2

Closed ajeema closed 3 years ago

ajeema commented 3 years ago

This is a great script and it's very useful. However, I would like to accomplish the same thing but without a terminal display. I've tried to decouple it from urwid but I cant seem to get it to work. Do you have this script uncoupled from urwid? I was hoping to decoupe it and add argparse

Twinklebear commented 3 years ago

Thanks! I think it should be possible to decouple from urwid, but I don't have a decoupled version of it. I think to make a non-urwid version you can just take out all the use of urwid in the code, and just make sure to call man.monitor_encoding in a loop: https://github.com/Twinklebear/fbed/blob/main/fbed.py#L252. This is done by calling it every 0.5s using urwid's loop/alarm stuff, but just calling it a loop and sleeping for 0.5s should work fine as well.

ajeema commented 3 years ago

Awesome, that k you so much for your reply. I will give it a go! Cheers

ajeema commented 3 years ago

I'm relatively new to Python. Do you mean a for loop or an event loop?

Twinklebear commented 3 years ago

I think you could just do a for loop, with a sleep in it

ajeema commented 3 years ago

I've been trying and trying. First tried an asyncio loop, then a for loop. I keep getting recursion errors. Any direction you may give, when you have time, would be very. much appreciated.

Twinklebear commented 3 years ago

No worries! I took a look at hacking up a version without urwid that just logs the encoding status to the terminal, check it out here: https://github.com/Twinklebear/fbed/blob/no-ui/fbed.py .

ajeema commented 3 years ago

oh man, that is so awesome! I really appreciate you taking time out to help me! I'll take a look. Again, thank you so much!

Twinklebear commented 3 years ago

No problem! Let me know if you have some questions, but I'll go ahead and close this issue