interru / ffmpegwrapper Goto Github PK
View Code? Open in Web Editor NEWA simple wrapper for ffmpeg-cli
License: Other
A simple wrapper for ffmpeg-cli
License: Other
from ffmpegwrapper import FFmpeg, Input, Output
When running FFmpeg('ffmpeg', Input('a.mp4'), Output('-b.mp4'))
, ffmpeg gives "Unrecognized option 'b.mp4'."
It seems that the command becomes ffmpeg -i a.mp4 -b.mp4
But the command should be ffmpeg -i a.mp4 -- -b.mp4
to prevent the issue (by adding --
).
Hi,
I am trying to convert quite a lot of m4a files into mp3 files with the following piece of code:
for root,dirs,files in os.walk("/Users/jonathan/Desktop/Music1"):
for file1 in files:
if file1[len(file1)-3:len(file1)] == "m4a":
input1 = Input("/Users/jonathan/Desktop/Music1/"+file1)
codec = AudioCodec("libmp3lame")
output = Output("/Users/jonathan/Desktop/MP3/"+file1[0:len(file1)-3]+"mp3", codec) #replace the path
ffmpeg = FFmpeg("ffmpeg", input1, output)
ffmpeg.run()
It works fine until a certain point, when it crashes and shows the following message:
Traceback (most recent call last): File "antomp3.py", line 18, in <module> ffmpeg.run() File "/Users/jonathan/anaconda/lib/python2.7/site-packages/ffmpegwrapper-0.1_dev-py2.7.egg/ffmpegwrapper/ffmpeg.py", line 158, in run return FFmpegProcess(self).run() File "/Users/jonathan/anaconda/lib/python2.7/site-packages/ffmpegwrapper-0.1_dev-py2.7.egg/ffmpegwrapper/ffmpeg.py", line 97, in run stdin=PIPE, stdout=PIPE, stderr=STDOUT) File "/Users/jonathan/anaconda/lib/python2.7/subprocess.py", line 711, in __init__ errread, errwrite) File "/Users/jonathan/anaconda/lib/python2.7/subprocess.py", line 1197, in _execute_child errpipe_read, errpipe_write = self.pipe_cloexec() File "/Users/jonathan/anaconda/lib/python2.7/subprocess.py", line 1153, in pipe_cloexec r, w = os.pipe() OSError: [Errno 24] Too many open files
I've been reading about this error message on the web and it seems that it is a problem of not closing the files opened through Popen(). Can you help me fix this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.