Python中文
首页
教程
问答
标签
搜索
登录
注册
“module”对象在使用Moviepy时不可调用
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我正在用Moviepy开发一个简单的视频编辑程序,但是由于某些原因,我遇到了一些奇怪的错误,而且,在我看来,是不一致的错误。在</p> <p>问题似乎出在“VideoFileClip”类,因为某些原因无法访问。代码最近已经成功运行,但是我们不确定是否对程序做了一些细微的更改,或者库中是否有错误,导致程序失败。我们已经尝试了3个Moviepy的独立安装(两个单独的安装,并尝试在Windows上使用Anaconda进行调试,一个使用Ubuntu)</p> <p/><div^{cl1}$ <div^{cl2}$ <pre class="snippet-code-html lang-html prettyprint-override"><code> # -*- coding: utf-8 -*- import numpy as np import pandas as pd import moviepy def clip(t_start,t_stop): myVideoFile = "C.mp4" myVid = VideoFileClip(myVideoFile) myVid = myVid.subclip(t_start,t_stop) return myVid tfile = "timeStampLog.csv" timestamps = np.array(pd.read_csv(tfile, header=None, sep=';'),dtype=float) print(timestamps) for n in range(np.size(timestamps[:,0])): my_clip = clip(timestamps[n,0],timestamps[n,1]) my_clip.write_videofile("movie{0}.mp4".format(n)) # default codec: 'libx264', 24 fps</code></pre> </div> </div> <p>返回的错误如下:</p> <p/><div^{cl1}$ <div^{cl2}$ ^{pr2}$ </div> </div>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>如果实例化的任何类来自<code>moviepy</code>模块,则需要使用它们的完全限定名(即<code>moviepy.VideoFileClip</code>)。在</p> <p>或者需要使用<code>from moviepy import VideoFileClip</code>将特定类导入到当前模块的命名空间中。在</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
无法使用Django/mongoengine连接到MongoDB(身份验证失败)
5 回答
无法使用Django\u mssql\u后端迁移到外部hos
1 回答
无法使用Django&Python3.4连接到MySql
10 回答
无法使用Django+nginx上载媒体文件
4 回答
无法使用Django1.6导入名称模式
8 回答
无法使用Django1.7和mongodb登录管理站点
6 回答
无法使用Djangoadmin创建项目,进程使用了错误的路径,因为我事先安装了错误的Python
2 回答
无法使用Djangockedi验证CBV中的字段
5 回答
无法使用Djangocketditor上载图像(错误400)
9 回答
无法使用Djangocron进行函数调用
4 回答
无法使用Djangofiler djang上载文件
6 回答
无法使用Djangokronos
9 回答
无法使用Djangomssql provid
4 回答
无法使用Djangomssql连接到带有Django 1.11的MS SQL Server 2016
10 回答
无法使用Djangomssq迁移Django数据库
2 回答
无法使用Djangonox创建用户
4 回答
无法使用Djangopyodb从Django查询SQL Server
1 回答
无法使用Djangopython3ldap连接到ldap
10 回答
无法使用Djangoredis连接到redis
2 回答
无法使用Django中的FK创建新表
8 回答