0

如何使用 mp4Parser 创建视频的镜像值。如果可能的话,矩阵的什么值会起作用。请帮我..

4

1 回答 1

0

矩阵是:

-1  0  0 
 0  1  0
 0  0  1

此代码将矩阵设置为文件中的第一个轨道:

    IsoFile isoFile = new IsoFile("input.mp4");
    TrackHeaderBox tkhd = 
           (TrackHeaderBox) Path.getPath(isoFile, "/moov[0]/trak[0]/tkhd[0]");
    tkhd.setMatrix(new Matrix(-1, 0, 0, 1, 0, 0, 1, 0, 0));
    FileOutputStream fos = new FileOutputStream("output.mp4");
    isoFile.getBox(fos.getChannel());

但请注意,并非所有播放器都支持矩阵变换。

看看这里,看看如何让 VideoView 尊重矩阵

于 2014-08-13T13:59:27.860 回答