progress information for video rendering
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...
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 ?
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. ;)
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.
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...
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)
that's exactly where my idea came from, actually. :)