Giter VIP home page Giter VIP logo

Comments (13)

Zulko avatar Zulko commented on May 21, 2024

It means that it cannot find FFMPEG. Have you installed FFMPEG ? On linux, it simply means downloading a recent FFMPEG binary on the website and placing it in /usr/bin. Tell m if it solves your problem.

from moviepy.

rajasimon avatar rajasimon commented on May 21, 2024

Ya thanks, i installed FFMPEG root only but i don't know how to set the correct path. Now i am getting into this error, please i am not fully expert in solving this buzzle Traceback errror..

root@ri-desktop:~/studio/master/moviepy-master/moviepy-master/examples# python compo_from_image.py
Traceback (most recent call last):
File "compo_from_image.py", line 5, in
im = ImageClip("../../ultracompositing/motif.png")
File "/usr/local/lib/python2.7/dist-packages/moviepy-0.2.1.8.09-py2.7.egg/moviepy/video/VideoClip.py", line 1011, in init
img = ffmpeg_read_image(img,with_mask=transparent)
File "/usr/local/lib/python2.7/dist-packages/moviepy-0.2.1.8.09-py2.7.egg/moviepy/video/io/ffmpeg_reader.py", line 183, in ffmpeg_read_image
reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt)
File "/usr/local/lib/python2.7/dist-packages/moviepy-0.2.1.8.09-py2.7.egg/moviepy/video/io/ffmpeg_reader.py", line 22, in init
infos = ffmpeg_parse_infos(filename, print_infos)
File "/usr/local/lib/python2.7/dist-packages/moviepy-0.2.1.8.09-py2.7.egg/moviepy/video/io/ffmpeg_reader.py", line 225, in ffmpeg_parse_infos
"path.")%filename)
IOError: MoviePy error: the file ../../ultracompositing/motif.png could not be found !
Please check that you entered the correct path.

from moviepy.

Zulko avatar Zulko commented on May 21, 2024

In the traceback error you only need to read the first lines (they tell you where the error happened) and the last lines (they tell you what is really going on). Here the last two lines tell you that the file "motif.png" couldn't be found. This is perfectly normal, because you don't have this picture.

You cannot try the MoviePy examples on your computer, because these examples require many videos and (in this case) pictures that are not included with MoviePy. The examples are just to show you how to use MoviePy. Instead, you must try to make scripts with videos that are on your computer.

from moviepy.

rajasimon avatar rajasimon commented on May 21, 2024

Oh .. got it. So guess i installed successfully. Thanks for your quick help. + star for you. i ll take it from here.

from moviepy.

Zulko avatar Zulko commented on May 21, 2024

I will leave this issue open. Just tell me if you meet problems, it's important that I know if there are the bugs or ununderstandable error messages of the program.

from moviepy.

rajasimon avatar rajasimon commented on May 21, 2024

Well, I am trying soundtrack.py in that example. i edited with correct path but seems throwing below error. Can you help me to solve?

ri@ri-desktop:~/studio/master/moviepy-master/moviepy-master/examples$ python soundtrack.py 

MoviePy: building video file file:///home/ri/studio/master/moviepy-master/moviepy-master/convert/test_soundtrack.avi
----------------------------------------
Writing audio in file:///home/ri/studio/master/moviepy-master/moviepy-master/convert/test.ogg
|----------| 0/135   0% [elapsed: 00:00 left: ?, ? iters/sec]Traceback (most recent call last):
  File "soundtrack.py", line 17, in <module>
    movie.write_videofile("file:///home/ri/studio/master/moviepy-master/moviepy-master/convert/test_soundtrack.avi", codec="mpeg4")
  File "<string>", line 2, in write_videofile
  File "/usr/local/lib/python2.7/dist-packages/moviepy-0.2.1.8.09-py2.7.egg/moviepy/decorators.py", line 49, in requires_duration
    return f(clip, *a, **k)
  File "/usr/local/lib/python2.7/dist-packages/moviepy-0.2.1.8.09-py2.7.egg/moviepy/video/VideoClip.py", line 310, in write_videofile
    verbose=verbose)
  File "<string>", line 2, in write_audiofile
  File "/usr/local/lib/python2.7/dist-packages/moviepy-0.2.1.8.09-py2.7.egg/moviepy/decorators.py", line 49, in requires_duration
    return f(clip, *a, **k)
  File "/usr/local/lib/python2.7/dist-packages/moviepy-0.2.1.8.09-py2.7.egg/moviepy/audio/AudioClip.py", line 136, in write_audiofile
    verbose=verbose)
  File "<string>", line 2, in ffmpeg_audiowrite
  File "/usr/local/lib/python2.7/dist-packages/moviepy-0.2.1.8.09-py2.7.egg/moviepy/decorators.py", line 49, in requires_duration
    return f(clip, *a, **k)
  File "/usr/local/lib/python2.7/dist-packages/moviepy-0.2.1.8.09-py2.7.egg/moviepy/audio/io/ffmpeg_audiowriter.py", line 162, in ffmpeg_audiowrite
    writer.write_frames(sndarray)
  File "/usr/local/lib/python2.7/dist-packages/moviepy-0.2.1.8.09-py2.7.egg/moviepy/audio/io/ffmpeg_audiowriter.py", line 117, in write_frames
    raise IOError(error)
