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

VideoFileClip error #49

Closed
ghost opened this issue Jun 21, 2014 · 9 comments
Closed

VideoFileClip error #49

ghost opened this issue Jun 21, 2014 · 9 comments

Comments

@ghost
Copy link

ghost commented Jun 21, 2014

Hi when I try to pass a .mp4 file to VideoFileClip I get the following backtrace in iPython:

----> 1 VideoFileClip("./test.mp4")

/usr/local/lib/python2.7/dist-packages/moviepy/video/io/VideoFileClip.pyc in __init__(self, filename, ismask, has_mask, audio, audio_buffersize, audio_fps, audio_nbytes, verbose)
     56         # Make a reader

     57         pix_fmt= "rgba" if has_mask else "rgb24"
---> 58         self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt)
     59 
     60         # Make some of the reader's attributes accessible from the clip


/usr/local/lib/python2.7/dist-packages/moviepy/video/io/ffmpeg_reader.pyc in __init__(self, filename, print_infos, bufsize, pix_fmt)
     40 
     41         self.pos = 1
---> 42         self.lastread = self.read_frame()
     43 
     44 

/usr/local/lib/python2.7/dist-packages/moviepy/video/io/ffmpeg_reader.pyc in read_frame(self)
     95                     self.duration)+
     96                    "Using the last valid frame instead.")
---> 97             result = self.lastread
     98 
     99         else:

AttributeError: FFMPEG_VideoReader instance has no attribute 'lastread'

Edit: I got it fixed by building/installing the latest version of ffmpeg from github. The one in the ubuntu 12.04 repo is out of date.

@ghost ghost closed this as completed Jun 21, 2014
@Zulko
Copy link
Owner

Zulko commented Jun 21, 2014

Thanks for the feedback. It's a strange error, like if FFMPEG couldn't read the first frame of the file. One possible reason would be that you don't have a recent version of ffmpeg (if you are on ubuntu/debian, the version in the repos is deprecated, you need to download a recent version on the website).

If it's not that, could you provide a file for which it doesn't work ?

@Zulko
Copy link
Owner

Zulko commented Jun 21, 2014

Huh, fixed ?

@ghost
Copy link
Author

ghost commented Jun 21, 2014

That has got to be the fastest fix ever. It was what you said.

@Zulko
Copy link
Owner

Zulko commented Jun 21, 2014

Yeah ! I will see what I can do to improve the error messages. This one really sucks.

@stuaxo
Copy link

stuaxo commented Jul 6, 2014

Hi,
I realise this is closed - however I get the same error on Ubuntu 14.04 - I think it's because Ubuntu uses libav, which being a fork is slightly incompatible with ffmpeg.

These two are probably going to remain forks for a couple of years, is it possible to support libavs ffmpeg library ?

@Zulko
Copy link
Owner

Zulko commented Jul 6, 2014

Hi,
I didn't understand, did you install the last version of ffmpeg ? It is straightforward, you just download the binary on the website and copy it in usr/bin.

@stuaxo
Copy link

stuaxo commented Jul 6, 2014

Ah in the end I tried this. Just with the default ffmpeg it doesn't work, was wondering if it's possible for it to work with the default setup.

@Zulko
Copy link
Owner

Zulko commented Jul 6, 2014

Just to be sure, it worked when you updated ffmpeg, right ?

I don't think it is a good idea to try and make it work with avconv. I spent a lot of time understanding the subtleties of ffmpeg (it's trickier than it seems) and I really don't want to spend more time doing support for avconv. I believe that using one single software like ffmpeg (i chose ffmpeg over avconv because it is more common on all platforms) makes the code more coherent, I would have to code alternative commands for almost all the i/o functions if we were to make moviepy avconv-compatible.

The current situation is only damaging for Ubuntu/Debian users (I am on Ubuntu, btw), but that is because the packagers have decided to completely deprecate ffmpeg, even in the repos, which is completely nuts imho.

@stuaxo
Copy link

stuaxo commented Jul 6, 2014

It did work with ffmpeg in the end.

Given enough time the forks will reconcile I guess.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants