继续看雷霄骅的 课程资料 - 基于FFmpeg+SDL的视频播放器的制作
最后一篇,主要是想学一下 MFC 创建和配置。

一、创建 MFC 工程

文件->新建->项目->Visual C++ ->MFC 应用程序



应用程序类型,选择基于对话框


生成效果如下:


二、设置控件

找到“工具箱”,就可以将相应的控件拖拽至应用程序对话框中


常用控件有: Button, Edit Control, Static Text等。


右键找到“属性”选项卡



可以在“ Caption”属性上修改控件上的文字
可以在“ ID” 属性上修改控件上的ID( ID是控件的标识,不可重复)

播放    IDC_PLAY
暂停    IDC_PAUSE
停止    IDC_STOP
关于    IDC_ABORT
文件路径    IDC_STATIC
示例编辑框    IDC_URL
文件...    IDC_FILEDIALOG


修改效果如下:


三、添加消息响应函数

双击 Button 控件,就可以给该控件添加消息响应函数。

或者在菜单栏的“项目->类向导”处,可以添加更多种类的消息响应函数。

查看资源视图窗口

视图->其他窗口->资源视图窗口


MFC最简单的弹出消息框的函数是AfxMessageBo("HelloWorld");

双击 播放 按钮,写入最简单函数

调试出现错误,“AfxMessageBox”: 2 个重载中没有一个可以转换所有参数类型
  1. 1>------ 已启动生成: 项目: MFC, 配置: Debug Win32 ------
  2. 1>MFCDlg.cpp
  3. 1>d:\zslfchenjuke\work2017\mfc\mfc\mfc\mfcdlg.cpp(161): error C2665: AfxMessageBox”: 2 个重载中没有一个可以转换所有参数类型
  4. 1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.10.25017\atlmfc\include\afxwin.h(6544): note: 可能是“int AfxMessageBox(UINT,UINT,UINT)”
  5. 1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.10.25017\atlmfc\include\afxwin.h(6542): note: int AfxMessageBox(LPCTSTR,UINT,UINT)”
  6. 1>d:\zslfchenjuke\work2017\mfc\mfc\mfc\mfcdlg.cpp(161): note: 尝试匹配参数列表“(const char [12])”时
  7. 1>已完成生成项目“MFC.vcxproj”的操作 - 失败。
  8. ========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 ==========

解决方法:

将其改为 AfxMessageBox(_T("Hello world"));

点击“播放”按钮,效果如下:

四、FFmpeg解码器与MFC的整合

拷贝 SDL 开发文件

头文件( *.h)拷贝至项目文件夹的include子文件夹下
导入库文件( *.lib)拷贝至项目文件夹的lib子文件夹下 (不再配置 SDL2main.lib)
动态库文件( *.dll) 拷贝至项目文件夹下

点击右键,选择在资源管理器中打开文件夹,进入项目目录。
(注意,如果手动进入注意文件夹位置,我就是没找好位置,试了半天最后才发现,将上面的这些文件拷贝到错误的文件夹下了)


配置开发文件

打开属性面板
解决方案资源管理器->右键单击项目->属性


导入库配置

配置属性->链接器->常规->附加库目录,输入“ lib” (刚才拷贝库文件的目录)


配置属性->链接器->输入->附加依赖项,输入“ SDL2.lib;avcodec.lib;avformat.lib;avutil.lib;avdevice.lib;avfilter.lib;postproc.lib;swresample.lib;swscale.lib;”(导入库的文件名)  (注意不再配置 SDL2main.lib)

测试

双击“文件”按钮,添加相关头文件和代码
  1. extern "C"
  2. {
  3. #include "libavcodec/avcodec.h"
  4. };
  1. void CMFCDlg::OnBnClickedFiledialog()
  2. {
  3. // TODO: 在此添加控件通知处理程序代码
  4. CString str2;
  5. str2.Format(_T("%s"),avcodec_configuration());
  6. AfxMessageBox((str2));
  7. }

调试结果如下,有信息但是乱码。说明配置是没问题的。但是上面的程序可能是有问题的。

具体不清楚了,稍后再研究。


