I am trying to create a python script which merge the audio and video file in one (audio+video) file.
And i am using ffmpeg to achieve this but it is not working and i am getting a errors. while running this script here is my script.
import os
import subprocess
import time
from datetime import datetime
def merge_all():
global p
p =subprocess.Popen('ffmpeg -i temp_vid.mp4 -i temp_voice.wav -c:v copy -c:a aac -strict experimental -
strftime 1 ' + dt_file_name ,stdin=subprocess.PIPE,creationflags = subprocess.CREATE_NO_WINDOW)
time.sleep(2)
print('merging done')
os.remove('temp_vid.mp4')
os.remove('temp_voice.wav')
print('file delete done')>
here is the error
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\kp\AppData\Local\Programs\Python\Python38\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
File "C:\Users\kp\Desktop\test.py", line 179, in change_icon
merge_all()
File "C:\Users\kp\Desktop\test.py", line 104, in merge_all
p =subprocess.Popen('ffmpeg -i temp_vid.mp4 -i temp_voice.wav -c:v copy -c:a aac -strict experimental -strftime 1 ' + dt_file_name ,stdin=subprocess.PIPE,creationflags = subprocess.CREATE_NO_WINDOW)
File "C:\Users\kp\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\kp\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified