0

I'm using Moviepy to convert Video, Error occurs while doing that

try to change the file location on every drive but still the issue presists

import moviepy.editor as mp

clip = mp.AudioFileClip("C:\Galaxy S10- OfficialIntroduction.mp4‪").subclip(30,100)

clip.write_audiofile("D:/hello.wav")
C:\Users\sanchit\PycharmProjects\mystartup\venv\Scripts\python.exe "C:/Users/sanchit/PycharmProjects/mystartup/Mp3 TO AUDIO.py"
Traceback (most recent call last):
  File "C:/Users/sanchit/PycharmProjects/mystartup/Mp3 TO AUDIO.py", line 4, in <module>
    clip = mp.AudioFileClip("C:\Galaxy S10- Official Introduction.mp4‪").subclip(30,100)
  File "C:\Users\sanchit\PycharmProjects\mystartup\venv\lib\site-packages\moviepy\audio\io\AudioFileClip.py", line 72, in __init__
    buffersize=buffersize)
  File "C:\Users\sanchit\PycharmProjects\mystartup\venv\lib\site-packages\moviepy\audio\io\readers.py", line 50, in __init__
    infos = ffmpeg_parse_infos(filename)
  File "C:\Users\sanchit\PycharmProjects\mystartup\venv\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 274, in ffmpeg_parse_infos
    "path.")%filename)
OSError: MoviePy error: the file C:\Galaxy S10- Official Introduction.mp4‪ could not be found!
Please check that you entered the correct path.

Process finished with exit code 1
2
  • 1
    Are you sure that you have file in "C:\Galaxy S10- OfficialIntroduction.mp4‪" Commented Aug 22, 2019 at 8:37
  • 1
    See: github.com/Zulko/moviepy/issues/830 Commented Aug 22, 2019 at 9:21

3 Answers 3

2

I copied the string verbatim from your question, and there is an extra non-visible character at the end of your filename (examined in Python 3):

In [9]: list((c, ord(c)) for c in
        "C:\Galaxy S10- OfficialIntroduction.mp4‪"[-4:])
Out[9]: [('m', 109), ('p', 112), ('4', 52), ('\u202a', 8234)]

It is the left to right embedding character. It is almost certain that this is not actually part of the filename, hence the error.

Sign up to request clarification or add additional context in comments.

Comments

0

Try running video(mp4 file), if it works okay then try

(r"C:\Galaxy S10- OfficialIntroduction.mp4‪")

or

("C:\\\Galaxy S10- OfficialIntroduction.mp4‪")

or

("C:/Galaxy S10 OfficialIntroduction.mp4‪")

Comments

0

It looks like the path to your video file might be causing the issue. Here are a few things you can try to fix it:

Double-check the file path: Make sure the file path is correct. It looks like you might have a typo or an extra space in the filename.

Use raw strings or double backslashes: In Python, backslashes are escape characters, so you'll want to either use double backslashes \ or a raw string r"" for the file path.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.