| Author |
Message |
hcurreem
Guest
|
Posted:
Thu Oct 14, 2004 10:51 am Post subject:
Swapping IWMWriter at specific time |
|
|
I am trying to create a recording application that split the file into 5
min intervals. Here's the way I do: In the WM Profile, I set the recorded
movie at 10fps. So theoretically every 10 frames equal to 1 sec. Therefore
for every 3000 frames (5 min) I try to swap the file writer. But it seems
that this method doesn't work exactly the way I wanted to. Sometimes the
file's duration is larger, but sometime the file duration is smaller (than
5 min). It is kinda related to the CPU usuage, when CPU usage is high, the
file duration will be longer.
Here's what I do to swap the writer:
1. Create Writer (and call the Open method)
2. Call BeginWriting
3. Check if frame #== 3000
4. if yes, create new writer, Call AddSink, RemoveSink for previous
writer, close previous writer, release previous writer, reset frame count
to 0
5. Wait until movie ends
|
|
| Back to top |
|
 |
Iain
Guest
|
Posted:
Thu Oct 14, 2004 12:24 pm Post subject:
Re: Swapping IWMWriter at specific time |
|
|
On Thu, 14 Oct 2004 02:51:19 -0400, hcurreem wrote:
| Quote: | I am trying to create a recording application that split the file into 5
min intervals. Here's the way I do: In the WM Profile, I set the recorded
movie at 10fps. So theoretically every 10 frames equal to 1 sec. Therefore
for every 3000 frames (5 min) I try to swap the file writer. But it seems
that this method doesn't work exactly the way I wanted to. Sometimes the
file's duration is larger, but sometime the file duration is smaller (than
5 min). It is kinda related to the CPU usuage, when CPU usage is high, the
file duration will be longer.
Here's what I do to swap the writer:
1. Create Writer (and call the Open method)
2. Call BeginWriting
3. Check if frame #== 3000
4. if yes, create new writer, Call AddSink, RemoveSink for previous
writer, close previous writer, release previous writer, reset frame count
to 0
5. Wait until movie ends
|
THere's been a discussion of something similar recently, either here, in
the WMTALK list or in directx.video or DIRECTXAV list (sorry can't remember
which). I *think* it may have been Avnish Jain who had the issue and I
*think* they ended up understanding why (but can't recall if it was
'solved' in a useful way).
Sorry to be vague.
Iain |
|
| Back to top |
|
 |
Becky Weiss [MS]
Guest
|
Posted:
Sat Oct 16, 2004 4:15 am Post subject:
Re: Swapping IWMWriter at specific time |
|
|
One way to help narrow down the problem would be to look at the output files
you get (there is an ASF viewing tool available for download at
www.microsoft.com/asf) to find out if all the frames you expected to see in
your file are there.
The discrepancies may be due to the fact that -- because audio and video
frames' presentation times might be a couple seconds apart in a given ASF
packet, that breaking up the file on packet boundaries results in "ragged"
ends. That theory doesn't explain the correlation to CPU usage that you
report, though, so I'm not sure about that.
Becky
This posting is provided AS IS with no warranties and confers no rights.
"Iain" wrote:
| Quote: | On Thu, 14 Oct 2004 02:51:19 -0400, hcurreem wrote:
I am trying to create a recording application that split the file into 5
min intervals. Here's the way I do: In the WM Profile, I set the recorded
movie at 10fps. So theoretically every 10 frames equal to 1 sec. Therefore
for every 3000 frames (5 min) I try to swap the file writer. But it seems
that this method doesn't work exactly the way I wanted to. Sometimes the
file's duration is larger, but sometime the file duration is smaller (than
5 min). It is kinda related to the CPU usuage, when CPU usage is high, the
file duration will be longer.
Here's what I do to swap the writer:
1. Create Writer (and call the Open method)
2. Call BeginWriting
3. Check if frame #== 3000
4. if yes, create new writer, Call AddSink, RemoveSink for previous
writer, close previous writer, release previous writer, reset frame count
to 0
5. Wait until movie ends
THere's been a discussion of something similar recently, either here, in
the WMTALK list or in directx.video or DIRECTXAV list (sorry can't remember
which). I *think* it may have been Avnish Jain who had the issue and I
*think* they ended up understanding why (but can't recall if it was
'solved' in a useful way).
Sorry to be vague.
Iain
|
|
|
| Back to top |
|
 |
|
|
|
|