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
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
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?
|
|
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
|
|
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?
|
|
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.
|
|
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?
|
|
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.
|
|
|
[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...
|
|