IOError: [Errno 32] Broken pipe

MoviePy error: FFMPEG encountered the following error while writing file file:///home/ri/studio/master/moviepy-master/moviepy-master/convert/test.ogg:

Unknown encoder 'libvorbis'


The audio export failed because FFMPEG didn't find the specified codec for audio encoding (libvorbis). Please install this codec or change the codec when calling to_videofile or to_audiofile. For instance for mp3:
   >>> to_videofile('myvid.mp4', audio_codec='libmp3lame')
ri@ri-desktop:~/studio/master/moviepy-master/moviepy-master/examples$ 

from moviepy.

Zulko avatar Zulko commented on May 21, 2024

For some reason the program tries to write the audio in OGG format but it cannot because you don't have the codec on your computer. What is strange is that normally MoviePy should not try OGG, it should try MP3. Are you trying to write a WEBM format video ? Can you paste your code so that I can tell you what to change to make it work ?

from moviepy.

rajasimon avatar rajasimon commented on May 21, 2024

thanks for the quick replay .. This is the code .. i just edited the location only

Another thing is i edited this line make it to work

 @requires_duration
def write_videofile(self, filename, fps=24, codec=None,
             bitrate=None, audio=True, audio_fps=44100,
             preset="medium",
             audio_nbytes = 4, audio_codec= None,
             audio_bitrate = None, audio_bufsize = 2000,
             temp_audiofile= "file:////moviepy-master/moviepy-master/convert/test.ogg",
             rewrite_audio = True, remove_temp = True,
             write_logfile=False, verbose = True):

If temp_audiofile is None then it's throwing me this error

ValueError: The audio_codec you chose is unknown by MoviePy. You should report this. In the meantime, you can specify a temp_audiofile with the right extension in write_videofile.

#################################################
""" A simple test script on how to put a soundtrack to a movie """
from moviepy.editor import *
# We load a movie and replace the sound with some music:

movie = VideoFileClip("file:///moviepy-master/moviepy-master/convert/sample_iTunes.mov").\
        set_audio( AudioFileClip("file:///moviepy-master/moviepy-master/convert/test.ogg"))


# If the soundtrack is longer than the movie, then at the end of the clip
# it will freeze on the last frame and wait for the clip to finish.
# If you don't want that, uncomment the next line:

#~ movie.audio = movie.audio.set_duration(movie.duration)

movie.write_videofile("file:///moviepy-master/moviepy-master/convert/test_soundtrack.avi", codec="mpeg4")

from moviepy.

Zulko avatar Zulko commented on May 21, 2024

It seems that this is a bug that appeared a few days ago and made it mandatory to have the libvorbis codec, it has been fixed in the MoviePy version on Github but I forgot to update the version in the Package Index. Now I have done all the necessary, all you need is to update moviepy (exactly the same steps you did the first time, if you did it with pip it should be "sudo pip install --upgrade moviepy") and it should work.

However, in your example, you use a test.ogg file as the soundtrack. If you don't have libvorbis or libtheora installed on your computer, it will probably not work, you need to use another format for the soundtrack (mp3 should work).

Tell me if it solves the problem.

from moviepy.

Zulko avatar Zulko commented on May 21, 2024

Can I close this issue ?

from moviepy.

rajasimon avatar rajasimon commented on May 21, 2024

U there ..?

Everything perfectly fine and i almost closing my project.

Now i just need convert flac to mp3 and i issue the below command

ffmpeg -i hang_drum.flac -acodec libmp3lame destination_path.mp3

Error list:

ffmpeg version 2.3.3 Copyright (c) 2000-2014 the FFmpeg developers
built on Sep 5 2014 17:58:33 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration:
libavutil 52. 92.100 / 52. 92.100
libavcodec 55. 69.100 / 55. 69.100
libavformat 55. 48.100 / 55. 48.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.100 / 4. 11.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
Input #0, flac, from 'hang_drum.flac':
Metadata:
TSS : Logic 10.0.6
ENCODER : Lavf55.44.100
Duration: 00:02:36.06, start: 0.000000, bitrate: 627 kb/s
Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
Unknown encoder 'libmp3lame'

I already tried to install sudo apt-get install lame ffmpeg libavcodec-extra-53 but Nothing happened, same error

from moviepy.

Zulko avatar Zulko commented on May 21, 2024

I'm closing this as old (MoviePy now relies on ImageIO for ffmpeg)

from moviepy.

harsh1795 avatar harsh1795 commented on May 21, 2024

Hey i installed MoviePy on my ubuntu computer but when i run this:
from moviepy.editor import *
Imageio: 'ffmpeg.linux64' was not found on your computer; downloading it now.

But it doesn't download. I downloaded manually "ffmpeg.linux64" , now i m not sure where to place it. Can you please help.

from moviepy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.