Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Entertainment » microsoft.public.windowsmedia.sdk
Thread: file size control with File Sink

HTVi
TV Discussion Newsgroups

file size control with File Sink
horatio.cs[ at ]gmail.com 5/17/2007 4:45:54 AM
OS:WinXP SP2
SDK: Windows Media Format SDK 9.5

Scenario:
In run-time, I have several little WMV file, I merge them by SDK(1),
and I want to play the merged file(or stream).
At first I used "Network sink", and call player to open the url(2). It
worked but took time to buffering.
I want to avoid the buffering time, so I tried to use "File sink", it
writes to a file.
The player open the file very quickly, but the file size might grows
unboundedly.

The file grows as the video plays. But I don't want to keep the frames
which "already played".
The file shound not exist when player terminated.
I want to bound file size in run-time, say 20MB. How to do ?

My ultimate objective is: Play several WMV file smoothly and
seamlessly with short initial buffering time, and
the disk space(or memory space) can be under my control.

I don't have much experience of WMFSDK and DirectShow, so I am very
appreciate your "detailed" guidance.
Thank you very much.

1. The sample in SDK : wmvappend
2. Ex: http://127.0.0.1:5000

Re: file size control with File Sink
"Chris P." <msdn[ at ]chrisnet.net> 5/17/2007 1:03:41 PM
On 16 May 2007 21:45:54 -0700, horatio.cs[ at ]gmail.com wrote:

[Quoted Text]
> Scenario:
> In run-time, I have several little WMV file, I merge them by SDK(1),
> and I want to play the merged file(or stream).
> At first I used "Network sink", and call player to open the url(2). It
> worked but took time to buffering.
> I want to avoid the buffering time, so I tried to use "File sink", it
> writes to a file.
> The player open the file very quickly, but the file size might grows
> unboundedly.
>
> The file grows as the video plays. But I don't want to keep the frames
> which "already played".
> The file shound not exist when player terminated.
> I want to bound file size in run-time, say 20MB. How to do ?
>
> My ultimate objective is: Play several WMV file smoothly and
> seamlessly with short initial buffering time, and
> the disk space(or memory space) can be under my control.
>
> I don't have much experience of WMFSDK and DirectShow, so I am very
> appreciate your "detailed" guidance.
> Thank you very much.

I don't understand. It seems you have already created a merged file with
the content you desire which you can simply play with the WMP control or
through a DirectShow render graph.

If you need to stream to remote machines then you have to stream to a
Network Sink or push to a Windows Media Server.

Are the new small WMV files being created continuously? At what time are
they played back? What software are they played with? What is the
persistence (how long will it exist) of the merged file?

--
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]
Re: file size control with File Sink
poorprogrammer <horatio.cs[ at ]gmail.com> 5/18/2007 1:57:32 AM
On 5¤ë17¤é, ¤U¤È9®É03¤À, "Chris P." <m...[ at ]chrisnet.net> wrote:
[Quoted Text]
> On 16 May 2007 21:45:54 -0700, horatio...[ at ]gmail.com wrote:
>
> I don't understand. It seems you have already created a merged file with
> the content you desire which you can simply play with the WMP control or
> through a DirectShow render graph.
>
> If you need to stream to remote machines then you have to stream to a
> Network Sink or push to a Windows Media Server.
>
> Are the new small WMV files being created continuously? At what time are
> they played back? What software are they played with? What is the
> persistence (how long will it exist) of the merged file?
>
> --http://www.chrisnet.net/code.htm
> [MS MVP for DirectShow / MediaFoundation]

Thank you for reply.
I will try to explain.

The new small WMV files would be created continuously in run-time.
They are merged in run-time. At the same time, the new WMV file keep
coming and keep being appended. Concurrently, the WMP play the merged
file.

There are 3 threads runs concurrently:
1. download new small WMV files continuously.
2. merge them continuously.(the others append to the first one.)
3. Play.
All happens in localhost.

The merged file size would grow if new WMV keep coming. I don't want
to keep the content already played, it should be erased immediately.
Ex: At the moment, WMP plays at 3:00, the merged file might have
length of 6 mins. But the content before 3:00 is still in disk.


---
Although it happens in localhost, I can use network sink anyway. Just
playing the localhost's URL.
By network sink, I don't need to worry about disk or memory space,
right?


Re: file size control with File Sink
"Alessandro Angeli" <nobody[ at ]nowhere.in.the.net> 5/18/2007 8:24:20 AM
From: "poorprogrammer"

[Quoted Text]
> Although it happens in localhost, I can use network sink
> anyway. Just playing the localhost's URL.
> By network sink, I don't need to worry about disk or
> memory space, right?

You can use a network sink to output a continuos stream that
WMP can read without caching it on disk. But better yet you
could write a push source filter for DirectShow that will
output the demuxed elementary streams directly, without any
need for a remuxed disk or network ASF stream. That is, at
the moment you have

receiver -> demuxer -> muxer -> sink ---> WMP

with the first part outside of WMP. Unless you have some
reason to keep that part outside of WMP, you could just have

receiver -> demuxer -> rest of WMP

inside WMP, with the first part being a push source filter
registered to handle some custom protocol or file type.


--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


Re: file size control with File Sink
poorprogrammer <horatio.cs[ at ]gmail.com> 5/21/2007 4:50:47 PM
On 5¤ë18¤é, ¤U¤È4®É24¤À, "Alessandro Angeli" <nob...[ at ]nowhere.in.the.net>
wrote:
[Quoted Text]
> From: "poorprogrammer"
>
> > Although it happens in localhost, I can use network sink
> > anyway. Just playing the localhost's URL.
> > By network sink, I don't need to worry about disk or
> > memory space, right?
>
> You can use a network sink to output a continuos stream that
> WMP can read without caching it on disk. But better yet you
> could write a push source filter for DirectShow that will
> output the demuxed elementary streams directly, without any
> need for a remuxed disk or network ASF stream. That is, at
> the moment you have
>
> receiver -> demuxer -> muxer -> sink ---> WMP
>
> with the first part outside of WMP. Unless you have some
> reason to keep that part outside of WMP, you could just have
>
> receiver -> demuxer -> rest of WMP
>
> inside WMP, with the first part being a push source filter
> registered to handle some custom protocol or file type.
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> //http://www.riseoftheants.com/mmx/faq.htm


I don't know how to implement what did you say.....

I use IWMReader(in WMFSDK) interface to process the wmv files.
But how to "write a push source filter for DirectShow"?? Could you
please explain this part in detail?

Thank you.


Re: file size control with File Sink
"Alessandro Angeli" <nobody[ at ]nowhere.in.the.net> 5/21/2007 5:05:18 PM
From: "poorprogrammer"

[Quoted Text]
> But how to "write a push source filter for DirectShow"??
> Could you please explain this part in detail?

http://groups.google.com/group/microsoft.public.windowsmedia.sdk/msg/9f6903ff7efd4b0c
http://groups.google.com/group/microsoft.public.windowsmedia.sdk/msg/c92c0e330265049b

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen