ffmpeg将元数据添加到ogg(opus)并嵌入图像 [英] ffmpeg add metadata to ogg(opus) and embed image

查看:111
本文介绍了ffmpeg将元数据添加到ogg(opus)并嵌入图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

像标题一样,我想在一个文件夹(一个专辑/一个艺术家)中的 ogg(opus)文件中添加/更改元数据.当我从 wav/flac 到 opus 我通常使用

like the title I want to add/change metadata to ogg(opus) files in one folder(one album/one artist).When i encode from wav/flac to opus i usually use

for f in *.*; do ffmpeg -i "$f" -c:a libopus -b:a 510000 "${f%.*}.ogg"; done

然后,当我使用

for f in *.*; do ffmpeg -i "$f" -c copy -metadata artist="artist name" -metadata album="album name" "${f%.*}.ogg"; done

结果是文件减少到了47kb(因此我假设输入和输出名称不能相同).

The result is the file reduced to just like 47kb(so i assumed that input and output name can't be same).

那么在保留相同名称的情况下添加/更改元数据的任何有效方法是什么?以及如何将图像嵌入到ogg(opus)文件中?我想在播放文件时显示封面/图像.

So any efficient way to add/change metadata while retaining same name? And how to embed image to the ogg(opus) files?I want to have cover art/image displayed when playing the files.

推荐答案

对不起,我忘记了我的这篇帖子,因为一个多月没有答案.所以实际上在那时进行了一些测试之后,我的问题仅仅是因为出于某种原因,我不知道(我不精通技术)ffmpeg和其他标记器在使用带有.ogg扩展名的opus编解码器时拒绝标记文件.我搜索了一下,opus编解码器的本机和推荐扩展名是.opus扩展名,因此我将其与ffmpeg -map函数一起使用,将flac中的元数据复制到了我正确创建的新opus文件中.

I'm sorry I forgot this post of mine since there're no answer for more than a month. So actually after some testing back then, my problem is simply because for reasons I don't know(I'm not tech savy)ffmpeg and other tagger refuse to tag files when opus codec with .ogg extention being use. I searched a bit and the native and recommended extention for opus codec is .opus extention so I used that and with ffmpeg -map function the metadata from flac copied to the new opus files I created correctly.

还可以使用ffmpeg或之后的任何标记器轻松嵌入图像.

The image also can embedded easily using ffmpeg or any tagger after that.

对于覆盖问题,实际上有一点逻辑,实际上是不可能做我想要的事情,只是文件必须具有不同的全名(.flac和.opus可以工作)或仅将文件输出到其他目录.

As for the overwrite problem, actually with a bit of logic it is really impossible to do what I want, simply the files must have different full names(.flac and .opus works) or just output the files to other directory.

这篇关于ffmpeg将元数据添加到ogg(opus)并嵌入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