- 浏览: 163107 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
兰斯洛特1987:
顶!!!!谢谢分享.最近我也在研究这玩意...
Java语言的Hook实现 -
pu02203:
我把Confidant.jar, 丢进去eclipse, 里面 ...
重磅推出诛仙辅助软件第二波:Java版按键精灵 -
泣血端午:
Calculagraph 这是哪个类啊?
A星算法 -
haitaohehe:
我使用的是jstl1.0 可是在使用<c:set va ...
JSTL1.0和JSTL1.1的区别 -
micheal19840929:
学习楼主,我也测试一下~看看兼容性吧。lanlanzhilia ...
手机版飞鸽传书:无线牵
因为最近不会在m3g文件上继续工作,把之前一点少少的工作放出来,希望可以有点帮助
/* * Main.java * * Created on 2005年5月15日, 下午11:41 */ package m3gloader; import java.io.*; import java.util.zip.*; /** * * @author admin */ public class Main { /** Creates a new instance of Main */ public Main() { } /** * @param args the command line arguments */ public static void main(String[] args) throws Exception { File f=new File("otokka_jump2.m3g"); System.out.println("\nFile \""+f.toString()+"\" exists? : "+f.exists()); if(!f.exists()) err("File "+f.toString()+" does not exists!"); FileInputStream fis=new FileInputStream(f); M3GDataInputStream dis=new M3GDataInputStream(fis); System.out.println("====== File identifier ======"); byte[] fileIdentifier=new byte[12]; if(dis.available()>=12){ dis.read(fileIdentifier); System.out.println("File Identifier is: "); for(int l=0;l<fileIdentifier.length;l++) System.out.print(fileIdentifier[l]+" "); System.out.print("\nFile Identifier characters is: \n"); System.out.println(new String(fileIdentifier)); System.out.println("====== end of file identifier ======\n"); } else err("File Identifier Error! "); /* Section 0: Header Object */ System.out.println("====== Section 0: Header Object ======"); if(dis.available()<5) err("Section 0: Header error! "); System.out.println("CompressionScheme: "+dis.readByte()); UInt32 totalSectionLength=dis.readUInt32(); //We have read 5 bytes.So we just check if (totalSectionLength.longvalue()-5) is available. if(dis.available()<totalSectionLength.longvalue()-5) err("Section 0: Content error! "); System.out.println("TotalSectionLength: "+totalSectionLength); System.out.println("UncompressedLength: "+dis.readUInt32()); System.out.println("$$$$$$ Objects $$$$$$"); System.out.println("ObjectType: "+dis.readByte()); //length1 is the length of 1st object we load, length2 is the 2nd. UInt32 length1=dis.readUInt32(); System.out.println("Length: "+length1); System.out.print("VersionNumber: "); System.out.print(dis.readByte()+"."); System.out.println(dis.readByte()); System.out.println("hasExternalReferences: "+dis.readBoolean()); System.out.println("TotalFileSize: "+dis.readUInt32()); System.out.println("ApproximateContentSize: "+dis.readUInt32()); /* Head Object contain: Byte[2] VersionNumber Boolean hasExternalReferences UInt32 TotalFileSize UInt32 ApproximateContentSize String AuthoringField So AuthoringField's length is object (length-11) */ byte[] authoringField=new byte[length1.intvalue()-11]; dis.readFully(authoringField); System.out.println("------ AuthoringField ------"); System.out.println(new String(authoringField,"UTF-8")); System.out.println("------ End of AuthoringField ------"); System.out.println("$$$$$$ End of Objects $$$$$$"); System.out.println("Checksum: "+dis.readUInt32()); System.out.println("====== End of Section 0: Header Object ======\n"); //new section System.out.println(dis.readByte()); System.out.println(dis.readUInt32()); System.out.println(dis.readUInt32()); M3GInflaterInputStream iis=new M3GInflaterInputStream(fis); System.out.println(iis.read()); System.out.println(iis.readUInt32()); /////////////////////a camera //user id System.out.println(iis.readUInt32()); //animation track System.out.println(iis.readUInt32()); //user para System.out.println(iis.readUInt32()); //hasComponentTransform; System.out.println(iis.read()); //hasGeneralTransform; System.out.println(iis.read()); //enable rendering System.out.println(iis.read()); // enablePicking; System.out.println(iis.read()); // alphaFactor; System.out.println(iis.read()); //scope; System.out.println(iis.readUInt32()); //hasAlignment; System.out.println(iis.read()); //h System.out.println(iis.read()); System.out.println(iis.readUInt32()); System.out.println(iis.readUInt32()); System.out.println(iis.readUInt32()); System.out.println(iis.readUInt32()); /////////////next object///////////////////// //image 2d System.out.println(iis.read()); System.out.println(iis.readUInt32()); //user id System.out.println(iis.readUInt32()); //animation tracks System.out.println(iis.readUInt32()); //user object System.out.println(iis.readUInt32()); //format System.out.println(iis.read()); //is mutable System.out.println(iis.read()); //width System.out.println(iis.readUInt32()); //height System.out.println(iis.readUInt32()); // palette; System.out.println(iis.read()); //pixels; System.out.println(iis.read()); /* for(int l=0;l<4894;l++) iis.read(); System.out.println(iis.read()); System.out.println(iis.readUInt32()); for(int l=0;l<40;l++) iis.read(); System.out.println(iis.read()); System.out.println(iis.readUInt32()); for(int l=0;l<66;l++) iis.read(); System.out.println(iis.read()); System.out.println(iis.readUInt32()); for(int l=0;l<66;l++) iis.read(); System.out.println(iis.read()); System.out.println(iis.readUInt32()); for(int l=0;l<66;l++) iis.read(); System.out.println(iis.read()); System.out.println(iis.readUInt32()); for(int l=0;l<41;l++) iis.read(); System.out.println(iis.read()); System.out.println(iis.readUInt32()); for(int l=0;l<29;l++) iis.read(); System.out.println(iis.read()); System.out.println(iis.readUInt32()); for(int l=0;l<25;l++) iis.read(); System.out.println(iis.read()); System.out.println(iis.readUInt32()); for(int l=0;l<68;l++) iis.read(); System.out.println(iis.read()); System.out.println(iis.readUInt32()); */ dis.close(); fis.close(); } public static void err(String msg){ System.out.println("\n**** An error has occured!!! The program was terminated!!! The errot infomation is: "); System.out.println(msg+"\n"); System.exit(0); } static class M3GDataInputStream extends DataInputStream{ public M3GDataInputStream(InputStream in){ super(in); } public UInt32 readUInt32() throws IOException { int ch1 = in.read(); int ch2 = in.read(); int ch3 = in.read(); long ch4 = in.read(); //System.out.println(ch1+" "+ch2+" "+ch3+" "+ch4); if ((ch1 | ch2 | ch3 | ch4) < 0) throw new EOFException(); return new UInt32((ch1 << 0) + (ch2 << 8) + (ch3 << 16) + (ch4 << 24)); } } static class M3GInflaterInputStream extends InflaterInputStream{ public M3GInflaterInputStream(InputStream in){ super(in,new Inflater(),32); } public UInt32 readUInt32() throws IOException { int ch1 = super.read(); int ch2 = super.read(); int ch3 = super.read(); long ch4 = super.read(); //System.out.println(ch1+" "+ch2+" "+ch3+" "+ch4); if ((ch1 | ch2 | ch3 | ch4) < 0) throw new EOFException(); return new UInt32((ch1 << 0) + (ch2 << 8) + (ch3 << 16) + (ch4 << 24)); } } static class Float32{ } static class UInt32{ private long value; public UInt32(long value){ this.value=value; Integer f=new Integer(2); } public long longvalue(){ return value; } public int intvalue(){ if(value > 2147483647 && value < -2147483648) throw new ClassCastException(); return (int)value; } public String toString(){ return Long.toString(value); } } }
发表评论
-
J2ME的RMS
2010-04-10 23:32 2465在JAVAME中,程 ... -
M3G游戏中性能提升技巧
2010-03-28 17:59 702JSR184 M3G(Mobile 3D Grap ... -
在J2ME开发中获取系统属性
2010-03-27 18:21 488在J2ME开发中,我们经常需要和手机系统进行交互,获得一些和系 ... -
导出M3G文件指南
2010-03-25 12:54 919概述: 这 ... -
J2ME中使用microlog
2010-03-22 22:17 1374import javax.microedition.mi ... -
M3G教程:进阶篇(六)动画
2010-03-21 21:33 1271M3G中动画的数据结构如下: 【载入W ... -
3DS MAX导出M3G动画
2010-03-21 10:11 19501、用3D Studio Max或者Maya的插件h3texp ... -
M3G教程:进阶篇(四)模型
2010-03-21 01:18 1016import javax.microedition.lc ... -
M3G教程:进阶篇(三)纹理
2010-03-21 01:18 985纹理(Texture) java.lang.Objec ... -
M3G教程:进阶篇(二)灯光
2010-03-21 01:16 1624灯光(Lighting) java.lang.Obje ... -
M3G教程:进阶篇(一)金字塔
2010-03-21 01:15 1170关于World public class World ... -
M3G教程:入门篇
2010-03-21 01:14 16013D技术对我们来 ... -
J2ME 3d之3DMAX制作M3G错误二例
2010-02-11 09:35 0(1) 在制作J2ME 3D所需的M3G时出现导出 ... -
M3G教程:进阶篇(五)立即模式
2010-02-09 23:51 0保留模式和立即模式渲染 保留模式是当你使用一个世界它含有的全 ... -
KVM的类加载
2010-02-09 15:46 787首先简要介绍一下class文件的结构(详细内容请参考Java虚 ... -
手机版飞鸽传书:无线牵
2010-01-30 21:02 2874【中文名】无线 ... -
FileConnection简介(JSR-75)
2010-01-29 01:17 8611 引言 本文档 ... -
J2ME添加自定义图标
2010-01-23 23:52 1331与图标有关的是这两行: MIDlet-Icon: ... -
j2me签名相关注意事项
2010-01-23 23:45 1992我们得到一个证书后就可以对j2me的jad文件进行签名。这 ... -
JAD中文名字解决方法
2010-01-12 16:44 798最近正好在弄JAD,碰到中文无法显示的问题,之前就碰到过,但没 ...
相关推荐
第二部分是对获取到的m3u文件进行解析,Android中并没有提供现成的方法来解析m3u文件;第三部分是显示解析结果,并利用MediaPlayer来播放列表。 在访问网络上的m3u文件时,我们需要使用HttpConnect类来封装网络访问...
用python对m3u8格式视频解析
m3u8解析源码加速p2p视频解析,m3u8解析源码加速
《宝箧印塔模型设计与实现——基于Java M3G技术》 在移动设备领域,尤其是在支持Java 2 Micro Edition(J2ME)的手机上,实现三维图形渲染是一项技术挑战。本文将深入探讨如何利用Java M3G(Mobile 3D Graphics)...
在“Mobile3DGraphicsAPI”这个压缩包文件中,通常会包含M3G API的详细说明文档、示例代码、参考手册和可能的开发工具,这些资源可以帮助开发者更深入地理解和使用M3G API。通过阅读这些文档,开发者可以逐步学习并...
安装教程 将ckplayer文件夹全部上传至网站空间根目录即可 接口测试:http://你的域名/ckplayer/m3u8.php?url= 播放地址要有效才能解析,失效的地址无法解析 可自行整合到其他程序中!
Java 将 M3U8 格式转成视频文件的方法 Java 是当前最流行的编程语言之一,广泛应用于 Android 和 Web 开发中。在视频处理方面,Java 也提供了强大的支持。M3U8 是一种广泛使用的视频流格式,经常用于直播和点播等...
使用方法:将 ts所有分段文件、m3u8文件和本程序放于同一目录下,m3u8文件名必须是local.m3u8,然后运行程序即可得到完整的ts文件index.ts 注意事项:1. 如果出现莫名其妙的错误,则可能是文件路径有中文,改为英文...
输入m3u8地址,解析m3u8内容,进行下载并合并成为MP4文件
增加redis缓存+cache文件缓存(极速响应)注释:MP4格式的直接redis缓存.m3u8直接进行cache文件缓存 根据API解析的类型进行自动分类缓存 根据平台规则缓存 调用方法:http://你的域名/auto.php?url= 自备解析json...
Fmpeg 是领先的多媒体框架,能够解码、编码、转码、混合、解密、流媒体、过滤和播放人类和机器创造的几乎所有东西 支持mov mp4 wma avi flv互相转换 支持ts合并为avi ...m3u8自动下载带key合并为ts教程在资源内
使用MediaPlayer 播放m3u8音频文件
m3u8解析下载的工具,从视频网站找到一个m3u8lian'jie
python爬虫相关: 由于很多网站上的视频只提供在线观看,...利用requests获取网页源代码中的m3u8链接,对链接进行逐步解析,获取ts列表,下载所有ts文件,将其合并生成mp4文件。做到对视频的爬取。 同名博文相关代码。
M3 Import Script,3ds Max 的M3模型导入
《M3GToolkit-0.5.0:深入解析M3G文件检查工具》 M3GToolkit-0.5.0是一款专为J2ME(Java 2 Micro Edition)开发者设计的实用工具,用于检查和分析M3G(Mobile 3D Graphics)文件。在移动设备上的3D图形开发中,M3G...
【M3G 快速模式编程】:M3G,全称Mobile 3D Graphics API,是基于JSR 184规范定义的一种为移动设备提供标准3D图形功能的API。它分为快速模式和保留模式。快速模式专注于单个3D对象的渲染,适合进行低级别的3D操作,...
在IT领域,M3U(M3U8)文件是一种常用的音频和视频播放列表格式,由用户或应用程序创建,用于指示媒体播放器按顺序播放一系列的媒体文件。这些文件通常包含有指向媒体文件URL的简单文本列表。在这个场景中,我们将...
《Mobile 3D Graphics with OpenGL ES and M3G》是一本深入探讨移动设备上3D图形编程的专业书籍,主要关注于OpenGL ES和M3G这两个技术。OpenGL ES(OpenGL for Embedded Systems)是OpenGL的轻量级版本,专为嵌入式...
HD-1、HD-2、HD-3、M3x4+6_L、M3x4+6_N、M3x4_L、M3x4_N、M3x5+6_L、M3x5+6_N、M3x5_L、M3x5_N、M3x6+6_L、M3x6+6_N、M3x6_L、M3x6_N、M3x7+6_L、M3x8+6_N、M3x12+6_N、M3x15_N、M3x16+6_L、M3x21+6_N、M3x21+6_N、...