我有以下简单的Python代码:
yellow_output = 'test_videos_output/solidYellowleft.mp4'
clip1 = VideoFileClip("test_videos/solidYellowLeft.mp4")
yellow_clip = clip1.fl_image(process_image)
yellow_clip.write_videofile(yellow_output, audio=False)
Run Code Online (Sandbox Code Playgroud)
"process_image"函数只返回您提供的内容(为测试目的而创建).
在OSX 10.11.6上运行Python 3.5.4,ffmpeg 2.8.6
我收到错误:
OSError: [Errno 32] Broken pipe
MoviePy error: FFMPEG encountered the following error while writing file test_videos_output/solidWwhiteright.mp4:
b"Unrecognized option 'preset'.\nError splitting the argument list: Option not found\n"
Run Code Online (Sandbox Code Playgroud)
视频文件未生成; 如何摆脱这个错误; 所以我可以生成MP4文件?
注意:相同的代码在Ubuntu 16.04上运行愉快
以下生成错误:
int main() {
mat_int mat1(5, vector<int>{1,2,3});
mat_int mat2(5, vector<int>{4,5,6});
for (auto it1 = mat1.begin(); it1 != mat1.end() ; ++it1) {
for (auto it11 = *it1.begin(); it11 != *it1.end(); it11++)
cout << *it11;
cout << '\n';
}
}
Run Code Online (Sandbox Code Playgroud)
编译器不接受内部循环迭代器; /home/asabbah/programming/C++/vectors1.cpp:16:28:错误:'class __gnu_cxx :: __ normal_iterator*,std :: vector >>>没有名为'begin'的成员
但是,如果我插入一个临时变量:
vector<int> temp = *it1;
Run Code Online (Sandbox Code Playgroud)
然后:
for (auto it11 = temp.begin(); it11 != temp.end(); it11++);
Run Code Online (Sandbox Code Playgroud)
一切顺利.
知道为什么会这样吗?