在android中使用mp4Parser镜像视频?

时间:2014-06-27 07:41:49

标签: android mp4parser

如何使用mp4Parser创建视频的镜像值。 如果有可能矩阵的值将起作用。 请帮帮我..

1 个答案:

答案 0 :(得分: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());

但要注意并非所有玩家都支持矩阵转换。

点击此处查看how to make VideoView respect the matrix

相关问题