continue-revolution / sd-webui-animatediff

AnimateDiff for AUTOMATIC1111 Stable Diffusion WebUI
Other
3.11k stars 258 forks source link

[Feature]: use ffprobe to to auto fill number of frames from video source #184

Closed Blizaine closed 1 year ago

Blizaine commented 1 year ago

Expected behavior

Hello. I've been using AnimateDiff extensively, and it is really maturing quickly; thank you so much. I've been using it as an alt to Runway Gen1, and it's getting very good. One thing that could be automated is using ffprobe to get the total number of frames and not just FPS.

Currently, I use this command to do it, but having it auto-populate like FPS does, would be a huge time saver.
ffprobe -v error -select_streams v:0 -count_frames -show_entries stream=nb_read_frames video.mp4

Thank you!

zappityzap commented 1 year ago

Thanks for the suggestion. I submitted a PR that uses our existing cv2 code to update the frame count. I suspect ffprobe would be faster though.