Code Monkey home page Code Monkey logo

Comments (7)

chrisspen avatar chrisspen commented on August 17, 2024

After inspecting the code, this seems to be a problem with the pre-compiled version of ffmpeg in Ubuntu 12.04, which is failing with the error:

ffmpeg: relocation error: ffmpeg: symbol avformat_alloc_output_context2, version LIBAVFORMAT_53 not defined in file libavformat.so.53 with link time reference

After uninstalled the ffmpeg package and compiling it from scratch following https://trac.ffmpeg.org/wiki/UbuntuCompilationGuide, it seems to work fine.

This issue aside, it might be a good idea in audio_segment.py to change:

subprocess.call(ffmpeg_call, stderr=open(os.devnull))

to:

subprocess.call(ffmpeg_call, stderr=sys.stderr)

so the user can see a more direct error message. Not seeing that wasted a lot of my time.

from pydub.

jiaaro avatar jiaaro commented on August 17, 2024

I wonder if there is a good way to make this user configurable. ffmpeg can be quite verbose and most of the time it's not useful information for pydub to output to stderr (showing the progress of the operation).

How would you feel about capturing ffmpeg's stderr and only outputting it to sys.stderr if ffmpeg returns a non-zero (error) status code.

from pydub.

marcwebbie avatar marcwebbie commented on August 17, 2024

What about logging? if the user is logging her application she will be able to see the log anyway.

from pydub.

chrisspen avatar chrisspen commented on August 17, 2024

Checking the exit code for a non-zero value makes sense.

from pydub.

Ratnaganadi avatar Ratnaganadi commented on August 17, 2024

Hi, I also have a problem with playing an mp3.

from pydub import AudioSegment

u=AudioSegment.from_mp3("yourself.mp3")
Traceback (most recent call last):
File "", line 1, in
File "build/bdist.macosx-10.6-intel/egg/pydub/audio_segment.py", line 297, in from_mp3
File "build/bdist.macosx-10.6-intel/egg/pydub/audio_segment.py", line 284, in from_file
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 493, in call
return Popen(_popenargs, *_kwargs).wait()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in init
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

would anyone help me? Thanks!

from pydub.

jiaaro avatar jiaaro commented on August 17, 2024

@Ratnaganadi It looks like you don't have ffmpeg installed, or if it is installed, pydub can't find it.

from pydub.

jiaaro avatar jiaaro commented on August 17, 2024

@Ratnaganadi You may want to take a look at the Getting ffmpeg set up section of the read me :)

from pydub.

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.