2017-04-20 211 views
1

我使用GoPro - Quik手動將標籤添加到mp4視頻中。如何在Android或Java的mp4視頻中獲取GoPro HiLight標籤

根據Chriki answer on superuserGoProInfo.cpp 高亮標籤存儲在框中鍵入HMMT在MP4視頻的毫秒。

Path = `moov\udta\HMMT` 

但我沒有發現使用sannies/mp4parser代碼

InputStream in = new BufferedInputStream(urlConnection.getInputStream()); 

    ReadableByteChannel chanel = Channels.newChannel(in); 

我繼續我的[R & d和結果得到了這個代碼

IsoFile isoFile = new IsoFile(chanel); 
       MovieBox movieBox = isoFile.getMovieBox(); 
       List<UserDataBox> userDataBoxes = movieBox.getBoxes(UserDataBox.class); 

       stringBuilder.append("moov>UserBoxes:\n"); 
       for (int i = 0; i < userDataBoxes.size(); i++) { 
        stringBuilder.append(userDataBoxes.get(i)); 
        stringBuilder.append("\n"); 
        UserDataBox erDataBox = userDataBoxes.get(i); 
        for (int i1 = 0; i1 < erDataBox.getBoxes().size(); i1++) { 
         stringBuilder.append(erDataBox.getBoxes().get(i)); 
         stringBuilder.append("\n"); 
        } 
        stringBuilder.append("\n"); 
        stringBuilder.append("\n"); 
       } 

輸出任何標記毫秒:

moov>UserBoxes: 
UserDataBox[MetaBox[HandlerBox[handlerType=mdir;name=��];AppleItemListBox[[email protected]]]] 
    MetaBox[HandlerBox[handlerType=mdir;name=��];AppleItemListBox[[email protected]]] 

更新:我得到HMMTisoviewer。 它使用下列庫

<dependency> 
      <groupId>com.googlecode.mp4parser</groupId> 
      <artifactId>isoparser</artifactId> 
      <version>1.1.14</version> 
     </dependency> 

問題仍然沒有得到解決的原因 com.googlecode.mp4parser IsoFile類沒有構造函數用於從遠程流檢索數據ReadableByteChannel

enter image description here

與庫中的真正問題是sannies/mp4parserUserDataBox沒有回報UnknownBoxgooglecode/mp4parser確實只有與影片網址sannies/mp4parser工作庫。需要修復或任何解決方法。

任何解決方案。謝謝

回答

0

Quik軟件問題,它不會像我期待的那樣在文件內保存標籤。它可以針對媒體唯一ID保存標籤。您必須從使用GoPro Camera創建的mp4視頻中讀取標籤。

從MP4的URL代碼片斷獲取

InputStream inputStream = new BufferedInputStream(new URL("http://localhost:6582?BRIDGE&%2FGOPR0175.MP4&GOPR0175.MP4&80898399").openConnection().getInputStream()); 
GoProTagsBox tags = GoProUtil.getHilights(inputStream); 

stringBuilder.append("Count: "+tags.getCount()); 
if(tags.getHiLights() != null){ 
    for (long l : tags.getHiLights()) { 
     stringBuilder.append("\nHiLight: "+l); 
    } 
} 

從GoPro的mp4文件的代碼片斷獲取

GoProTagsBox tags = GoProUtil.getHilights(new RandomAccessFile(Environment.getExternalStorageDirectory().getAbsolutePath() + "/GOPR0175.MP4", "r")); 

在這兩種情況下正常工作。

使用https://github.com/Qamar4P/JaadAndroid Android版jaad

相關問題