Drawtext冻结

时间:2017-08-22 12:38:16

标签: python ffmpeg drawtext

我正在尝试将文字添加到1小时的视频中,但仅限于指定的时间。我在python中使用了这个命令,并使用子进程来运行它。

   cmd="ffmpeg -y -i "+input_file+" -vf drawtext=enable=\'between(t,"+str(start)+","+str(end)+")\':fontfile=C\:\\\\\\\\ffmpeg\\\\\\\\arial.ttf\:text="+starttime+"\:x="+endtime+"\:y="+str(i[3][1])+" "+output.mp4
    print(cmd)
    p = subprocess.Popen(cmd.split(), shell=True,
                 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    output = p.communicate()[0]

当我尝试运行它时,整个过程在shell中冻结,它打印cmd并且没有任何反应

ffmpeg -y -i C:\\moviepy-master\\moviepy-master\\lecture7.mp4 -vf drawtext=enable='between(t,300,1000)':fontfile=C\:\\\\ffmpeg\\\\arial.ttf\:text=helloworld\:x=200\:y=600 C:\\moviepy-master\\moviepy-master\\lecture7text.mp4, 

整个过程需要很长时间,最终视频根本没有文字。

0 个答案:

没有答案