Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find a format to read the specified file in mode 'i' #219

Closed
hgillh opened this issue Oct 21, 2015 · 12 comments
Closed

Could not find a format to read the specified file in mode 'i' #219

hgillh opened this issue Oct 21, 2015 · 12 comments
Labels
bug Issues that report (apparent) bugs.

Comments

@hgillh
Copy link

hgillh commented Oct 21, 2015

I have created a script to add few images and text in a video. It works fine when I run it from command line.
But when I try to run it from a web-application, through apache (django 1.8 with mod_wsgi), It fails with following error at img = imread(img) (VideoClip.py)

Error : Could not find a format to read the specified file in mode 'i'

Please help

@diakonovm
Copy link

I am having the same problem. Have you managed to find the solution?

@harrywykman
Copy link

Same problem here. Running from within a django virtual env.

@diakonovm
Copy link

I solved the problem by installing ffmpeg and making sure all my dependencies were satisfied. This is a problem with the environment. I was trying to execute this on aws lambda, so I had to package it correctly for deployment, subsequently I discovered ffmpeg was the problem.

@harrywykman
Copy link

Thanks. What ffmpeg version are you using? Were there other dependencies you think made a difference? I tried installing the latest version and followed the instructions at moviepy/config_defaults.py to change the binary used by moviepy but I'm still getting the same error.

@diakonovm
Copy link

Take a look at this thread - imageio/imageio#126

@mhfowler
Copy link

mhfowler commented Mar 1, 2016

I am also having the same problem. Had a moviepy script which was working well on my macbook running El Capitan, but now running into this error while trying to get the script running on ubuntu 14 on EC2.

Here is the exact error I get
File "/var/www/montage/montage_script/montage_beta.py", line 207, in _create_ken_burns_clip image_clip = ImageClip(photo_file_path) File "/var/www/montage/custom_moviepy/moviepy/video/VideoClip.py", line 923, in __init__ img = imread(img) File "/usr/local/lib/python2.7/dist-packages/imageio/core/functions.py", line 181, in imread reader = read(uri, format, 'i', **kwargs) File "/usr/local/lib/python2.7/dist-packages/imageio/core/functions.py", line 108, in get_reader 'in mode %r' % mode) ValueError: Could not find a format to read the specified file in mode 'i'

Below are the relevant lines from my ansible script, which completely determined the configuration of the machine:

apt: name=python-pip update_cache=yes state=latest apt: name=python-dev update_cache=yes state=latest apt: name=python-setuptools update_cache=yes state=latest command: apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk pip: requirements=/var/www/montage/aws_requirements.txt

Below is my aws_requirements.txt file
boto3==1.2.3 moviepy==0.2.2.11 Flask==0.10.1 slackclient==0.18.0 awscli==1.10.7 Pillow==3.1.1 imageio==1.5

I will also read through the imageio thread you linked and will post my answer back here if I figure something out.

Any intuitions on what might be missing from the installation?

@entrepreneurj
Copy link

So, I don't know about anybody else but I had a similar problem on my Mac. I was using a virtualenv and I was also passing the folder path to the function. Adding a few debug statements to the imageio installed in my virtualenv showed me that the file it kept hanging on was a hidden .DS_Store file. Once I deleted that file in the specified directory, everything ran as expected.

Hope that helps!

@keikoro
Copy link
Collaborator

keikoro commented Feb 17, 2017

@hgillh did you manage to solve the original problem with the input provided in this issue?

Everyone else: is this something that should be hinted at in the documentation? I'm also asking because the newest issue, #420, sounds like it might be similar to what some who commented in here experienced.

@keikoro
Copy link
Collaborator

keikoro commented Feb 17, 2017

To clarifiy: the other issue is not about the same error message, my comment was meant more in regard to running into problems when using moviepy with Django/in different environments.

@keikoro keikoro added the bug Issues that report (apparent) bugs. label Feb 18, 2017
@keikoro
Copy link
Collaborator

keikoro commented Dec 16, 2018

I'm closing this. Please reopen (or create a new issue) if this is something that should get added to the docs.

@keikoro keikoro closed this as completed Dec 16, 2018
@ishandutta2007
Copy link
Contributor

ishandutta2007 commented Jan 24, 2019

I didn't have a .DS_Store, my issue was the filename had spaces. Removing spaces from filenames solved the issue.

@Megha-SVG
Copy link

ValueError: Could not find a format to read the specified file in single-image mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that report (apparent) bugs.
Projects
None yet
Development

No branches or pull requests

8 participants