Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

progress information for video rendering #268

Open
anarcat opened this issue Oct 25, 2017 · 6 comments
Open

progress information for video rendering #268

anarcat opened this issue Oct 25, 2017 · 6 comments

Comments

@anarcat
Copy link
Contributor

anarcat commented Oct 25, 2017

it would be nice to have progress info when ffmpeg is running. it can take a loong time when compared with images, which makes me feel like sigal has hanged...

@saimn
Copy link
Owner

saimn commented Oct 28, 2017

Agreed, but it seems difficult as ffmpeg is run in a subprocess. Not sure how to get the progress status from ffmpeg, and then it needs some work on the Python side. And you cannot really know in advance how much time is needed for a given video, so how do you estimate the total time ?

@anarcat
Copy link
Contributor Author

anarcat commented Oct 29, 2017

frankly, i have no idea. ;) I assume the click.ProgressBar thing now only estimates times based on the number of items?

just an idea: what if we would count file size instead? it may be off the mark because it videos probably take more time per byte than images, but it would be a better metric to use...

you would need to pipe the file data into ffmpeg's stdin to be able to count those bytes though, and this could be a performance hit as well...

the other alternative would be to use some lsof hack to keep track of where in the file ffmpeg is at... messy.

or you could parse ffmpeg output - maybe there's a standardized dialect there that it can yield that could be used?

just shooting ideas out there. ;)

@saimn
Copy link
Owner

saimn commented Nov 14, 2017

Yeah but it seems to me that it would be too complicated to do for a little gain. I really wish that sigal remains simple enough (KISS) and maintainable. The easiest to do would be to have some weighting with the file size, without trying to interact with the subprocess.

@anarcat
Copy link
Contributor Author

anarcat commented Nov 14, 2017

okay so how about this - if we know the number of files, we can stat() them as well to figure out how big they are. so instead of just counting files, we count sizes. that would still stay simple yet at the same time provide a more realistic estimate...

@saimn
Copy link
Owner

saimn commented Nov 14, 2017

Yes, click has an example that is quite similar, that should work:

with click.progressbar(length=total_size,
                       label='Unzipping archive') as bar:
    for archive in zip_file:
        archive.extract()
        bar.update(archive.size)

@anarcat
Copy link
Contributor Author

anarcat commented Nov 15, 2017

that's exactly where my idea came from, actually. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants