using ffmpeg command line with python's subprocess module

iMath redstone-cold at 163.com
Tue Dec 3 20:42:45 EST 2013


在 2013年12月3日星期二UTC+8上午9时42分11秒,rusi写道:
> On Tuesday, December 3, 2013 6:45:42 AM UTC+5:30, iMath wrote:
> 
> > so is there any way to create a temporary file by Python here ?
> 
> 
> 
> http://docs.python.org/2/library/tempfile.html
I use the following code to do the test ,but error occurred ,it prompts system cannot find specified files ,but the files are indeed exists there ,any help ?

with tempfile.TemporaryFile() as fp:
    fp.write(("file '"+'a1.mp3'+"'\n").encode('utf-8'))
    fp.write(("file '"+'a2.mp3'+"'\n").encode('utf-8'))

    subprocess.call(['ffmpeg/ffmpeg', '-f', 'concat','-i',fp, '-c',  'copy', 'a3.mp3'])



More information about the Python-list mailing list