I built an executable from a ffmpy
code, which I compiled with cx_freeze
. It works on my PC, as expected, I think it's because I have ffmpeg
installed on my Windows.
However, I need this compiled code to work on any PC, not only where ffmpeg
is installed.
When I run the executable, the ffmpy
error says, Executable "ffmpeg" not found
.
Here is my setup.py
for cx_freeze
. This setup.py
works for anything I want to compile, except where ffmpeg
is used.
import sys
from cx_Freeze import setup, Executable
from cx_Freeze import setup
from distutils.core import Extension
import os
os.environ['TCL_LIBRARY'] = r'C:\Users\Acer\Miniconda3\envs\updated\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\Users\Acer\Miniconda3\envs\updated\tcl\tk8.6'
addtional_mods = ['numpy.core._methods', 'numpy.lib.format']
setup(
name = 'programm',
version = '5.0.1',
description = 'PyQt',
options = {'build_exe': {'includes': addtional_mods}},
executables = [Executable('ffmpy_test.py', base = "Win32GUI")])
My question is, how can my ffmpy_test.py
executable find the ffmpeg.exe
in the compiled directory. I tried to place the ffmpeg directory in there, but that didn't work.
This is the test code I compiled:
from ffmpy import FFmpeg
ff = FFmpeg(inputs={'input.wmv': None}, outputs={'output.mp4': None})
ff.cmd
'ffmpeg -i input.ts output.mp4'
ff.run()