小编aXe*_*-HH的帖子

更改 MP4 视频中的旋转标志(不丢失元数据)

我只想更改 .mp4 视频文件中的旋转标志。存在许多类似的问题,大多数答案建议使用

ffmpeg -i input.mp4 -map_metadata 0 -metadata:s:v rotate=90 -codec copy output.mp4
Run Code Online (Sandbox Code Playgroud)

我对这些解决方案的问题是,即使它复制了大部分元数据,也会丢失一些部分,并且文件小 700kb。附件是来自 ffprobe 和 exifer 的元数据之前和之后。

另一个奇怪的发现是 ffmpeg rotate=90 命令进行 ccw 旋转,在 ffprobe 中元数据中为 (cw) 270°,但在 displaymatrix 侧数据中为 (ccw)90°。

= equal attributes
* altered attributes
- removed attributes
+ added attributes
Run Code Online (Sandbox Code Playgroud)

ffprobe input.mp4

*Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\input.mp4':
=  Metadata:
*    major_brand     : avc1
*    minor_version   : 0
*    compatible_brands: avc1isom
=    creation_time   : 2016-10-29T12:10:41.000000Z
-    firmware        : HD3.11.03.03
*  Duration: 00:00:06.01, start: 0.000000, bitrate: …
Run Code Online (Sandbox Code Playgroud)

video metadata ffmpeg video-conversion exiftool

19
推荐指数
2
解决办法
2万
查看次数

标签 统计

exiftool ×1

ffmpeg ×1

metadata ×1

video ×1

video-conversion ×1