0

Here is the script being used:

import os
import ffmpeg

start_dir =r'C:\Users\Videos_2'

def convert_to_mp4(mkv_file):
    name, ext = os.path.splitext(mkv_file)
    out_name = name + ".mp4"
    #ffmpeg.input(mkv_file).output(out_name, format = 'mp4', acodec ='aac', ar=16000, audio_bitrate=96000 ).run()
    ffmpeg.input(mkv_file).output(out_name, format = 'mp4', acodec ='aac', ar=16000, audio_bitrate=96000 ).run()
    print("Finished converting {}".format(mkv_file))

for path, folder, files in os.walk(start_dir):
    for file in files:
        if file.endswith('.mkv'):
            print("Found file: %s" % file)
            convert_to_mp4(os.path.join(start_dir, file))
        else:
            pass

It is similar to the following: Converting mkv files to mp4 with ffmpeg-python

It gives me the error FileNotFoundError: [WinError 2] The system cannot find the file specified on the line convert_to_mp4(os.path.join(start_dir, file)). From the link provided it says to fix the problem "Make sure ffmpeg.exe is in the same directory as the script." However I do not understand exactly what that means. I downloaded ffmpeg through the terminal window in the environment that I am using.

Justin
  • 73
  • 7

1 Answers1

0

I believe you should try to move your script to the ffmpeg installed directory.