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: WriteSample throws E_OUTOFMEMORY error

HTVi
TV Discussion Newsgroups

WriteSample throws E_OUTOFMEMORY error
jain <paruljain30[ at ]gmail.com> 4/24/2007 9:15:12 AM
Hi All,

i have develop an application which convert an swf file into the WMV.
i used bitmap buffer to wrtie in the WMV File using the WriteSample
but when i increase the width and height then it fails to create the
WMV File. it throws out of memory error. i realized that memory should
be flushed after calling the WriteSample but memory get flushed after
writing the 20 frames around. so if frame size is larger then it fails
after wrting some frames only.

Anyone have idea how i can flush the memory.

one more thing i am calling my application from Java Application. is
there any relation of this error to java application.

Thanks
Parul

Re: WriteSample throws E_OUTOFMEMORY error
sasha <abc[ at ]fox.net> 4/24/2007 4:34:33 PM
jain wrote:
[Quoted Text]
> Hi All,
>
> i have develop an application which convert an swf file into the WMV.
> i used bitmap buffer to wrtie in the WMV File using the WriteSample
> but when i increase the width and height then it fails to create the
> WMV File. it throws out of memory error. i realized that memory should


You can't just increase the dimensions of a sample. They have to stay
constant and match the profile.

..a
Re: WriteSample throws E_OUTOFMEMORY error
jain <paruljain30[ at ]gmail.com> 4/26/2007 4:10:43 AM
On Apr 24, 9:34 pm, sasha <a...[ at ]fox.net> wrote:
[Quoted Text]
> jain wrote:
> > Hi All,
>
> > i have develop an application which convert an swf file into the WMV.
> > i used bitmap buffer to wrtie in the WMV File using the WriteSample
> > but when i increase the width and height then it fails to create the
> > WMV File. it throws out of memory error. i realized that memory should
>
> You can't just increase the dimensions of a sample. They have to stay
> constant and match the profile.
>
> .a
i am also reconfiguring the profile according to the dimension and
whatever other parameter should change i am also changing these like
bitrate.

Re: WriteSample throws E_OUTOFMEMORY error
sasha <abc[ at ]fox.net> 4/26/2007 4:26:55 PM
jain wrote:
[Quoted Text]
> i am also reconfiguring the profile according to the dimension and
> whatever other parameter should change i am also changing these like
> bitrate.
>

I don't think you can do that after BeginWrite() has been called.
..a
Re: WriteSample throws E_OUTOFMEMORY error
jain <paruljain30[ at ]gmail.com> 5/24/2007 9:53:39 AM
On Apr 26, 9:26 pm, sasha <a...[ at ]fox.net> wrote:
[Quoted Text]
> jain wrote:
> > i am also reconfiguring the profile according to the dimension and
> > whatever other parameter should change i am also changing these like
> > bitrate.
>
> I don't think you can do that after BeginWrite() has been called.
> .a

i think there is some confusion. i am not increasing the size in
between creating the WMV. the only thing i want to say that WMV
creation fails when i am creating the WMV File of size (2880 x 2880).
reason i find out is that i am calling the WriteSample method in teh
loop and as we know WriteSample is an asynchronous call so it keeps
the frames in the memory for some time. it not directly write the
frames in the disk. so when we create teh WMV File of this size then
after some time allocateSample fails to allocate memory. so is there
any way so sort out teh problem. did you get my point.

Thanks
Parul

Re: WriteSample throws E_OUTOFMEMORY error
sasha <abc[ at ]fox.net> 5/24/2007 3:54:19 PM
jain wrote:
[Quoted Text]
> after some time allocateSample fails to allocate memory. so is there
> any way so sort out teh problem. did you get my point.
>

Are you releasing the INSSBuffer objects?
Re: WriteSample throws E_OUTOFMEMORY error
jain <paruljain30[ at ]gmail.com> 5/25/2007 3:37:59 AM
On May 24, 8:54 pm, sasha <a...[ at ]fox.net> wrote:
[Quoted Text]
> jain wrote:
> > after some time allocateSample fails to allocate memory. so is there
> > any way so sort out teh problem. did you get my point.
>
> Are you releasing the INSSBuffer objects?

yes i am releasing the INSSBuffer objects

Re: WriteSample throws E_OUTOFMEMORY error
sasha <abc[ at ]fox.net> 5/25/2007 5:36:54 AM
jain wrote:

[Quoted Text]
> yes i am releasing the INSSBuffer objects
>

Does it work if the sample size is smaller? Does it work if you slow
done the rate of WriteSample calls?
Re: WriteSample throws E_OUTOFMEMORY error
jain <paruljain30[ at ]gmail.com> 5/25/2007 11:42:29 AM
On May 25, 10:36 am, sasha <a...[ at ]fox.net> wrote:
[Quoted Text]
> jain wrote:
> > yes i am releasing the INSSBuffer objects
>
> Does it work if the sample size is smaller? Does it work if you slow
> done the rate of WriteSample calls?

yes it works for the smaller sample size.

what do you maen by
>> Does it work if you slow done the rate of WriteSample calls?
writeSample call is in loop.


Re: WriteSample throws E_OUTOFMEMORY error
sasha <abc[ at ]fox.net> 5/25/2007 3:40:52 PM
jain wrote:
[Quoted Text]
> On May 25, 10:36 am, sasha <a...[ at ]fox.net> wrote:
>> jain wrote:
>>> yes i am releasing the INSSBuffer objects
>> Does it work if the sample size is smaller? Does it work if you slow
>> done the rate of WriteSample calls?
>
> yes it works for the smaller sample size.
>
Well, then it must really be a limitation in the system.

> what do you maen by
>>> Does it work if you slow done the rate of WriteSample calls?

> writeSample call is in loop.

Of course. What happens if you call Sleep( 100 ); after each WriteSample?


Re: WriteSample throws E_OUTOFMEMORY error
jain <paruljain30[ at ]gmail.com> 5/26/2007 2:34:00 AM
On May 25, 8:40 am, sasha <a...[ at ]fox.net> wrote:
[Quoted Text]
> jain wrote:
> > On May 25, 10:36 am, sasha <a...[ at ]fox.net> wrote:
> >> jain wrote:
> >>> yes i am releasing the INSSBuffer objects
> >> Does it work if the sample size is smaller? Does it work if you slow
> >> done the rate of WriteSample calls?
>
> > yes it works for the smaller sample size.
>
> Well, then it must really be a limitation in the system.
>
> > what do you maen by
> >>> Does it work if you slow done the rate of WriteSample calls?
> > writeSample call is in loop.
>
> Of course. What happens if you call Sleep( 100 ); after each WriteSample?

oh yes it doesn't work with the Sleep(100) also.
do you think there is any way to improve the memory usage.
there is any way so that we can flush the data after 2-3 frame.
or we can make any other synchronous call rather than WriteSample.
as WriteSample takes uncompressed data. so any way to compress the
frame and then we can use any other function by passing these
compressed frame. as uncompressed frames uses lots of memory.

thanks
or something else to improve the memory usage.

Re: WriteSample throws E_OUTOFMEMORY error
sasha <abc[ at ]fox.net> 5/28/2007 7:06:34 AM
[Quoted Text]
> frame and then we can use any other function by passing these
> compressed frame. as uncompressed frames uses lots of memory.


You can use WriteStreamSample, but it means you'd have to compress the
sample manually using the DMO codec. In the end, I don't know if the
result will be any better.

Here is a thought: try playing with the bitrate setting for the stream.
maybe that will help...

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