2014-06-27 42 views

回答

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()); 

但要注意,並非所有玩家的支持矩陣tranformations。

看看這裏看到how to make VideoView respect the matrix

+0

首先非常感謝你爲我們提供這個偉大的圖書館。我嘗試了android的上述代碼,並在android VideoView中做了視頻預覽,看起來視頻並沒有顯示任何改變。 – Mahesh

+0

使用Matrix.ROTATE_270和Matrix.ROTATE_90進行視頻旋轉對我來說工作正常。 – Mahesh

+0

如果可以的話,請用quicktime試試。我的測試與quicktime工作(vlc沒有) –

相關問題