admin 管理员组文章数量: 1086864
MoviePy error: FFMPEG encountered the following error while writing file
安装moviepy后,在执行write_videofile函数将输入写入视频文件时,出现错误:
MoviePy error: FFMPEG encountered the following error while writing file new_videoTEMP_MPY_wvf_snd.mp3:b"Unknown encoder 'libmp3lame'\r\n"The audio export failed because FFMPEG didn't find the specified codec for audio encoding (libmp3lame). Please install this codec or change the codec when calling to_videofile or to_audiofile. For instance for mp3:>>> to_videofile('myvid.mp4', audio_codec='libmp3lame')
原因是使用了conda install -c conda-forge moviepy,改为使用pip install moviepy即可。
conda安装测试过程
> conda create -n condatest python=3.7
> conda activate condatest
> conda install -c conda-forge moviepy
> python
>>> from moviepy.editor import *
>>> v = VideoFileClip("video_example.mp4")
>>> v.write_videofile("new_video.mp4")
MoviePy error: FFMPEG encountered the following error while writing file new_videoTEMP_MPY_wvf_snd.mp3:b"Unknown encoder 'libmp3lame'\r\n"The audio export failed because FFMPEG didn't find the specified codec for audio encoding (libmp3lame). Please install this codec or change the codec when calling to_videofile or to_audiofile. For instance for mp3:>>> to_videofile('myvid.mp4', audio_codec='libmp3lame')>>> v.close()
>>> exit()
pip安装测试过程
> conda create -n piptest python=3.7
> conda activate piptest
> pip install moviepy
> python
>>> from moviepy.editor import *
>>> v = VideoFileClip("video_example.mp4")
>>> v.write_videofile("new_video.mp4")
Moviepy - Building video new_video.mp4.
MoviePy - Writing audio in new_videoTEMP_MPY_wvf_snd.mp3
MoviePy - Done.
Moviepy - Writing video new_video.mp4Moviepy - Done !
Moviepy - video ready new_video.mp4>>> v.close()
>>> exit()
本文标签: MoviePy error FFMPEG encountered the following error while writing file
版权声明:本文标题:MoviePy error: FFMPEG encountered the following error while writing file 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1693554713a228958.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论