电影视频不在YouTube上播放

发布于 2025-02-13 08:02:45 字数 855 浏览 1 评论 0原文

我正在尝试上传使用thoypy制作的视频到YouTube,但是当我最终上传时,我无法播放它们。视频播放停止了6秒。 (例如。

我已经尝试将音频编解码器从MP3更改为ACC,并且尝试更改视频扩展和编解码器。我尝试了.mp4(mpeg4和libx264)和.webm,但似乎没有任何变化:(

视频很长,我知道,但是如果我使用视频编辑工具制作视频,一切都可以。我不确定什么是使用视频编辑器和摄影师制作视频之间的区别是,用视频编辑器导出视频的时间x20带有

我的代码的时间:

from moviepy.editor import *
from cairosvg import svg2png
import wget

base_url="/Users/Nicolas/Desktop/Programacion/AUDIOLIBROS/Descarga_Libros/libros/pagina_1/"

filename="a-a-milne_the-red-house-mystery_advanced.mp3"
name=filename.replace("_advanced.mp3", "")


myclip = ImageClip(base_url+f"cover-a-a-milne_the-red-house-mystery-min.png")

audioclip = AudioFileClip(base_url+f"{name}_advanced.mp3").subclip((1,13), None)
myclip.set_duration(5).set_audio(audioclip).write_videofile(base_url+f"{name}_advanced.webm", fps=29.97)

编辑 。 “隐藏”,因此您实际上可以使用提供的链接进入视频。

I am trying to upload videos made using moviepy to YouTube but when i finally upload them, i can't play them. The video playback stops at 6 seconds. (e.g. https://www.youtube.com/watch?v=CLSWs63ygH0).

I've tried changing the audio codec from mp3 to acc and i've tried changing the video extensions and codecs. I tried .mp4 (mpeg4 and libx264) and .webm but nothing seems to change :(

The videos are pretty long, i know, but if I make the video using a video editing tool, everything works. I'm not sure what is the difference between making a video using a video editor and moviepy. The thing is that exporting a video with a video editor takes x20 the time that exporting with moviepy takes.

My code:

from moviepy.editor import *
from cairosvg import svg2png
import wget

base_url="/Users/Nicolas/Desktop/Programacion/AUDIOLIBROS/Descarga_Libros/libros/pagina_1/"

filename="a-a-milne_the-red-house-mystery_advanced.mp3"
name=filename.replace("_advanced.mp3", "")


myclip = ImageClip(base_url+f"cover-a-a-milne_the-red-house-mystery-min.png")

audioclip = AudioFileClip(base_url+f"{name}_advanced.mp3").subclip((1,13), None)
myclip.set_duration(5).set_audio(audioclip).write_videofile(base_url+f"{name}_advanced.webm", fps=29.97)

EDIT: The video visibility is know set to "hidden" so you can actually get to the video using the link provided.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迟到的我 2025-02-20 08:02:45

根据Theypy关于创建和导出视频剪辑的文档( https://zulko.github.io/moviepy/getting_started/videoclips.html ),剪辑的持续时间必须手动设置,并在您的代码上设置,该行myClip.set_duration(myclip.set_duration( 5)就是这样做的。您将持续时间设置为5秒。

According to MoviePy's documentation on creating and exporting video clips(https://zulko.github.io/moviepy/getting_started/videoclips.html), the duration of the clip has to be set manually and on your code, that line myclip.set_duration(5) does exactly that. You have set the duration to 5 seconds.
code from the official documentation

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文