PyAV-Org / PyAV

Pythonic bindings for FFmpeg's libraries.
https://pyav.basswood-io.com/
BSD 3-Clause "New" or "Revised" License
2.43k stars 359 forks source link

frame.index is deprecated #1392

Closed YoniChechik closed 3 months ago

YoniChechik commented 3 months ago

https://github.com/PyAV-Org/PyAV/commit/17e86d152ff3b13427f29a457824b6227d210f6d This is the commit that deprecated frame.index. currently in v12.0 we get this warning, but nothing about how to fix it...

even in the site's main page we have a usage of this frame.index:

https://pyav.org/docs/stable/index.html#basic-demo

import av

container = av.open(path_to_video)

for frame in container.decode(video=0):
    frame.to_image().save('frame-%04d.jpg' % frame.index)

What is the alternative?

WyattBlue commented 3 months ago

The alternative is to use enumerate as shown in the new docs website