Progress bar for `parse_speed=1`?
pcroland opened this issue · 4 comments
Is it possible somehow to access how much of the file is already read so I could hook it up to a rich.Progress
?
Currently, it is not possible. @JeromeMartinez, any idea how we could implement this? Is there some way to connect a callback function?
No callback function (yet), we have a callback function feature but there is no callback for a progress bar yet.
We have MediaInfo::State_Get()
, value is between 0 and 10000, but you need a separate thread for probing the value.
Could I pipe the file through something that can read how many bytes has been read?
Yes, the parse
method accepts a file-like object so you could create a file-like object that does something every time its read()
method is called.
Please take a look at the code if you want to understand how pymediainfo handles file-like objects:
pymediainfo/pymediainfo/__init__.py
Lines 460 to 488 in 5ccb770
On a side note, I just noticed that pymediainfo only seems to support seekable objects, so I created #132.