Comments (9)
Thanks for that! It is fixed now. The strange thing is that I have never had any problem in Python3 with these tabs, what is your version exactly?
from moviepy.
I am using python3.3.5 under Mac OSX, installing using Macports.
(I don't know whether MacPorts uses pip, easy_install or something else under the hood. I don't know if it uses six or other packages to mutate Python2 code into Python3 as it does it.)
from moviepy.
Ok thanks for the info. Could you try to reinstall and see it it works now? So that I can safely close the issue.
from moviepy.
Quick correction, I originally installed it using pip .
More trouble: old-style print statements in
File "build/bdist.macosx-10.9-x86_64/egg/moviepy/video/tools/segmenting.py", line 47
print "found %d objects"%(num_features)
File "build/bdist.macosx-10.9-x86_64/egg/moviepy/video/tools/tracking.py", line 20
print "WARNING: OpenCV not found: automated tracking not possible"
After fixing that, it installs and imports correctly.
Unfortunately, for my particular movie file, ffmpeg can't determine the duration, and so it chokes at
video/io/ffmpeg_reader.py:215 (where it is trying to find an HH:MM:SS pattern, and ffmpeg puts up
"Duration: N/A, bitrate: N/A") This is from a Raspberry Pi reading off its camera in an h264 raw stream, so some of the encoding may be a bit skanky. Any suggestions?
from moviepy.
This sounds like an interesting project. Just to be sure, are you reading from a finite video, or from a video that is still being recorded ? In the first case, what you could try is to rewrite the video with ffmpeg and see if the result has the good metadata (but this might take some time):
ffmpeg -i myvideo.flv mycopy.flv
Otherwise I can also make the duration search optional (and send a warning when a video has no duration). Could you try this and see if it works? That is, replace that line 215 by duration=None, then do things like
myvideo = VideoFileClip("my_rpi_video.avi").set_duration(arbitrary_duration)
Not ideal, but that would be a start.
Does ffmpeg at least find the fps of the video ?
The "print" statements are fixed, thanks for the report.
from moviepy.
I am reading from a file which was previously piped from the raspivid application (over the network).
This permits seeking (so ffmpeg can probe the file and then back up to the start and read.)
Since the compression is not too extreme, it requests a larger -probesize to get enough information to do what it can, but even with an arbitrarily large probesize, it doesn't get the duration.
It returns an FPS of 25. However, this is wrong (actual FPS is 10 in my case).
If I put the duration section in a try/except block, I can use FFMPEG_VideoReader() directly to get sequential frames from the beginning.
However, when I use moviepy.editor.VideoFileClip(), I always get the same frame from fullclip.get_frame(t) independent of how I change t.
Another Python3 change I found (which I needed for the coolTextEffects demo) was
diff --git a/moviepy/video/VideoClip.py b/moviepy/video/VideoClip.py
index 2e4fd03..e6be144 100644
--- a/moviepy/video/VideoClip.py
+++ b/moviepy/video/VideoClip.py
@@ -1036,7 +1036,7 @@ class TextClip(ImageClip):
if not txt.startswith('@'):
if temptxt is None:
temptxt_fd, temptxt = tempfile.mkstemp(suffix='.txt')
- os.write(temptxt_fd, txt)
+ os.write(temptxt_fd, bytes(txt,'UTF8'))
os.close(temptxt_fd)
txt = '@'+temptxt
else:
from moviepy.
Hi there, sorry to bother you with this old issue, but have you given it a try with the recent version ? There are chances that it may work properly.
from moviepy.
It's back to not working with Python 3.3
% python
Python 3.3.5 (default, Sep 20 2014, 19:48:21)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import moviepy.editor as med
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "./moviepy/editor.py", line 22, in <module>
from .video.io.VideoFileClip import VideoFileClip
File "./moviepy/video/io/VideoFileClip.py", line 3, in <module>
from moviepy.video.VideoClip import VideoClip
File "./moviepy/video/VideoClip.py", line 18, in <module>
from .io.ffmpeg_writer import ffmpeg_write_image, ffmpeg_write_video
File "./moviepy/video/io/ffmpeg_writer.py", line 15, in <module>
from moviepy.config import get_setting
File "./moviepy/config.py", line 8, in <module>
from config_defaults import (FFMPEG_BINARY, IMAGEMAGICK_BINARY)
ImportError: No module named 'config_defaults'
>>>
No such problem with python2.7.
from moviepy.
Thanks for catching that, I corrected it. Now working with Python3 too.
from moviepy.
Related Issues (20)
- No sound HOT 2
- how to keep the aspect ratio for my vertical video? HOT 5
- I cut 1800 seconds of audio, but the result is 1846 seconds. Why is this happening? How can I solve this problem?
- Resizable rounded rectangle
- Getting `AttributeError: 'NoneType' object has no attribute 'get_frame'` when trying to save a `CompositeVideoClip`
- Error When Generating a Long video and not getting the error when generating a shorter video HOT 1
- AttributeError: 'NoneType' object has no attribute 'get_frame' when calling write_videofile HOT 1
- Vertical MOV video to MP4 HOT 3
- yielding write_videofile progress HOT 5
- Output video without sound
- Inconsistent video duration before and after write_videofile HOT 1
- Audio glitching when concatenating with moviepy
- Error Using MoviePy in Django Project on Linux (Python 3.12, MoviePy 1.0.3)
- Adapt to setuptools v72 HOT 4
- How to obtain an AudioArrayClip or AudioFileClip object from a MP3 BytesIO object?
- CompositeAudioClip not compute duration
- Documentation in a PDF or any other downloadable format please?
- Incorrect Rendering of Bengali Ligatures in Subtitles Using MoviePy HOT 2
- How to set opacity in text_clip using Lambda HOT 1
- Moviepy unable to concatenate a long list of videos but is able to concatenate a short list of videos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moviepy.