Closed aelefebv closed 7 months ago
Alternatively, we could keep fps as a parameter and translate it to duration before passing it to imageio via duration=1000/fps
Alternatively, we could keep fps as a parameter and translate it to duration before passing it to imageio via duration=1000/fps
Personally this would be my preference, especially because you could gate that on the imageio version, so there would be no disruption at all to any users (even those with older imageio).
I also think it's easier to think about fps
Thanks for the PR @aelefebv ! Much appreciated :-)
I agree with Juan here, we should not mirror the imageio API and should instead keep ours consistent with FPS
Makes sense to me! Just changed it back to fps and now passing in duration to get_writer.
And thanks again for the great plugin :)
Hmmm, perhaps we need a try/except or if/else somewhere to account for multiple imageio versions? The tests are failing with the current changes:
E TypeError: FfmpegFormat.Writer._open() got an unexpected keyword argument 'duration'
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
a9ca7a7
) 86.25% compared to head (922e8f2
) 86.26%. Report is 2 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@jni The duration
kwarg is for pillow plugin only (see https://github.com/imageio/imageio/issues/992#issuecomment-1567479878 ) so I just reverted the change for ffmpeg. I think this is good to go, unless you prefer to not have the duration setting in the try:
-- could just do it in the imageio
call.
Closes: https://github.com/napari/napari-animation/issues/174