如何在 Python 中编辑视频 ID3 标签?

发布于 2024-10-14 02:26:02 字数 900 浏览 4 评论 0原文

我一直在慢慢编写一个小项目来创建一个电影/电视节目/音乐 ID3 标签编辑器,该编辑器可用于我的 iTunes 库中的批量文件。在找到一堆 ID3 标签编辑器后,我开始用 python 设计 GUI:http://wiki。 python.org/moin/UsefulModules#ID3Handling

不幸的是,当需要设置实际的 ID3 标签编辑器时,我发现页面上没有任何库,或者我找到的任何其他库,例如 eyeD3,可以处理实际的电影文件。我已经在 python 应用程序上投入了大量的精力,我希望有人能告诉我三件事之一(如果没有,我必须切换到 Java,根据之前的一篇文章,Java 显然有一个用于处理 mp4 的库)文件的 ID3 标签):

  1. 是否有一些您知道的库/包可用于编辑电影的 ID3(我能找到的绝大多数内容,并且我已经完成了我的工作)这方面的功课很好,仅适用于音频)MP4 文件。 我必须指出,eyeD3 实际上非常适合 mp3,并且非常易于使用,因此越像 eyeD3 越好。

  2. 是否有某种类似文件读取器的库,可以让我读取整个文件,将 ID3 标记更改为我想要的内容,然后写入它。无奈之下我尝试用notepad++打开MP4文件,发现文件第一行是ID3标签,但无法解码。如果你们知道这个级别的一些东西,比如如何使用 python 手动编辑它,那么我们将不胜感激。

  1. 另一种语言的某种脚本,我可以使用 python 执行(但请记住,我目前只知道 Java 和 Python),但这必须是使用起来非常简单的东西,例如: edit_MP4_Tag(文件名、标题、艺术家等...) 我怀疑它是否存在。

预先感谢您的任何帮助。

I've been slowly writing a little project to create a Movie/TV Show/Music ID3 tag editor that can be used on batches of files from my iTunes library. I started designing the GUI in python after finding a bunch of ID3 tag editors here: http://wiki.python.org/moin/UsefulModules#ID3Handling

Unfortunately when it came time to set up the actual ID3 tag editor I discovered that none of the libraries on the page, or any of the other ones that I found, like eyeD3, could handle actual movie files. I've already put a lot of effort into the python app and I was hoping someone could tell me one of three things (if not, I have to switch to Java, which, according to an earlier post apparently has a library for handling mp4 files' ID3 tags):

  1. Is there some library/package that you know can be used to edit the ID3 of MOVIES (the vast majority of the stuff out there that I've been able to find, and I have done my homework well on this, is for audio only) MP4 files specifically.
    I have to point out that eyeD3 was actually great for mp3's and REALLY easy to use, so the more like eyeD3 the better.

  2. Is there some sort of file reader-like library that would allow me to read the entire file, change the ID3 tag to what I want, and then write it. In desperation I tried to open the MP4 file with notepad++ and found that the first line of the file is the ID3 tag, but I was unable to decode it. If you guys know something on this level, like how to go in and edit it manually with python, then that would be appreciated.

or

  1. Some sort of script in another language which I would be able to execute with python (keep in mind however that I only know Java and Python at the moment), but this would have to be something ridiculously simple to use like:
    edit_MP4_Tag(filename, title, artist, etc...) which I doubt exists.

Thanks in advance for any help.

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

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

发布评论

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

评论(2

人心善变 2024-10-21 02:26:02

已经过期了,但是如果您使用的是 OSX,您可以使用 appscript 通过 iTunes 本身更改元数据,这是如果慢的话很容易。

这样做的好处是它适用于任何类型的媒体,并且您也可以更改 iTunes 特定的元数据。

如果没有,您可以通过子进程或类似的方式使用Atomic Parsley

Massively overdue, but if you're on OSX, you can use appscript to alter metadata via iTunes itself, which is very easy if slow.

The great thing about this is that it works on any kind of media and you can alter iTunes-specific metadata, too.

If not, you can use Atomic Parsley via subprocess or similar.

心欲静而疯不止 2024-10-21 02:26:02

首先,我对 python 不太了解,所以我只能给你我的 2 美分,因为还没人回答你。

其次,如果您知道 id3 在字符串中的位置,那么它应该是可行的。您需要从头开始编写代码,因为电影中的 python 中没有真正的 id3。

现在,这一切都与 STRING 和 SUBSTRING 有关。您必须打开文件并获取所需的子字符串并使用尝试和失败进行修改。一个很好的例子,是在 ,作者:Prashant Khandelwal。

祝你好运。

To start, I do not know much about python so I'm just gonna give you my 2 cents as no one answered you yet.

Second, if you know where in the string is the id3, it should be workable. You will need to write your code from scratch as there is nothing really out there for id3 in python in movies.

Now, this all has to do with STRING and SUBSTRING. You got to open the file and grab the substring you need and modify with try and fail. A great example, is made in this by Prashant Khandelwal.

Good luck.

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