如何使用DirectShow录制视频并传递我自己的视频缓冲区而不是来自文件或网络摄像头 [英] How to record video using DirectShow and passing my own video buffers not from a file or webcam

查看:87
本文介绍了如何使用DirectShow录制视频并传递我自己的视频缓冲区而不是来自文件或网络摄像头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种使用directShow录制视频的方法.我设法使用网络摄像头源以及aviMux和文件编写器来构建图形.这很好.我的问题是我需要录制自己创建的样本中的视频.那么有没有办法做到这一点?我正在使用VFW Avi API来执行此操作,但它并非每次都有效,并且不适用于每个编解码器.所以我想使用DirectShow,但是我该怎么办?
我是否需要编写将接收缓冲区写入的源过滤器?还是有这样的过滤器?我也可以覆盖samplegrabber中的样本吗?也许我会在图表中使用它?
我很乐意提供帮助
谢谢
mezik.

I am searching for a way to record video using directShow. I managed to build a graph using a webcam source and aviMux and file writer. this worked fine. My problem is i need to record video from my own created samples. So is there a way to do this? I was using VFW Avi API to do this , but it does not work every time and not with every codec. SO I thought to use DirectShow but What should I do?
Do I need to write a source filter that would recive buffers to write? or is there a filter like that? also can I overwrite the samples in samplegrabber? maybe I would use it in my graph?
I would be glad for any help
thanks
mezik.

推荐答案

你好,

在Direct X SDK版本9(其中包括Direct Show)中,
看"Push Source"示例,此示例捕获屏幕
使用Windows GDI.它具有输出引脚,但没有任何
输入引脚.

这意味着推送源是帧的生成器.

我修改了我的一个项目中的推入源"示例,以从TCP/IP和UDP连接接收帧.

我相信自定义Direct X 9的Push Source示例将解决您的问题.

鲍里斯·特卡琴科
www.LinuxCAD.com(我写过).
Hello,

In Direct X SDK version 9 (Direct Show is included there),
look at "Push Source" sample, this sample captures screen
using Windows GDI. It has an output Pins but does not have any
input pins.

That means Push Source is a Generator of frames.

I have modified Push Source example in one of the projects of mine to receive frames from TCP/IP and UDP connections.

I believe customizing Push Source example of Direct X 9 will solve your problem.

Boris Tkachenko
www.LinuxCAD.com (I wrote that).


谢谢.
我开始使用PushSource示例.
我正在尝试将COM接口添加到过滤器,以便可以将其位图传递给它,
如果您知道如何执行此操作,我将很高兴.

在此先感谢
mezik
Hi thanks.
I started working with the PushSource sample.
I am trying to add a COM Interface to the filter so I can pass my bitmaps to it,
If you have any idea how to do this, I would be gald.

thanks in advance
mezik


为什么需要"com interface"?为什么选择COM?如果您愿意让我照顾您想要做的一切,
Why do you need "com interface"? Why COM? And I would be glad if you would let me take care of whatever you are trying to do for about


这篇关于如何使用DirectShow录制视频并传递我自己的视频缓冲区而不是来自文件或网络摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