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!


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM