做网站推广织梦网站怎样做防护

pingmian/2025/10/8 23:57:35/文章来源:
做网站推广,织梦网站怎样做防护,北京购物网站建设公司,精准扶贫电商网站建设计划书手头做一个视频相关项目#xff0c;但是客户发来的测试视频(avi格式) 现有组件不能解码。现有视频解码组件方案有基于JMF和opencv Jni调用。远远不能满足目前市面上玲琅满目的各种视频编码标准。进行检索 找到xuggler官方主页#xff1a;http://www.xuggle.com/xuggler 对5.…手头做一个视频相关项目但是客户发来的测试视频(avi格式) 现有组件不能解码。现有视频解码组件方案有基于JMF和opencv Jni调用。远远不能满足目前市面上玲琅满目的各种视频编码标准。进行检索 找到xuggler官方主页http://www.xuggle.com/xuggler  对5.4版本进行简单封装实现现有组件接口。需要slf4j包支持。实现了从现有组件只能支持摄像头和特定编码AVI文件到多种编码格式视频解码的支持。经过测试至少支持 flv mov avi mpg wmv mp4 mkv 这些格式的视频解码。实现代码如下package edu.zjut.framecollector;import java.awt.image.BufferedImage;import java.io.File;import javax.media.ControllerEvent;import javax.media.ControllerListener;import javax.swing.JFileChooser;import com.xuggle.xuggler.Global;import com.xuggle.xuggler.ICodec;import com.xuggle.xuggler.IContainer;import com.xuggle.xuggler.IPacket;import com.xuggle.xuggler.IPixelFormat;import com.xuggle.xuggler.IStream;import com.xuggle.xuggler.IStreamCoder;import com.xuggle.xuggler.IVideoPicture;import com.xuggle.xuggler.IVideoResampler;import com.xuggle.xuggler.Utils;/*** author 田旭园 E-mail: tianxuyuanyahoo.com.cn* version 1.0 创建时间2012-8-14 下午07:11:02* 说明 AVI视频采集 解码 可对多种格式音频视频进行解码编码 http://blog.xuggle.com/* 说明 JMF和opencv对各种视频编码格式的 不给力 学习AVIFrameCollector.java进行对xuggler简单封装使用* 说明 不需要有安装JMF 但是需要导入xuggle-xuggler-5.4.jar 和 slf4j库*/public class AVIFrameCollectorOnXuggle extends FrameCollector implementsControllerListener {private int step 1;IContainer container null;IStreamCoder videoCoder null;IPacket packet;long firstTimestampInStream Global.NO_PTS;long systemClockStartTime 0;int videoStreamId -1;String filename;IVideoResampler resampler null;Overridepublic void close() {if (videoCoder ! null) {videoCoder.close();videoCoder null;}if (container ! null) {container.close();container null;}}Overridepublic BufferedImage getCurrentFrame() {BufferedImage javaImage null;while (container.readNextPacket(packet) 0) {/** Now we have a packet, lets see if it belongs to our video stream*/if (packet.getStreamIndex() videoStreamId) {/** We allocate a new picture to get the data out of Xuggler*/IVideoPicture picture IVideoPicture.make(videoCoder.getPixelType(), videoCoder.getWidth(), videoCoder.getHeight());int offset 0;while (offset packet.getSize()) {/** Now, we decode the video, checking for any errors.*/int bytesDecoded videoCoder.decodeVideo(picture, packet,offset);if (bytesDecoded 0)throw new RuntimeException(got error decoding video in: filename);offset bytesDecoded;/** Some decoders will consume data in a packet, but will not* be able to construct a full video picture yet. Therefore* you should always check if you got a complete picture* from the decoder*/if (picture.isComplete()) {IVideoPicture newPic picture;/** If the resampler is not null, that means we didnt* get the video in BGR24 format and need to convert it* into BGR24 format.*/if (resampler ! null) {// we must resamplenewPic IVideoPicture.make(resampler.getOutputPixelFormat(),picture.getWidth(), picture.getHeight());if (resampler.resample(newPic, picture) 0)throw new RuntimeException(could not resample video from: filename);}if (newPic.getPixelType() ! IPixelFormat.Type.BGR24)throw new RuntimeException(could not decode video as BGR 24 bit data in: filename);/*** We could just display the images as quickly as we* decode them, but it turns out we can decode a lot* faster than you think.** So instead, the following code does a poor-mans* version of trying to match up the frame-rate* requested for each IVideoPicture with the system* clock time on your computer.** Remember that all Xuggler IAudioSamples and* IVideoPicture objects always give timestamps in* Microseconds, relative to the first decoded item. If* instead you used the packet timestamps, they can be* in different units depending on your IContainer, and* IStream and things can get hairy quickly.*/if (firstTimestampInStream Global.NO_PTS) {// This is our first time throughfirstTimestampInStream picture.getTimeStamp();// get the starting clock time so we can hold up// frames// until the right time.systemClockStartTime System.currentTimeMillis();} else {long systemClockCurrentTime System.currentTimeMillis();long millisecondsClockTimeSinceStartofVideo systemClockCurrentTime- systemClockStartTime;// compute how long for this frame since the first// frame in the// stream.// remember that IVideoPicture and IAudioSamples// timestamps are// always in MICROSECONDS,// so we divide by 1000 to get milliseconds.long millisecondsStreamTimeSinceStartOfVideo (picture.getTimeStamp() - firstTimestampInStream) / 1000;final long millisecondsTolerance 50; // and we// give// ourselfs// 50 ms of// tolerancefinal long millisecondsToSleep (millisecondsStreamTimeSinceStartOfVideo - (millisecondsClockTimeSinceStartofVideo millisecondsTolerance));if (millisecondsToSleep 0) {try {Thread.sleep(millisecondsToSleep);} catch (InterruptedException e) {// we might get this when the user closes// the dialog box, so// just return from the method.return null;}}}// And finally, convert the BGR24 to an Java buffered// imagejavaImage Utils.videoPictureToImage(newPic);return javaImage;}}} else {/** This packet isnt part of our video stream, so we just* silently drop it.*/do {} while (false);}}return javaImage;}Overridepublic FrameCollectorMode getMode() {return FrameCollectorMode.AVI_FILE;}/*** * 使用用户定义的连接参数打开AVI视频文件。* ** param fileURL* AVI视频文件的地址* param strStep* 指定avi文件的播放速度即每次跳帧的步进,调用时请注意给定的字符串要可以转换为整型。 1为正常速度2为两倍速度....* return true如果成功打开否则返回false* since 1.0*/Overridepublic boolean open(String fileURL, String strStep) {// fileURLfile:/F:/组件和项目/图像质量诊断工程/vedio/视频文件/亮度1.avi;// 打开AVI视频文件if (fileURL null) {return open();}if ((fileURL.substring(0, 6)).equals(file:/)) {fileURL fileURL.substring(6);// System.out.println( dfsfjasjf fileURL);}try {step Integer.parseInt(strStep);} catch (NumberFormatException ex) {step 1;}return setupPlayer(fileURL);}/*** * 通过打开对话框打开指定AVI视频文件。* ** return true如果成功打开否则返回false* since 1.0*/Overridepublic boolean open() {// 从文件对话框中选择AVI文件JFileChooser chooser new JFileChooser();chooser.setAcceptAllFileFilterUsed(false);int result chooser.showOpenDialog(null);if (result JFileChooser.CANCEL_OPTION) {return false;}File file chooser.getSelectedFile();String fileURL null;try {fileURL file.getAbsolutePath();System.out.println(fileURL);} catch (Exception e) {return false;}// 打开AVI视频文件return setupPlayer(fileURL);}Overridepublic void controllerUpdate(ControllerEvent arg0) {// TODO Auto-generated method stub}/*** * Initialize the Player object.* ** param fileURL* The selected files URL* return true if set up the player successfully, false otherwise*/private boolean setupPlayer(String filename) {this.filename filename;System.out.println(filename );// Lets make sure that we can actually convert video pixel formats.if (!IVideoResampler.isSupported(IVideoResampler.Feature.FEATURE_COLORSPACECONVERSION))throw new RuntimeException(you must install the GPL version of Xuggler (with IVideoResampler support) for this demo to work);// Create a Xuggler container objectcontainer IContainer.make();// Open up the containerif (container.open(filename, IContainer.Type.READ, null) 0)throw new IllegalArgumentException(could not open file: filename);// query how many streams the call to open foundint numStreams container.getNumStreams();// and iterate through the streams to find the first video streamfor (int i 0; i numStreams; i) {// Find the stream objectIStream stream container.getStream(i);// Get the pre-configured decoder that can decode this stream;IStreamCoder coder stream.getStreamCoder();if (coder.getCodecType() ICodec.Type.CODEC_TYPE_VIDEO) {videoStreamId i;videoCoder coder;break;}}if (videoStreamId -1)throw new RuntimeException(could not find video stream in container: filename);/** Now we have found the video stream in this file. Lets open up our* decoder so it can do work.*/if (videoCoder.open() 0)throw new RuntimeException(could not open video decoder for container: filename);if (videoCoder.getPixelType() ! IPixelFormat.Type.BGR24) {// if this stream is not in BGR24, were going to need to// convert it. The VideoResampler does that for us.resampler IVideoResampler.make(videoCoder.getWidth(), videoCoder.getHeight(), IPixelFormat.Type.BGR24, videoCoder.getWidth(), videoCoder.getHeight(), videoCoder.getPixelType());if (resampler null)throw new RuntimeException(could not create color space resampler for: filename);}/** Now, we start walking through the container looking at each packet.*/packet IPacket.make();return true;}}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/90206.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

