segunda-feira, 27 de fevereiro de 2012 19:28
I want my app to start playing a video before it is completely downloaded.
I am trying to implement my own "progressive download" media player.
I have created a local http server which then launches “Windows Media Control” hosted window to connect to this local server.
The local server supports http requests such as Cache-Control, Range, If-Modified, etc.
This works with some windows media formats such as WMV and ASF - I can see the video play before downloading the entire file.
For AVI, this works only after clearing the browser cache (but can do what I want with “Async filter”).
For MPEG, it downloads the entire file and then starts playing.
For MP4 it works but only after I change response block size from 4096 to 2048
My question is, is this the right approach?
Or II need to create my own DirectShow filter for the player? (Which will support some formats but not all)
Todas as Respostas
segunda-feira, 27 de fevereiro de 2012 22:07Basically this takes you back to previous Alessandro reply: How to play file while it's downloading and advice to check Async sample and implementing a custom reader. Some existing filters are okay to play partially available file, and other (and it is a typical behavior) are not. I think you can provide a source filter which works around some obstacles that prevent demultiplexers from playing while downloading (esp. by making it possible to "seek" to the end of the resource in order to read indexes and other meta data), and this might make streaming playback more efficient.
terça-feira, 28 de fevereiro de 2012 16:26
Yes, I played with Async sample and it provides what I need. Unfortunately it does not works with all formats, e.g it return 0x80040218 on Render for MOV file. And this file show correctly in MS player and ActiveX MS control, so it looks like I have all the necessary codecs on my PC.
Also, I tried to use async project for Windows formats (ASF and WMV) – it does not play with same 0x80040218.
(Of cause I can use RenderFile and it but I need progresssive downloading)
I am wondering how reliable this approach is in real customer environment.
quarta-feira, 29 de fevereiro de 2012 12:44
The approach is good. By replacing Async Reader with your own substitute filter your goal is to mimic file data access. The filters connected downstream don't really care where data comes from as long as proper interfaces are available and work as expected. Seeing still errors with your filter, I think you are missing something, e.g. you are not implementing some interface, or you are delivering wrong data - all this can be seeing while debugging.
Most filters, if not all of them, don't need the whole file (resource) available at once. They read metadata, discover data properties and start streaming.