五、源码分析

  1. // MFCDlg.cpp : 实现文件
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "MFC.h"
  6. #include "MFCDlg.h"
  7. #include "afxdialogex.h"
  8. #include <stdio.h>
  9. #define __STDC_CONSTANT_MACROS
  10.  
  11. //FFmepg+SDL 相关头文件
  12. #ifdef _WIN32
  13. //Windows
  14. extern "C"
  15. {
  16. #include "libavcodec/avcodec.h"
  17. #include "libavformat/avformat.h"
  18. #include "libswscale/swscale.h"
  19. #include "SDL2/SDL.h"
  20. };
  21. #else
  22. //Linux...
  23. #ifdef __cplusplus
  24. extern "C"
  25. {
  26. #endif
  27. #include <libavcodec/avcodec.h>
  28. #include <libavformat/avformat.h>
  29. #include <libswscale/swscale.h>
  30. #include <SDL2/SDL.h>
  31. #ifdef __cplusplus
  32. };
  33. #endif
  34. #endif
  35.  
  36. #ifdef _DEBUG
  37. #define new DEBUG_NEW
  38. #endif
  39.  
  40. // 用于应用程序“关于”菜单项的 CAboutDlg 对话框
  41.  
  42. class CAboutDlg : public CDialogEx
  43. {
  44. public:
  45. CAboutDlg();
  46.  
  47. // 对话框数据
  48. #ifdef AFX_DESIGN_TIME
  49. enum { IDD = IDD_ABOUTBOX };
  50. #endif
  51.  
  52. protected:
  53. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
  54.  
  55. // 实现
  56. protected:
  57. DECLARE_MESSAGE_MAP()
  58. };
  59.  
  60. CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX)
  61. {
  62. }
  63.  
  64. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  65. {
  66. CDialogEx::DoDataExchange(pDX);
  67. }
  68.  
  69. BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
  70. END_MESSAGE_MAP()
  71.  
  72. // CMFCDlg 对话框
  73.  
  74. CMFCDlg::CMFCDlg(CWnd* pParent /*=NULL*/)
  75. : CDialogEx(IDD_MFC_DIALOG, pParent)
  76. {
  77. m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  78. }
  79.  
  80. void CMFCDlg::DoDataExchange(CDataExchange* pDX)
  81. {
  82. CDialogEx::DoDataExchange(pDX);
  83. DDX_Control(pDX, IDC_URL, m_url); //xlh
  84. }
  85.  
  86. BEGIN_MESSAGE_MAP(CMFCDlg, CDialogEx)
  87. ON_WM_SYSCOMMAND()
  88. ON_WM_PAINT()
  89. ON_WM_QUERYDRAGICON()
  90.  
  91. ON_BN_CLICKED(IDC_PLAY, &CMFCDlg::OnBnClickedPlay)
  92. ON_BN_CLICKED(IDC_ABORT, &CMFCDlg::OnBnClickedAbort)
  93. ON_BN_CLICKED(IDC_FILEDIALOG, &CMFCDlg::OnBnClickedFiledialog)
  94. ON_EN_CHANGE(IDC_URL, &CMFCDlg::OnEnChangeUrl)
  95. ON_BN_CLICKED(IDC_PAUSE, &CMFCDlg::OnBnClickedPause)
  96. ON_BN_CLICKED(IDC_STOP, &CMFCDlg::OnBnClickedStop)
  97. ON_STN_CLICKED(IDC_SCREEN, &CMFCDlg::OnStnClickedScreen)
  98. END_MESSAGE_MAP()
  99.  
  100. // CMFCDlg 消息处理程序
  101.  
  102. BOOL CMFCDlg::OnInitDialog()
  103. {
  104. CDialogEx::OnInitDialog();
  105.  
  106. // 将“关于...”菜单项添加到系统菜单中。
  107.  
  108. // IDM_ABOUTBOX 必须在系统命令范围内。
  109. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
  110. ASSERT(IDM_ABOUTBOX < 0xF000);
  111.  
  112. CMenu* pSysMenu = GetSystemMenu(FALSE);
  113. if (pSysMenu != NULL)
  114. {
  115. BOOL bNameValid;
  116. CString strAboutMenu;
  117. bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
  118. ASSERT(bNameValid);
  119. if (!strAboutMenu.IsEmpty())
  120. {
  121. pSysMenu->AppendMenu(MF_SEPARATOR);
  122. pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
  123. }
  124. }
  125.  
  126. // 设置此对话框的图标。 当应用程序主窗口不是对话框时,框架将自动
  127. // 执行此操作
  128. SetIcon(m_hIcon, TRUE); // 设置大图标
  129. SetIcon(m_hIcon, FALSE); // 设置小图标
  130.  
  131. // TODO: 在此添加额外的初始化代码
  132.  
  133. return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
  134. }
  135.  
  136. void CMFCDlg::OnSysCommand(UINT nID, LPARAM lParam)
  137. {
  138. if ((nID & 0xFFF0) == IDM_ABOUTBOX)
  139. {
  140. CAboutDlg dlgAbout;
  141. dlgAbout.DoModal();
  142. }
  143. else
  144. {
  145. CDialogEx::OnSysCommand(nID, lParam);
  146. }
  147. }
  148.  
  149. // 如果向对话框添加最小化按钮,则需要下面的代码
  150. // 来绘制该图标。 对于使用文档/视图模型的 MFC 应用程序,
  151. // 这将由框架自动完成。
  152.  
  153. void CMFCDlg::OnPaint()
  154. {
  155. if (IsIconic())
  156. {
  157. CPaintDC dc(this); // 用于绘制的设备上下文
  158.  
  159. SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
  160.  
  161. // 使图标在工作区矩形中居中
  162. int cxIcon = GetSystemMetrics(SM_CXICON);
  163. int cyIcon = GetSystemMetrics(SM_CYICON);
  164. CRect rect;
  165. GetClientRect(&rect);
  166. int x = (rect.Width() - cxIcon + 1) / 2;
  167. int y = (rect.Height() - cyIcon + 1) / 2;
  168.  
  169. // 绘制图标
  170. dc.DrawIcon(x, y, m_hIcon);
  171. }
  172. else
  173. {
  174. CDialogEx::OnPaint();
  175. }
  176. }
  177.  
  178. //当用户拖动最小化窗口时系统调用此函数取得光标
  179. //显示。
  180. HCURSOR CMFCDlg::OnQueryDragIcon()
  181. {
  182. return static_cast<HCURSOR>(m_hIcon);
  183. }
  184.  
  185. //FFmpeg+SDL 相关代码
  186.  
  187. //Refresh Event
  188. #define SFM_REFRESH_EVENT (SDL_USEREVENT + 1)
  189.  
  190. #define SFM_BREAK_EVENT (SDL_USEREVENT + 2)
  191.  
  192. int thread_exit = 0;
  193. int thread_pause = 0;
  194.  
  195. int sfp_refresh_thread(void *opaque) {
  196.  
  197. thread_exit = 0;
  198. thread_pause = 0;
  199.  
  200. while (thread_exit == 0) {
  201. if (!thread_pause) {
  202. SDL_Event event;
  203. event.type = SFM_REFRESH_EVENT;
  204. SDL_PushEvent(&event);
  205. }
  206. SDL_Delay(40);
  207. }
  208. //Quit
  209. SDL_Event event;
  210. event.type = SFM_BREAK_EVENT;
  211. SDL_PushEvent(&event);
  212. thread_exit = 0;
  213. thread_pause = 0;
  214. return 0;
  215. }
  216.  
  217. //main 函数改为 ffmpegplayer
  218. int ffmpegplayer(LPVOID lpParam)
  219. {
  220.  
  221. AVFormatContext *pFormatCtx;
  222. int i, videoindex;
  223. AVCodecContext *pCodecCtx;
  224. AVCodec *pCodec;
  225. AVFrame *pFrame, *pFrameYUV;
  226. uint8_t *out_buffer;
  227. AVPacket *packet;
  228. int ret, got_picture;
  229.  
  230. //------------SDL----------------
  231. int screen_w, screen_h;
  232. SDL_Window *screen;
  233. SDL_Renderer* sdlRenderer;
  234. SDL_Texture* sdlTexture;
  235. SDL_Rect sdlRect;
  236. SDL_Thread *video_tid;
  237. SDL_Event event;
  238.  
  239. struct SwsContext *img_convert_ctx;
  240.  
  241. //===========================================
  242. //文件路径改为如下:
  243. CMFCDlg *dlg = (CMFCDlg *)lpParam;
  244. char filepath[250] = { 0 };
  245. GetWindowTextA(dlg->m_url, (LPSTR)filepath, 250);
  246. //===========================================
  247.  
  248. av_register_all();
  249. avformat_network_init();
  250. pFormatCtx = avformat_alloc_context();
  251.  
  252. if (avformat_open_input(&pFormatCtx, filepath, NULL, NULL) != 0) {
  253. AfxMessageBox(_T("Couldn't open input stream.\n"));
  254. return -1;
  255. }
  256. if (avformat_find_stream_info(pFormatCtx, NULL)<0) {
  257. AfxMessageBox(_T("Couldn't find stream information.\n"));
  258. return -1;
  259. }
  260. videoindex = -1;
  261. for (i = 0; i<pFormatCtx->nb_streams; i++)
  262. if (pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
  263. videoindex = i;
  264. break;
  265. }
  266. if (videoindex == -1) {
  267. AfxMessageBox(_T("Didn't find a video stream.\n"));
  268. return -1;
  269. }
  270. pCodecCtx = pFormatCtx->streams[videoindex]->codec;
  271. pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
  272. if (pCodec == NULL) {
  273. AfxMessageBox(_T("Codec not found.\n"));
  274. return -1;
  275. }
  276. if (avcodec_open2(pCodecCtx, pCodec, NULL)<0) {
  277. AfxMessageBox(_T("Could not open codec.\n"));
  278. return -1;
  279. }
  280. pFrame = av_frame_alloc();
  281. pFrameYUV = av_frame_alloc();
  282. out_buffer = (uint8_t *)av_malloc(avpicture_get_size(PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height));
  283. avpicture_fill((AVPicture *)pFrameYUV, out_buffer, PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height);
  284.  
  285. img_convert_ctx = sws_getContext(pCodecCtx->width, pCodecCtx->height, pCodecCtx->pix_fmt,
  286. pCodecCtx->width, pCodecCtx->height, PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL);
  287.  
  288. if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER)) {
  289. AfxMessageBox(_T("Could not initialize SDL\n"));
  290. return -1;
  291. }
  292. //SDL 2.0 Support for multiple windows
  293. screen_w = pCodecCtx->width;
  294. screen_h = pCodecCtx->height;
  295.  
  296. //显示在弹出窗口
  297. //screen = SDL_CreateWindow("Simplest ffmpeg player's Window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
  298. // screen_w, screen_h,SDL_WINDOW_OPENGL);
  299. //===========================================
  300. //显示在MFC控件上
  301. screen = SDL_CreateWindowFrom(dlg->GetDlgItem(IDC_SCREEN)->GetSafeHwnd());
  302. //===========================================
  303. if (!screen) {
  304. AfxMessageBox(_T("SDL: could not create window - exiting\n"));
  305. return -1;
  306. }
  307. sdlRenderer = SDL_CreateRenderer(screen, -1, 0);
  308. //IYUV: Y + U + V (3 planes)
  309. //YV12: Y + V + U (3 planes)
  310. sdlTexture = SDL_CreateTexture(sdlRenderer, SDL_PIXELFORMAT_IYUV, SDL_TEXTUREACCESS_STREAMING, pCodecCtx->width, pCodecCtx->height);
  311.  
  312. sdlRect.x = 0;
  313. sdlRect.y = 0;
  314. sdlRect.w = screen_w;
  315. sdlRect.h = screen_h;
  316.  
  317. packet = (AVPacket *)av_malloc(sizeof(AVPacket));
  318.  
  319. video_tid = SDL_CreateThread(sfp_refresh_thread, NULL, NULL);
  320. //------------SDL End------------
  321. //Event Loop
  322.  
  323. for (;;) {
  324. //Wait
  325. SDL_WaitEvent(&event);
  326. if (event.type == SFM_REFRESH_EVENT) {
  327. //------------------------------
  328. if (av_read_frame(pFormatCtx, packet) >= 0) {
  329. if (packet->stream_index == videoindex) {
  330. ret = avcodec_decode_video2(pCodecCtx, pFrame, &got_picture, packet);
  331. if (ret < 0) {
  332. AfxMessageBox(_T("Decode Error.\n"));
  333. return -1;
  334. }
  335. if (got_picture) {
  336. sws_scale(img_convert_ctx, (const uint8_t* const*)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameYUV->data, pFrameYUV->linesize);
  337. //SDL---------------------------
  338. SDL_UpdateTexture(sdlTexture, NULL, pFrameYUV->data[0], pFrameYUV->linesize[0]);
  339. SDL_RenderClear(sdlRenderer);
  340. //SDL_RenderCopy( sdlRenderer, sdlTexture, &sdlRect, &sdlRect );
  341. SDL_RenderCopy(sdlRenderer, sdlTexture, NULL, NULL);
  342. SDL_RenderPresent(sdlRenderer);
  343. //SDL End-----------------------
  344. TRACE("Decode 1 frame\n");
  345. }
  346. }
  347. av_free_packet(packet);
  348. }
  349. else {
  350. //Exit Thread
  351. thread_exit = 1;
  352. }
  353. }
  354. else if (event.type == SDL_QUIT) {
  355. thread_exit = 1;
  356. }
  357. else if (event.type == SFM_BREAK_EVENT) {
  358. break;
  359. }
  360.  
  361. }
  362.  
  363. sws_freeContext(img_convert_ctx);
  364.  
  365. SDL_DestroyWindow(screen);
  366. SDL_Quit();
  367. //FIX Small Bug
  368. //SDL Hide Window When it finished
  369. dlg->GetDlgItem(IDC_SCREEN)->ShowWindow(SW_SHOWNORMAL);
  370. //--------------
  371. av_frame_free(&pFrameYUV);
  372. av_frame_free(&pFrame);
  373. avcodec_close(pCodecCtx);
  374. avformat_close_input(&pFormatCtx);
  375.  
  376. return 0;
  377. }
  378.  
  379. //播放的线程
  380. UINT Thread_Play(LPVOID lpParam) {
  381. CMFCDlg *dlg = (CMFCDlg *)lpParam;
  382. ffmpegplayer(lpParam);
  383. return 0;
  384. }
  385.  
  386. //播放
  387. void CMFCDlg::OnBnClickedPlay()
  388. {
  389. // TODO: 在此添加控件通知处理程序代码
  390. pThreadPlay = AfxBeginThread(Thread_Play, this);//开启线程
  391. }
  392.  
  393. //关于
  394. void CMFCDlg::OnBnClickedAbort()
  395. {
  396. // TODO: 在此添加控件通知处理程序代码
  397. CAboutDlg dlg1;
  398. dlg1.DoModal();
  399. }
  400.  
  401. //文件
  402. void CMFCDlg::OnBnClickedFiledialog()
  403. {
  404. // TODO: 在此添加控件通知处理程序代码
  405. CString FilePathName;
  406. CFileDialog dlg(TRUE, NULL, NULL, NULL, NULL);///TRUE为OPEN对话框,FALSE为SAVE AS对话框
  407. if (dlg.DoModal() == IDOK) {
  408. FilePathName = dlg.GetPathName();
  409. m_url.SetWindowText(FilePathName);
  410. }
  411. }
  412.  
  413. //文件路径
  414. void CMFCDlg::OnEnChangeUrl()
  415. {
  416. // TODO: 如果该控件是 RICHEDIT 控件,它将不
  417. // 发送此通知,除非重写 CDialogEx::OnInitDialog()
  418. // 函数并调用 CRichEditCtrl().SetEventMask(),
  419. // 同时将 ENM_CHANGE 标志“或”运算到掩码中。
  420.  
  421. // TODO: 在此添加控件通知处理程序代码
  422. }
  423.  
  424. //暂停
  425. void CMFCDlg::OnBnClickedPause()
  426. {
  427. // TODO: 在此添加控件通知处理程序代码
  428. thread_pause = !thread_pause;
  429. }
  430.  
  431. //停止
  432. void CMFCDlg::OnBnClickedStop()
  433. {
  434. // TODO: 在此添加控件通知处理程序代码
  435. thread_exit = 1;
  436. }
  437.  
  438. //视频窗口
  439. void CMFCDlg::OnStnClickedScreen()
  440. {
  441. // TODO: 在此添加控件通知处理程序代码
  442. }
  1. // MFCDlg.h : 头文件
  2. //
  3.  
  4. #pragma once
  5.  
  6. // CMFCDlg 对话框
  7. class CMFCDlg : public CDialogEx
  8. {
  9. // 构造
  10. public:
  11. CMFCDlg(CWnd* pParent = NULL); // 标准构造函数
  12.  
  13. // 对话框数据
  14. #ifdef AFX_DESIGN_TIME
  15. enum { IDD = IDD_MFC_DIALOG };
  16. #endif
  17.  
  18. protected:
  19. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
  20.  
  21. // 实现
  22. protected:
  23. HICON m_hIcon;
  24. CWinThread *pThreadPlay;
  25.  
  26. // 生成的消息映射函数
  27. virtual BOOL OnInitDialog();
  28. afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  29. afx_msg void OnPaint();
  30. afx_msg HCURSOR OnQueryDragIcon();
  31. DECLARE_MESSAGE_MAP()
  32. public:
  33. afx_msg void OnBnClickedPlay();
  34. afx_msg void OnBnClickedAbort();
  35. afx_msg void OnBnClickedFiledialog();
  36. afx_msg void OnEnChangeUrl();
  37. afx_msg void OnBnClickedPause();
  38. afx_msg void OnBnClickedStop();
  39. afx_msg void OnBnClickedCancel();
  40. afx_msg void OnStnClickedScreen();
  41. CEdit m_url;
  42. };

