3 Star 12 Fork 3

天镜baobao / MP4Info

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

MP4Info

不用流媒体也可以简单实现MP4等视频的边下边播功能。


使用说明

/**
 * MP4Info 示例程序
 * @author TJbaobao
 *=====================原理说明:http://blog.csdn.net/u013640004/article/details/53573864
 *=====================MP4Info工具下载:http://shouji.baidu.com/software/10519592.html
 *=====================我的网站:www.imczm.com
 *=====================播放器正在弄,快了
 */
public class Main {
	public static void main(String[] args) {
		//============================切割视频文件开始===========================
		//构建自定义数据
		CustomData customData = new CustomData();
		customData
		.addData(CustomData.DATA_TYPE_HEAD_SIZE)//添加内置变量
		.addData("name", "test.mp4")//添加字符串
		.addData("abc", "wo ai jia zhu")
		;
		Mp4Helper mp4HelperMentation = new Mp4Helper();
		//添加进度监听器
		mp4HelperMentation.setOnProgressListener(new OnProgressListener() {
			@Override
			public void onProgress(float readed, float size) {
				System.out.println("切割进度:"+readed/size);
			}
		});
		//开始切割视频
		ArrayList<String> pathList = 
				mp4HelperMentation.segmentation("video/test.mp4", "video",customData);//视频路径、输出文件夹、自定义数据结构体
		//===========================切割视频文件结束==============================
		
		
		//===========================合并视频文件开始==============================
		Mp4Helper mp4HelperMerger = new Mp4Helper();
		//设置合并进度监听器
		mp4HelperMerger.setOnProgressListener(new OnProgressListener() {
			@Override
			public void onProgress(float readed, float size) {
				System.out.println("合并进度:"+readed/size);
			}
		});
		//传入tjbb格式头文件路径,开始读取必须信息
		Mp4Merger mp4Merger = mp4HelperMerger.mergeInfo(pathList.get(0), "video/test_merge.mp4");//tjbb格式头文件路径,合成的视频输出地址
		//获取自定义数据结构体
		CustomData customDataGet = mp4Merger.getCustomData();
		if(customDataGet!=null)
		{
			System.out.println("name:"+customDataGet.getStringValue("name"));
		}
		//添加视频文件的数据部分
		int i = 0;
		for(String path:pathList)
		{
			if(i!=0)
			{
				mp4Merger.addMDat(path);
			}
			i++;
		}
		//===========================合并视频文件结束==============================
	}
}

完整的DEMO示例,包括录像和播放一整套

VideoPlayOL 正在编写中。。。暂不开放(加班累成狗,没时间写)

The MIT License (MIT) Copyright (c) 2017 天镜baobao Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

不用流媒体也可以简单实现MP4等视频的边下边播功能。 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/tjbaobao/MP4Info.git
git@gitee.com:tjbaobao/MP4Info.git
tjbaobao
MP4Info
MP4Info
master

搜索帮助

14c37bed 8189591 565d56ea 8189591