wordpress個人網站域名母婴行业网站建设

在软件开发过程中,自动化测试是提高效率和质量的重要手段。而Selenium作为一个广泛使用的自动化测试工具,为开发者提供了强大的功能和灵活性。本文将介绍Selenium的概念,并分享一些提升自动化测试效果的关键技巧。 什么是Selenium&#xff1…

什么是专业网站整合营销传播工具有哪些

通过HTMLPaser和urlib模块对网页进行抓取并分析实现步骤:1、自定义MYHTMLParser类2、实例化类并访问天气预报官网3、抓取关键数据4、对数据进行切片处理并输出字典from html.parser import HTMLPaser #处理页面模块from urllib import request #访问网站模块L […

seo网站快速排名做外贸网站维护费是多少

左移 选中多行代码后,按下Tab键,一次缩进四个字符 右移 鼠标选中多行代码后,同时按住shiftTab键,一次左移四个字符

建设网站昌都地区做网站推广要会什么

以太网协议说明 1 以太网子层架构 1)MAC and MAC CONTROL Sublayer MAC 负责以太网数据格式中所述的以太网成帧协议以及这些帧的错误检测。MAC 独立于并可以连接到任何类型的物理层设备。这提供了 MAC 子层的实时流控制操作。 MAC CONTROL 和 MAC 子层均由内核在所有操作模式…

网站建设mingxinshwordpress 指定目录页

Debian 作为工控电脑操作系统具有稳定性、安全性、自定义性和丰富的软件包等优势,适用于要求高度可靠性和安全性的工控应用。 Debian 作为工控电脑操作系统在工业控制领域有很大优势,包括: 稳定性:Debian 的发布版以其稳定性而闻…

网站和软件建站春节网页制作素材

之前写过一篇文章:浅谈Oracle学习方法http://blog.csdn.net/tianlesoftware/article/details/5448689这里不谈Oracle,只谈学习方法。 常说师傅领进门,修行靠个人。 研究Oracle 需要靠自己的学习,需要多花时间来研究,我…

关于网页设计的网站施工企业市场经营工作思路及措施

实验说明 从2017.10.6起,开启这个系列,目标只有一个:探索新的学习方法,实现跃迁式成长实验期2年(2017.10.06 - 2019.10.06)我将以自己为实验对象。我将开源我的学习方法,方法不断更新迭代&#…

广州牌手表网站广州做网站平台的企业

题目 题目链接 分析 我们最终形成的数组一定是当前数组nums 中的一个数字。 所以我们的想法就是枚举数组 nums 中的所有数字,取最小值。 题目告诉我们每一秒都可以向左右扩散一位,那么多个相同的 x 同时扩散,扩散完整个数组耗时就取决于两…

