[英]Android video streaming of mp4 files with MOOV atom at the end
我已经实现了一个流式视频播放器,它可以使用VideoView和asynctask在Android中流式传输包括mp4在内的视频格式。 然而,有些视频从一开始就顺利播放,而有些视频直到完全下载才开始播放。
根据我的研究,我发现moov atom(如TOC)保存在文件末尾的mp4文件正在以这种方式运行。
我见过一个可以解决这个问题的库。
compile 'net.ypresto.qtfaststartjava:qtfaststart:0.1.0'
但是我没有得到关于如何将这个库集成到我的项目的任何参考。 请发布一些参考或片段来实现此库以解决我的问题。
File input = new File(path + "/input.mp4"); // Your input file
File output = new File(path + "/output.mp4"); // Your output file
try{
if(!output.exists()) // if there is no output file we'll create one
output.createNewFile();
}
}catch (IOException e){
Log.e("TAG", e.toString());
}
try{
QtFastStart.fastStart(input, output);
}catch (QtFastStart.MalformedFileException m){
Log.e("QT", m.toString());
}catch (QtFastStart.UnsupportedFileException q){
Log.e("QT", q.toString());
}catch (IOException i){
Log.e("QT", i.toString());
}
这就是全部
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.