简体   繁体   English

编码视频时,ffmpeg忽略-metadata选项

[英]ffmpeg ignores -metadata option when video is encoded

I have a video with the following metadata: 我有一个包含以下元数据的视频:

rotate : 90

I'm using ffmpeg (4.0 binaries from windows downloaded from official website) to encode it and I want to delete this metadata information. 我正在使用ffmpeg(从官方网站下载的Windows中的4.0二进制文件)对其进行编码,并且我想删除此元数据信息。

If I do: 如果我做:
ffmpeg -i input.mp4 -c copy -metadata:s:v:0 rotate= output.mp4
the output will have removed the metadata. 输出将删除元数据。

But if I do: 但是如果我这样做:
ffmpeg -i input.mp4 -c:v libx264 -metadata:s:v:0 rotate= output.mp4
then I still have the undesired metadata. 那么我仍然有不需要的元数据。

Is there a way to remove metadata while encoding? 有没有一种方法可以在编码时删除元数据?

I was running into the same issue that you're seeing and found this tracked issue: https://trac.ffmpeg.org/ticket/6370 我遇到了您遇到的同一问题,并发现了此跟踪的问题: https : //trac.ffmpeg.org/ticket/6370

It confirms with what you're saying, the metadata field is preserved when encoding, even though you are trying to remove it. 它可以用您所说的内容确认,即使您尝试删除元数据字段,也可以在编码时保留它。

Applying the patch to the ffmpeg build that's attached as a comment worked for me and I was able to set rotate=0, even while encoding. 将补丁应用到作为注释附加的ffmpeg版本对我来说是有效的,即使在编码时,我也可以设置rotate = 0。 https://trac.ffmpeg.org/attachment/ticket/6370/0001-Fix-rotation-metadata-override-when-transcoding.patch (At least until this is fixed in a release version) https://trac.ffmpeg.org/attachment/ticket/6370/0001-Fix-rotation-metadata-override-when-transcoding.patch (至少要在发行版中修复之前)

我相信-map_metadata可以提供帮助

ffmpeg -i input.mp4 -map_metadata -1 -c:v copy -c:a copy out.mp4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM