You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to convert quite a lot of m4a files into mp3 files with the following piece of code:
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?
The text was updated successfully, but these errors were encountered: