ffmpeg学习笔记

一、2015年2月5日

改编文章http://blog.csdn.net/leixiaohua1020/article/details/8652605,实现摄像头分辨率的显示。当时因为options参数忘记传入输入流打开函数导致分辨率设置一直不成功。

具体代码:

	av_dict_set(&options,"video_size","320x240",0);		//设置更改分辨率
	//Set own video device's name
	if(avformat_open_input(&pFormatCtx,"video=QuickCam Orbit/Sphere AF",ifmt,&options)!=0) //在main()函数内options参数记得传入

二、2015年2月7日11:46:09

改编文章http://blog.csdn.net/leixiaohua1020/article/details/8652605,实现同一窗口多视频显示。

部分代码片段如下:

screen = SDL_SetVideoMode(screen_w*2.2, screen_h*2.5, 0,0);

	SDL_Rect rect;
	rect.x = 0;    
	rect.y = 0;    
	rect.w = screen_w;    
	rect.h = screen_h; 

	//复制rect的内容显示到rect1中
	SDL_Rect rect1;
	rect1.x=340;
	rect1.y=0;
	rect1.w=screen_w;
	rect1.h=screen_h;

	SDL_Rect rect2;
	rect2.x=0;
	rect2.y=300;
	rect2.w=screen_w;
	rect2.h=screen_h;

	SDL_Rect rect3;
	rect3.x=340;
	rect3.y=300;
	rect3.w=screen_w;
	rect3.h=screen_h;

//测试自己填充数据----------------
						SDL_DisplayYUVOverlay(bmp, &rect); 
						SDL_DisplayYUVOverlay(bmp,&rect1);
						SDL_DisplayYUVOverlay(bmp,&rect2);
						SDL_DisplayYUVOverlay(bmp,&rect3);


运行效果截图:





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值