获取视频剪辑的最后一帧并使用moviepy扩展10个场景

2024-04-24 09:21:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用moviepy编辑一些视频剪辑。我想播放原始剪辑的最后一帧10秒钟,这样我就可以在上面显示一些文本。我试着用

clip.to_ImageClip(t=clip.duration).set_duration(10)

但失败了。你知道吗

有人知道为什么吗?以及任何可能的解决方案。你知道吗

import moviepy.editor as ed
import os

content=ed.VideoFileClip(path)
myclip=content.to_ImageClip(content.duration).set_duration(10)
myclip.write_videofile(path)

电影复制错误:

failed to read the first frame of video file C:\my\test.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. 

Tags: ofthetopathimportclipversioncontent