我有这段代码:
如何将文本写入视频文件?但我想要将多行文本写出,而不仅仅是一行。
我该如何做到这一点?
import subprocess , os
ffmpeg = "C:\\ffmpeg_10_6_11.exe"
inVid = "C:\\test_in.avi"
outVid = "C:\\test_out.avi"
if os.path.exists( outVid ):
os.remove( outVid )
proc = subprocess.Popen(ffmpeg + " -i " + inVid + ''' -vf drawtext=fontfile=/Windows/Fonts/arial.ttf:text="onLine1 onLine2 onLine3":fontcolor=white:fontsize=20 -y ''' + outVid , shell=True, stderr=subprocess.PIPE)
proc.wait()
print proc.stderr.read()
os.startfile( outVid )
如何将文本写入视频文件?但我想要将多行文本写出,而不仅仅是一行。
我该如何做到这一点?