如何使用DirectShow播放Mpeg视频流?

linclouds 2001-11-26 12:01:59
一般情况下,使用DirectShow播放Mpeg文件时,使用的“拉”的方式,在这种情况下,必须保证“数据源”总是连续的,需要的时候必须能够得到。我现在需要实时的软解码捕获的Mpeg码流,能不能使用“推”的方式在解码呢?请问该如何做?
我在解码的时候总有一点延时,又改如何跳过去呢?
...全文
387 26 打赏 收藏 转发到动态 举报
写回复
用AI写文章
26 条回复
切换为时间正序
请发表友善的回复…
发表回复
linclouds 2002-01-09
  • 打赏
  • 举报
回复
好难搞哦,还没有结果呢!
konfyt 2002-01-07
  • 打赏
  • 举报
回复
UP

---------------有没有下文?
niniahze 2001-12-21
  • 打赏
  • 举报
回复
to linclouds(小鱼儿):

谢谢你寄来的源码,但是现在我在赶一份报告,下周才有时间继续看这方面的东东。希望有机会和你多多交流。
wang7022 2001-12-20
  • 打赏
  • 举报
回复
to linclouds(小鱼儿)
yes, the source can be connectted to mpeg1 splitte.
However,I made another thread
to process data so that the speed can be fast enough
to get 30 frams/s, otherwith, maybe the m$'s filter
cannot support.
(I tried many times and thought speed is the only
reason and MPEG1 standard has requirement on that)
wang7022 2001-12-20
  • 打赏
  • 举报
回复
In fact, just delete all
codes of class ball and
anything relates ball,
then, insert your codes to
"reminding shell".
that's all
hope that can answer all questions

buy and happy new year!



wang7022 2001-12-20
  • 打赏
  • 举报
回复
I am very busy for fianl so sorry
for late of replying all your guys' emails.
the general ideal is
to finish
1.
HRESULT CVideoStream::GetMediaType(CMediaType *pmt)
just let "pmt" as what sample format you want.
I get it from my source.
2.
HRESULT CVideoStream::DecideBufferSize(IMemAllocator *pAlloc,ALLOCATOR_PROPERTIES *pProperties)
//use
pProperties->cbBuffer = 1024*1024;
3.//msot important...
HRESULT CVideoStream::FillBuffer(IMediaSample *pms)
//copy all your data to IMediaSample
hr = pms->GetPointer(&pBgBuffer);








linclouds 2001-12-20
  • 打赏
  • 举报
回复
小泽,我也没搞定,不能和MPEG-1 Stream Splitter Filter连接!
ball除了支持IBaseFilter以外好象也没其他的接口;
源码我发给你,还有测试程序,你帮我瞧瞧什么地方有问题!
niniahze 2001-12-20
  • 打赏
  • 举报
回复
小鱼儿:可否给偶一份你改造的source filter的源码啊,我现在连ball的接口都找不到。
感激不尽!

xiaoze@ynmail.com
linclouds 2001-12-20
  • 打赏
  • 举报
回复
wang7022,你说的我都已作了。

1.
HRESULT CVideoStream::GetMediaType(CMediaType *pmt)
我是如下设置:
pmt->SetType(&MEDIATYPE_Stream );
pmt->SetSubtype(&MEDIASUBTYPE_MPEG1System);
pmt->SetTemporalCompression(TRUE);

其它两点也改了,可在Filter的连接过程中,CMediaType的校验是正确的,还没调用DecideBufferSize就已经返回失败了,我重载了CVideoStream的
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv);
后发现,下游的Filter是通过IStream或IAsyncReader来读取数据的,两个都没有则返回失败!
你没有这问题吗?

能把你的源程序发给我参考吗?谢谢!
linclouds@163.net
linclouds 2001-12-19
  • 打赏
  • 举报
回复
chenm001,我也不会呀!
chenm001 2001-12-19
  • 打赏
  • 举报
回复
可以给我一份源代码吗?
chenm003@cmmail.com
linclouds 2001-12-17
  • 打赏
  • 举报
回复
wang7022,你的Source Filter提供的媒体类行是怎样的?
MPEG-1 Stream Splitter Filter支持push方式吗?

linclouds@263.net
wang7022 2001-12-16
  • 打赏
  • 举报
回复
I have done it.....
A push filter can be source of MPEG1&4

wang4113@hotmail.com
linclouds 2001-12-14
  • 打赏
  • 举报
回复
竟然无人关注?
linclouds 2001-12-13
  • 打赏
  • 举报
回复
俺在实现的时候,Source filter和MPEG-1 Stream Splitter Filter无法连接!
MediaType和IMemInputPin的验证都通过,有谁搞定了没?
Nitty 2001-12-07
  • 打赏
  • 举报
回复
我做了个SOURCE FILTER,不过也PULL,至今没搞定PUSH,如果谁有搞定不妨交流一下,呵呵。
而且, 截图方面有点问题,除了DXSHOW的FILTER,有谁自已做过吗?
linclouds 2001-12-07
  • 打赏
  • 举报
回复
Mpeg-1的push方式的Source Filter,有没有哪位老兄搞定的?
strassmann 2001-12-05
  • 打赏
  • 举报
回复
DS的MPEG2 Splitter Filter不支持VOB文件的字幕流,请问有支持字幕流的MPEG2 Splitter
Filter吗?(不用IFO文件的信息)
linclouds 2001-12-05
  • 打赏
  • 举报
回复
shu,MCI恐怕不行吧!
shu 2001-12-05
  • 打赏
  • 举报
回复
插一句,诸位谁知道怎样播放控制ASF文件,用行MCI吗?
加载更多回复(6)

8,303

社区成员

发帖
与我相关
我的任务
社区描述
游戏开发相关内容讨论专区
社区管理员
  • 游戏开发
  • 呆呆敲代码的小Y
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