java mp4parser获取GPS位置
亲爱的大家:,
我正在做一个新项目,需要从MP4视频中获取GPS位置。下面是我尝试过的代码,但是得到了空指针异常
File videoFile = new File(videoFilePath);
if (!videoFile.exists()) {
throw new FileNotFoundException("File " + videoFilePath + " not exists");
}
if (!videoFile.canRead()) {
throw new IllegalStateException("No read permissions to file " + videoFilePath);
}
IsoFile isoFile = new IsoFile(videoFilePath);
AppleNameBox nam = Path.getPath(isoFile, "/moov[0]/udta[0]/meta[0]/ilst/©xyz");
String xml = nam.getValue();
谢谢,
Om
# 1 楼答案
这个代码对我有用。当没有位置标签时,它会给出NPE