演示:读取一个视频,然后播放,ESC退出。

 

  1. #include "stdafx.h"  
  2. #include <opencv2/core/core.hpp>  
  3. #include <opencv2/contrib/contrib.hpp>  
  4. #include <opencv2/highgui/highgui.hpp>  
  5. #include <opencv2/imgproc/imgproc.hpp>  
  6. #include <opencv2/objdetect/objdetect.hpp>  
  7.   
     
  8. using namespace cv;  
  9. using namespace std;  
  10. #pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")   
  11. int main(int argc, char** argv[])  
  12. {  
  13.     cvNamedWindow("Example2", CV_WINDOW_AUTOSIZE);  
  14.     CvCapture* capture = cvCreateFileCapture("F:\\life\\opencv\\BuildingCordovaAppsWithVS_high.mp4");  
  15.   
     
  16.     IplImage* frame;  
  17.     while (1)  
  18.     {  
  19.         frame = cvQueryFrame(capture);  
  20.         if (!frame) break;  
  21.         cvShowImage("Example2", frame);  
  22.         char c = cvWaitKey(33);  
  23.         if (c == 27) break;  
  24.     }  
  25.   
     
  26.     cvReleaseCapture(&capture);  
  27.     cvDestroyWindow("Example2");  
  28.   
     
  29.     return 0;  
  30. }  

 

 

Open CV 播放视频(2)的更多相关文章

  1. Emgu CV播放视频

    public partial class Form1 : Form {     Capture _capture;     public Form1()     {         Initializ ...

  2. Emgu.CV 播放视频

    using Emgu.CV; using System; using System.Drawing; using System.Threading; using System.Windows.Form ...

  3. Emgu.CV 播放视频-本地文件/RTSP流

    using Emgu.CV; using System; using System.Drawing; using System.Threading; using System.Windows.Form ...

  4. OpenCV播放视频带滚动条(3)

      演示 :一个带有滚动条的播放视频的代码.   #include "stdafx.h" #include <opencv2/core/core.hpp> #inclu ...

  5. ffmpeg和opencv 播放视频文件和显示器

    ffmpeg它是基于最新版本,在官网下载http://ffmpeg.zeranoe.com/builds/.编译时VS2010配置相关头文件及库的路径就可以.opencv的搭建參考上一个博客. 首先简 ...

  6. OpenCV教程【002 VideoCapture加载并播放视频】

    #include <opencv2/opencv.hpp> #include <iostream> using namespace std; using namespace c ...

  7. VS2013 MFC opencv 播放视频

    看网上有很多人用的还是CvvImage类,但是Opencv3.0已经没有CvvImage这个类了.百度得之可以使用以前的类,稍作修改就可以了. 头文件: #pragma once #ifndef CV ...

  8. AVAssetReader+AVAssetReaderTrackOutput播放视频

    该文章引用自:http://www.jianshu.com/p/3d5ccbde0de1 IOS 微信聊天发送小视频的秘密(AVAssetReader+AVAssetReaderTrackOutput ...

  9. Android实现播放视频

    转载:http://www.bdqn.cn/news/201311/12100.shtml 使用VideoView播放视频 VideoView,用于播放一段视频媒体,它继承了SurfaceView,位 ...

随机推荐

  1. 解决svn迁移过程中出现:SVN Error: is not the same repository as的问题

    一.背景 由于公司业务的需要,新购买了一批机器,那么面临着的就是svn等一系列东西进行迁移的问题,在svn迁移以后,本地的svn代码在切换时出现了SVN Error: 旧服务器地址 is not th ...

  2. August 29th 2016 Week 36th Monday

    Every has the capital to dream. 每个人都有做梦的本钱. Your vision, our mission. That is an advertisment of UMo ...

  3. August 15th 2016 Week 34th Monday

    Why not discovering as there is glorious faraway scenery? 远方有诗篇,何不去发现? An advertisement of Land Rove ...

  4. Mysql 删除语句

    手册: 14.2.2 DELETE Syntax 单表删除语句:DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name [PARTITION (par ...

  5. CentOS出错You don't have permission to access on this server

    之前配置phpmyadmin的时候,在浏览器上输入http://192.168.8.250/phpmyadmin/ 也遇到了You don't have permission to access on ...

  6. zip 压缩文件 unzip查看zip压缩包内的内容

    [root@GitLab tmp]# zip -r new.zip ./*  adding: gitlab_key_file20161001-2668-1eu44mv (deflated 15%)  ...

  7. tornado web高级开发项目之抽屉官网的页面登陆验证、form验证、点赞、评论、文章分页处理、发送邮箱验证码、登陆验证码、注册、发布文章、上传图片

    本博文将一步步带领你实现抽屉官网的各种功能:包括登陆.注册.发送邮箱验证码.登陆验证码.页面登陆验证.发布文章.上传图片.form验证.点赞.评论.文章分页处理以及基于tornado的后端和ajax的 ...

  8. 栈与队列:refresh的停车场

    数据结构实验之队列一:排队买饭 Time Limit: 1000MS Memory limit: 65536K 题目描述 中午买饭的人特多,食堂真是太拥挤了,买个饭费劲,理工大的小孩还是很聪明的,直接 ...

  9. cmder

    添加cmder到右键菜单 Cmder.exe /REGISTER ALL 打开配置快捷键 win+alt+p 文字重叠 main->font->去掉monospace的勾 λ符号修改 找到 ...

  10. JavaScript 简介

    JavaScript是一种专为网页交互而设计的脚本语言,由下列三个不同的部分组成: ECMAScript,由ECMA-262 定义,提供核心语言功能: DOM, 提供访问和操作网页内容的方法和接口; ...