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

Segfault for import moviepy.editor, but not for import moviepy #92

Closed
aarslan opened this issue Nov 24, 2014 · 11 comments

Comments

@aarslan
Copy link

commented Nov 24, 2014

Hi,
It's actually as simple as the title says. I made sure that the ffmpeg is the most recent version (downloaded from http://www.ffmpeg.org/download.html), and it is installed in working condition.
Importing moviepy is fine, but import moviepy.editor results in segmentation fault without any other output on the command line.
I made sure numpy, decorator and tqdm are also up to date using pip install --upgrade.
I'm running Ubuntu 14.04.1 LTS and python 2.7.

Is there a way to understand where is the segfault coming from?

$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import moviepy
import moviepy.editor
Segmentation fault (core dumped)

@Zulko

This comment has been minimized.

Copy link
Owner

commented Nov 24, 2014

That's going to be a tough one :)

"import moviepy" does basically nothing, so it's normal that it doesn't bug. But "import moviepy.editor" does a lot of things that may involve many libraries.

The error is not pythonic so I guess it comes from a C-based library or program. On possibility is FFMPEG. Can you just type 'ffmpeg' in a terminal and copy/paste what happens (just to be sure). Also do you have OpenCV or Pygame installed ? (do NOT install them if you don't have them, they are not mandatory, but if they are installed, they might be causing the trouble).

@aarslan

This comment has been minimized.

Copy link
Author

commented Nov 24, 2014

Here is the ffmpeg output

$ ffmpeg
ffmpeg version 2.4.3 Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 24 2014 15:15:13 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration:
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

I do not have pygame but I do have an old version of opencv installed. I'll check if updating it fixes the issue. Or is there a way to disable it for moviepy?

@Zulko

This comment has been minimized.

Copy link
Owner

commented Nov 24, 2014

Your ffmpeg looks nice. Now I would definitely say that's an OpenCV issue, it already gave me this kind of trouble. I have a recent version of OpenCV and it is going well. Can you try that ? There is no way to disable the OpenCV import in moviepy for the moment (opencv, if detected, is used by default to resize frames in a fast and antialiased way) but I can change that.

@aarslan

This comment has been minimized.

Copy link
Author

commented Nov 24, 2014

Hi,
I can confirm that OpenCV was the source of the error. I think my system had 2 conflicting opencv libraries and the one python was trying to use was broken for an irrelevant reason (because of a missing libtiff). It was odd that this was manifested as a segfault.

I fixed the problem with opencv (by deleting the broken version) and now moviepy.editor imports fine.
Thanks for the tip!

@Zulko

This comment has been minimized.

Copy link
Owner

commented Nov 24, 2014

Cool, I hope things will go smoothly from there, tell me if you meet other problems.

@Zulko Zulko closed this Nov 24, 2014

@anntzer

This comment has been minimized.

Copy link

commented Apr 9, 2016

It seems that moviepy.editor segfaults with OpenCV3 (which may be the limitation seen by the OP). Any chance OpenCV3 can be supported, or this limitation indicated in the docs?
Thanks.

@wackywendell

This comment has been minimized.

Copy link

commented Apr 27, 2016

@anntzer

I see no trouble with opencv 3.1.0.

I'm on Arch Linux, with moviepy installed via pip --user. If you're still having issues, could you please open a new issue, with a more complete description of the error you saw, and why you suspect its OpenCV3?

@anntzer

This comment has been minimized.

Copy link

commented Apr 27, 2016

The issue seems to be fixed with opencv 3.1.0 indeed (I suspected opencv3 because importing moviepy would segfault when it was installed (Arch Linux AUR opencv-git) but not when opencv2 was installed (Arch Linux standard repos)).

@wackywendell

This comment has been minimized.

Copy link

commented Apr 27, 2016

@anntzer: Could you open a new issue for this, and report the full error you're seeing?

Also, opencv 3.1.0 is in the Arch standard repos, and with it, I have had no issues with moviepy. We can't do anything for you on this issue without more information!

@anntzer

This comment has been minimized.

Copy link

commented Apr 27, 2016

I was exactly saying that the issue is solved by 3.1.0, so it's not a problem anymore except if you also want to maintain compatibility with 3.0.0.

@wackywendell

This comment has been minimized.

Copy link

commented Apr 27, 2016

Oh, sorry! I completely misread. Thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.