0

im desperately trying to reverse a movie with moviepy by using .time_mirror.

from moviepy.editor import *
import moviepy.video.fx.all as vfx
# Load the video
video = VideoFileClip("/videos/uncut/videogames/other/001.mp4")


popreversed_video = video.fx(vfx.time_mirror)

# Save the reversed video
reversed_video.write_videofile("videos/cut/videogames/other/001_rev.mp4")

print("done")

but im always getting this error:

MoviePy error: failed to read the first frame of video file /videos/uncut/videogames/other/001.mp4. That might mean that the file is corrupted. That may also mean that you are using a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is deprecated. Please update to a recent version from the website.
  File "/Shorts Project/codefiles/video_play_and_rewinde_test_001.py", line 11, in <module>
    popreversed_video = video.fx(vfx.time_mirror)
OSError: MoviePy error: failed to read the first frame of video file /videos/uncut/videogames/other/001.mp4. That might mean that the file is corrupted. That may also mean that you are using a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is deprecated. Please update to a recent version from the website.

the funny thing is, moviepy is installed, uninstalled, reinstalled and updated. further, ffmpeg is installed, uninstalled, reinstalled, updated.

but stimm its not working.

Please help

Thank you

  • pip install moviepy
  • pip uninstall moviepy
  • pip install ffmpeg
  • pip install ffmpeg-python
  • brew install ffmpeg
  • pip uninstall ffmpeg
  • pip install --upgrade moviepy

probably not in this order, but everything is on the currently newest version. Operator: MacOs

Rob
  • 14,746
  • 28
  • 47
  • 65

1 Answers1

0

The problem has only been fixed on the pre-release version.

You can install it via pip with the "--pre" switch

Example install:

pip install moviepy --pre

see this comment on github for more information.

  • Keep in mind this pre release may break other parts of the code. In my case the ffmpeg_extract_subclip() function did not give the same behaviour. – Jordan Humphries Sep 02 '23 at 03:22