六、项目下载

下载:FFmpeg+SDL+MFC 项目

七、问题分析

还有上面的项目,基本功能已经实现。
但是有个 bug 。即按播放两次,会出现冲突。拉伸后视频窗口不变。总的来说就是一个半成品... 


八、总结

利用休息时间,终于将基于FFmpeg+SDL的视频播放器的制作视频看完了。熟悉了一下 FFmpeg、SDL、MFC等的使用。开发的流程,算是跟着走了一遍,但是源码部分没有细看。中间遇到很多跟的软件版本冲突问题,也都一一作了解决。整体来看收获很多。感觉也很好玩。在工作中可以起到很好的参考作用。
最后分享,所参看的资料。

FFmpeg再学习 -- FFmpeg+SDL+MFC实现图形界面视频播放器的更多相关文章

  1. FFmpeg再学习 -- FFmpeg解码知识

    继续看雷霄骅的 课程资料 - 基于FFmpeg+SDL的视频播放器的制作 前面用了五个篇幅来讲 FFmpeg,其主要目的是为实现将图片转视频的功能. 总的来说,对于 FFmepg 多少有一些了解了.但 ...

  2. FFmpeg再学习 -- SDL 环境搭建和视频显示

    继续看雷霄骅的 课程资料 - 基于FFmpeg+SDL的视频播放器的制作 一.SDL 简介 参看:WIKI -- Simple DirectMedia Layer 参看:最简单的视音频播放示例9:SD ...

  3. FFmpeg再学习 -- 硬件加速编解码

    为了搞硬件加速编解码,用了一周时间来看 CUDA,接下来开始加以总结. 一.什么是 CUDA (1)首先需要了解一下,什么是 CUDA. 参看:百度百科 -- CUDA 参看:CUDA基础介绍 参看: ...

  4. FFmpeg再学习 -- 视音频基础知识

    最近一直在看雷霄骅 FFmpeg 系列视频,然后将自己的理解总结一下. 参看:<基于 FFmpeg + SDL 的视频播放器的制作>课程的视频 一.视频播放器原理 自己理解: 比如一个 M ...

  5. html5.0学习记录(一)——可拖动视频播放器

    最近自己在重新学习html5新特性,了解到有视频标签和拖动标签,于是自己用这两个特性写了一个小demo,主要功能就是可以通过拖动视频来直接播放.效果图如下: 页面使用了<video>标签和 ...

  6. Linux学习笔记之如何在图形界面旁边把终端添加显示出来

    首先旁边无终端,我们可以点击ctrl+alt+t,可以把终端显示出来 右键点击终端,然后点击Lock to Launcher,然后完成 PS:不想显示也可以点击其右键,选择Unlock from La ...

  7. 音视频处理之FFmpeg+SDL+MFC视频播放器20180411

    一.FFmpeg+SDL+MFC视频播放器 1.MFC知识 1).创建MFC工程的方法 打开VC++ 文件->新建->项目->MFC应用程序 应用程序类型->基于对话框 取消勾 ...

  8. 100行代码实现最简单的基于FFMPEG+SDL的视频播放器(SDL1.x)【转】

    转自:http://blog.csdn.net/leixiaohua1020/article/details/8652605 版权声明:本文为博主原创文章,未经博主允许不得转载.   目录(?)[-] ...

  9. XBMC源代码分析 6:视频播放器(dvdplayer)-文件头(以ffmpeg为例)

    XBMC分析系列文章: XBMC源代码分析 1:整体结构以及编译方法 XBMC源代码分析 2:Addons(皮肤Skin) XBMC源代码分析 3:核心部分(core)-综述 XBMC源代码分析 4: ...

