一个非常简单的轻量级视频编辑器
我想制作一个执行以下操作的编辑器:
1)获取 mp3 音频文件
2)获取图片 -- jpg 文件
3)输出简单的视频格式,例如 .mov,其中包含 jpg 文件和 mp3 文件背景
4)没有别的
我想用这个作为一个项目来学习所有这些东西的基础知识,但是我不想手动编写基本的东西。我从哪里开始以及采取哪些关键步骤来实现这一目标?
我擅长 PHP 和 Java,并且不介意为此学习 Python。实际上,我理想地希望用 Python 编写此代码以获得经验。
谢谢!
I want to make an editor that does the following:
1) takes an mp3 audio file
2) Takes a picture --a jpg file
3) Outputs a simple video format e.g. .mov which consists of the jpg file with the mp3 file in the background
4) Does NOTHING else
I want to use this as a project to learn just the basics of all this stuff however I do not want to code basic things by hand. Where do I start and what key steps do I take to accomplish this?
I am decent with PHP and Java and do not mind learning Python for this. I actually would ideally want to write this in Python to gain experience.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您想自己编写这样的解决方案 - 忘记 Python,编译 ffmpeg 并在仔细阅读代码后直接使用它的类(或者也许使用 pyffmpeg,这仍然需要你了解 ffmpeg 的内部原理)。
然而,我很确定你想要的东西可以通过命令行单独使用 ffmpeg 可执行文件来完成 - 但这样你的 Python 代码将作为 os.Popen 的包装器结束(实际上这是相当流行的解决方案)。
我认为这取决于你的目标理解程度:要么你可以阅读 ffmpeg 文档并相信它会起作用(然后:使用 Python),要么你需要深入研究 ffmpeg 源代码以获得真正的了解正在发生的事情(顺便说一句,我没有) - 然后使用 pythonic 绑定只会阻碍你。
我已经需要 ffmpeg (来自 django)几次了,除了用 ffmpeg 命令行参数组装一个列表之外,我不需要做任何其他事情。另一方面,我非常想真正了解我到底在做什么,但似乎没有人有兴趣付钱给我获取 ffmpeg 源代码。 :-(
If you want to code such a solution yourself - forget Python, compile ffmpeg and use it's classes directly from your code after you carefully read them (or maybe use pyffmpeg, which still requires you to know ffmpeg internals).
However, I'm pretty sure that what you want could be done with ffmpeg executable alone from command line - but that way your Python code would end as a wrapper around os.Popen (it's quite popular solution actually).
I think it's a matter of what level of understanding you're aiming at: either you're ok with reading ffmpeg docs and believing it's going to work (then: use Python), or you need to dive deep into ffmpeg sources to gain real understanding what's going on (which I don't have, btw) - and then using pythonic bindings will just stand in your way.
I have needed ffmpeg (from django) a few times already and never had to do anything more than just assemble a list with ffmpeg command line args. On the other hand I would very much like to actually understand what the hell I'm doing, but no one seemed interested in paying me for groking ffmpeg sources. :-(
我很确定你可以从 mencoder 命令行完成这一切(我认为使用 -speed 选项;可能需要为您想要的视频每隔几秒提供一个 jpg 的副本,因为它最多只能将速度减慢 100 倍)。
I'm pretty sure you could do this all from the mencoder commandline (use -speed option I think; might need to give it a duplicate of your jpg for every few seconds of video you want as it can only slow things down by a factor of 100 at the most).
如果您选择 ffmpeg CLI 解决方案,或者需要一个过程来尝试直接使用库进行复制,则相关的 CLI 命令将非常简单:
If you opt for the ffmpeg CLI solution, or need a process to try and replicate with the libraries directly, the relevant CLI command would be the straightforward: