Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在google colab上保存文件_Python_Google Drive Api_Google Colaboratory_Moviepy - Fatal编程技术网

Python 在google colab上保存文件

Python 在google colab上保存文件,python,google-drive-api,google-colaboratory,moviepy,Python,Google Drive Api,Google Colaboratory,Moviepy,我正在使用moviepy处理存储在google colab上的google drive上的视频。我想将修剪过的视频保存在gogle drive上的当前工作目录中,但我无法这样做。下面是我正在使用的代码(IIUC targetname是我指定正在生成的新文件名的地方): ffmpeg\u extract\u子clip(“A1203.mp4”,开始时间,结束时间,targetname='test.mp4') 下载('test.mp4')您提供的代码与错误消息中的代码不同。在后者中,它指出: ffm

我正在使用moviepy处理存储在google colab上的google drive上的视频。我想将修剪过的视频保存在gogle drive上的当前工作目录中,但我无法这样做。下面是我正在使用的代码(IIUC targetname是我指定正在生成的新文件名的地方):

ffmpeg\u extract\u子clip(“A1203.mp4”,开始时间,结束时间,targetname='test.mp4')

下载('test.mp4')
您提供的代码与错误消息中的代码不同。在后者中,它指出:

ffmpeg_extract_subclip("D1203H.mp4", start_time, end_time, targetname=files.download('test.mp4'))
这也是执行失败的原因。通过
files.download('test.mp4')
您尝试从当前目录下载
test.mp4
,但由于该目录尚不存在,因此失败。因此,您必须先在不使用
文件的情况下调用该命令。下载()
,然后再进行下载

ffmpeg_extract_subclip("D1203H.mp4", start_time, end_time, targetname='test.mp4')
files.download('test.mp4')