moviepy音视频剪辑:使用fl_time报错OSError: MoviePy error: failed to read the first frame of video file

在moviepy中使用fl_time进行诸如快播、慢播、倒序播放等时间特效处理时报错:

OSError: MoviePy error: failed to read the first frame of video file F:\video\WinBasedWorkHard_src.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.

之所以出现这个报错,估计是因为使用fl_time对时间变换时,从原剪辑的0-end时间段读取帧时,原剪辑end这个时间位置已经到视频结尾,可能没有有效的帧,导致读取视频时报错。解决方案就是将end位置稍微往后退一点,退一个帧就够了。

更多时间特效的处理请参考《moviepy音视频剪辑:使用fl_time进行诸如快播、慢播、倒序播放等时间特效处理的原理和可能遇到的坑

跟老猿学Python、学5G!

posted @ 2020-06-01 18:39  老猿学Python  阅读(1160)  评论(0编辑  收藏  举报