vvo / gifify

😻 Convert any video file to an optimized animated GIF.
ISC License
6.22k stars 313 forks source link

progress bars #64

Open dimitrieh opened 8 years ago

dimitrieh commented 8 years ago

Is it or can it be possible to get a progress bar when converting a video to gif?

vvo commented 8 years ago

It may be possible but I doubt it would be accurate. Maybe just a simple spinner could help? I agree converting to gif can sometime take a lot of time.

I am happy taking any PR adding something like indicating when gifify is working.

kevinsimper commented 8 years ago

I think a start would just be to output something to see that it is not stuck :P

vvo commented 8 years ago

I think a start would just be to output something to see that it is not stuck :P

We could but right now the fact that your command line does not returns to the prompt means "It's working"

jmbeach commented 7 years ago

@vvo or is it?

vvo commented 7 years ago

@vvo or is it?

I did not get what you meant. I am open to any PR adding a funny emoji spinner anything you want :)

jmbeach commented 7 years ago

Sorry, I was just kidding. gifify <whatever> && say done works just fine for me.

vvo commented 7 years ago

NP :dancer:

AntiMoron commented 7 years ago

I need it because I don't know whether it's dead looping or just dead lock somewhere. Let me know what's its progress dose help.

waldyrious commented 6 years ago

I think a start would just be to output something to see that it is not stuck :P

We could but right now the fact that your command line does not returns to the prompt means "It's working"

IMHO an explicit message like "converting, please wait..." would tell the user that this is normal and expected behavior, rather than a possible hang up, as others have said.

An animated spinner, and even an actual progress bar, would be nicer for sure, but I'd say that simply printing a message like the above would go around 80% of the way (if not more) to solve the core issue here.

vvo commented 6 years ago

Open to PRS, should take 2 minutes to add this message

waldyrious commented 6 years ago

Open to PRS, should take 2 minutes to add this message

For someone who's not familiar with this code (or this sort of code), would you mind giving a pointer or two? According to https://github.com/vvo/gifify/blob/master/bin/gifify#L42, the right place to add such a message would be at encode(), but what's the method that should be used to print such a message?

vvo commented 6 years ago

As to updating the behaviour and usage, first you could update the usage here: https://github.com/vvo/gifify/blob/8375290c5a8b1d994e261340140ff115dc72991a/bin/gifify#L14

Then I would add a new flag that would mean 'stdout' (not just "-", might be tricky to handle or remember).

Any examples of unix programs having -o and - or any other flag like that? Maybe curl?

waldyrious commented 6 years ago

I think you your comment was meant for #100, right?

vvo commented 6 years ago

Oh yeah, sorry I misread that.

As far as putting a "loading message" I would give a try here: https://github.com/vvo/gifify/blob/8375290c5a8b1d994e261340140ff115dc72991a/bin/gifify#L72

Which is the place where we already checked parameters etc.

Give it a try locally:

git clone git@github.com:vvo/gifify.git
cd gifify
npm link
# now "gifify" is the binary of the local gifify directory, handy to test!
# do the changes in https://github.com/vvo/gifify/blob/8375290c5a8b1d994e261340140ff115dc72991a/bin/gifify#L72
# try to run gifify and see if it works

Then submit a PR, let me know!

waldyrious commented 6 years ago

Thanks for the detailed steps. I was still unsure what function to call to write to stdout, but hopefully #101 does the right thing. It certainly seemed to work locally as intended.