Ask Your Question
2

How to read gif in python ?

asked 2018-03-03 06:43:20 -0600

Nbb gravatar image

updated 2018-03-03 06:44:09 -0600

How do I read a gif in opencv python ? I tried imread but it is reading nothing. It is in the same directory as my code.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2018-03-03 07:06:19 -0600

berak gravatar image

you can't using imread() , there's no codec for that builtin (still a license problem)

you can abuse VideoCapture (works, because ffmpeg can read gif's) , or you'll have to fallback to 3rd party libs like PIL

edit flag offensive delete link more

Comments

1

thank you very much ! VideoCapture works nicely

Nbb gravatar imageNbb ( 2018-03-03 07:33:50 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-03-03 06:43:20 -0600

Seen: 14,072 times

Last updated: Mar 03 '18