pyinstaller打包PySide2写的GUI程序,调用ffmpeg隐藏CMD控制台解决方案
参考:https://blog.csdn.net/lavinia_chen007/article/details/117256834
关键的:不用ffmpeg库,而是直接使用 subprocess调用ffmpeg.exe的,只需要在调用subprocess.Popen()时指定参数 shell=True, stdin=subprocess.PIPE 即可
try: ffmpeg = FFMPEG_PATH +' -y -i %s -ss %s -t %s -acodec copy -vcodec copy -async 1 %s' % (videoPath, start_time,length,save_name) # subprocess.call(ffmpeg) subprocess.Popen(ffmpeg,shell=True,stdin=subprocess.PIPE) except Exception as ex: print(ex)