做境外旅游的网站网站建设如何

相信不少小伙伴面试时,都被问到过这样一个问题:进程和线程的区别是什么?大学老师会告诉我们:进程是资源分配的基本单位,线程是调度的基本单位。说到调度,就不得不提到CPU的上下文切换了。 何为CPU上下文切换…

西安代做毕业设计网站网络营销方案ppt模板

文章引用自 薛先生 ,版权完全归属薛先生。其公众号:Alphatree and Evelyn2018-12-12思考出发点:那个多数人印象中乱碰乱撞、还拖着脏污满屋跑的添乱扫地机,还需要多久才能变聪明?扫地机器人的本质到底是什么? 该用家电…

上海网站策划天河做网站系统

VS2008中V表结束标记的分析 在逆向C目标时,我们有时候可能会关注一个V表中到底有多少个虚函数。 这种细节大概多半是与编译器实现相关。 为了弄清楚这个问题,我在VS2008下写了一个简单的测试程序来探求这个问题的答案。 下面是C的测试程序源码&#xff1…

网站前端设计培训关于网站开发的网站

在 Windows 操作系统中,原生提供了强大的网络编程支持,允许开发者使用 Socket API 进行网络通信,通过 Socket API,开发者可以创建、连接、发送和接收数据,实现网络通信。本文将深入探讨如何通过调用原生网络 API 实现同…

永顺县建设局网站wordpress水印图片插件

form表单中使用频繁的组件: 文本框、单选框、多选框、下拉框、文本域form通过getValues()获取表单中所有name的值 通过setValues({key:values})给对应的name值进行赋值,其中key对应的name值 在给单选框和多选框赋值时,有几个疑惑的地方:  …

无需注册免费创建网站如何制作一个单页网站

对电容充电的过程中,电容器充电的电压为,求电容器的充电速度。

宁波做网站农村电商平台发展现状

很多教程会提到加上-static是静态编译,但对于新手来说没有用例子来说明可能不太好理解,今天我就介绍一下关于这方面知识的一个例子: 最近在做一个关于freetype字体的东西,需要依赖freetype官方提供的库,我已经把电脑这…

建设网站的主要流程有哪些域名反查网站

服务器的维护是如何操作 服务器可以说是不可或缺的资源,因为现在网络技术发达,我们的生活也都离不开网络的存在,我们想要获取的业务、资料等大多是通过网络进行,所以想要顺应潮流并获得发展,肯定需要服务器来将企业的相…

使用c#语言建设网站优点学网站开发好不好

文章目录 一、题目二、C# 题解 一、题目 给你两个字符串 haystack 和 needle ,请你在 haystack 字符串中找出 needle 字符串的第一个匹配项的下标(下标从 0 开始)。如果 needle 不是 haystack 的一部分,则返回 -1 。 点击此处跳转…

微信开发小程序开发网站建设项目名称

原文网址:Docker--network命令的用法_IT利刃出鞘的博客-CSDN博客 简介 说明 本文介绍Docker的network网络命令的用法。 官网网址 docker network | Docker Documentation 命令概述 所有命令 命令名称 说明 docker network connect 将容器连接到网络 dock…

你愿意做我女朋友吗表白网站北京4网站建设

前言:很多时候我们需要在运行时,动态地改变控件的位置以及大小,以获得更好的布局。比如说实际项目中的可自定义的报表、可自定义的单据等诸如此类。它们有个特点就是允许客户或者二次开发人员设计它们需要的界面设置功能。本人以前也做过可自…

仿起点小说网站开发怎么建设手机小说网站

BAT批处理一键生成APK包脚本分享将本bat放到cocos2dx目录下你的工程的project.android下(需修改变量)。ASmaker 用来将Resources文件夹下的lua文件批量加密 算法参考我之前的rc4算法实现。每次打包apk前 svn 最新的工程代码 和 cocos2dx引擎代码。echo offrem 工具路径set JAVA…