随机推荐

  1. 构造函数挨个过 —— String()

    本篇整理JavaScript中构造函数String的相关知识,主要分为以下三个部分: 构造函数String()的作用与使用方式: String()的属性和方法: 字符串对象实例属性和方法: 一 构造函 ...

  2. 彻底的卸载干净oracle 11g

    1.关闭oracle所有的服务.可以在windows的服务管理器中关闭:   2.打开注册表:regedit 打开路径: <找注册表 :开始->运行->regedit>   H ...

  3. linux修改单个进程的系统时间

    简介 如下是 libfaketime 的一个简单实例. 在工作中常常需要测试修改时间,如果环境不允许调整时间,就要想办法调整单个进程的时间了. 编译安装 git clone https://githu ...

  4. jsp选项卡导航实现——模板

    效果 刚进来页面的样子 在第二个选项卡上方时 点击后 离开 同样第三个 点击 移走鼠标 代码 <%@ page contentType="text/html;charset=UTF-8 ...

  5. 解题报告:poj2387 dijkstra

    2017-09-17 17:37:03 writer:pprp dijkstra模板题目,注意去重 代码如下: /* @theme:poj 2387 @declare:最短路,从N到1点 @write ...

  6. Memcached stats slabs 命令

    Memcached stats slabs 命令用于显示各个slab的信息,包括chunk的大小.数目.使用情况等. 语法: stats slabs 命令的基本语法格式如下: stats slabs ...

  7. Flutter新手第一个坑:Could not find com.android.tools.lint:lint-gradle:26.1.1.

    解决方法1:修改build.gradle,注释掉jcenter(),google().使用阿里的镜像.原因是jcenter google库无法访问到导致的问题.虽然我有万能的爬墙工具,开启全局代理依然 ...

  8. jquery中的工具方法$.isFunction, $.isArray(), $.isWindow()

    本文正式地址:http://www.xiabingbao.com/jquery/2015/07/25/jquery-judge-type 在javascript中对变量类型的判断中,我们讲解了了jqu ...

  9. Linux查看和剔除当前登录用户

    Linux查看和剔除当前登录用户 如何在linux下查看当前登录的用户,并且踢掉你认为应该踢掉的用户? 看了网络中的一些例子.在这里总结一下.主要用到的命令有,w,who,ps,kill,pkill ...

  10. Excel如何关闭进程

    在使用Microsoft.Interop.Excel对象的时候_application.Quit()并不能彻底关闭Excel进程,原因是没有释放掉非托管组建的引用. System.Runtime.In ...