xmovie icon indicating copy to clipboard operation
xmovie copied to clipboard

gif always small

Open scollis opened this issue 2 years ago • 5 comments

Don't know if its just me but if I save as .mov things are good but .gif even with gif_resolution_factor=2.0 makes a small gi movie_parallel (1) f

scollis avatar Mar 23 '22 21:03 scollis

Thanks for using xmovie! I think this would be something that might be addressed with the right FFMPEG options. Ill try to look into it next week. I remember there were some options available.

jbusecke avatar Mar 23 '22 23:03 jbusecke

Many thanks!

scollis avatar Mar 28 '22 16:03 scollis

Could you actually provide the code you used here? That way I can make sure we are talking about the same 'baseline'. Thanks

jbusecke avatar Mar 28 '22 17:03 jbusecke

This might have to do with the fact that the input gif_resolution_factor= is unused in the save method

def save(
        self,
        filename,
        remove_frames=True,
        remove_movie=True,
        progress=False,
        verbose=False,
        overwrite_existing=False,
        parallel=False,
        parallel_compute_kwargs=dict(),
        framerate=15,
        ffmpeg_options="-c:v libx264 -preset veryslow -crf 10 -pix_fmt yuv420p",
        gif_palette=False,
        gif_resolution_factor=0.5, #<-- is not used in the method 
        gif_framerate=10, 
    ):

Would the fix to this be to multiply the resolution list that is in the convert_gif method ?

current code:

            convert_gif(
                mpath,
                gpath=gpath,
                resolution=[480, 320],
                gif_palette=gif_palette,
                verbose=verbose,
                remove_movie=remove_movie,
                gif_framerate=gif_framerate,
            )

suggested fix

            convert_gif(
                mpath,
                gpath=gpath,
                resolution=gif_resolution_factor*np.asarray([480, 320]),
                gif_palette=gif_palette,
                verbose=verbose,
                remove_movie=remove_movie,
                gif_framerate=gif_framerate,
            )

dopplerchase avatar May 02 '22 15:05 dopplerchase

Ah interesting, this seems like a good solution, but I think we need a test to check this behavior. I am pretty busy for this/next week, so will probably not be able to tackle it. But if someone else wants to take a crack, I will give my best to review.

jbusecke avatar May 03 '22 14:05 jbusecke