| Author |
Message |
Rubing Chiu
Guest
|
Posted:
Thu Oct 07, 2004 11:11 am Post subject:
Saving compressed samples and uncompressed samples to a file |
|
|
When output a wmv file, after writing some uncompressed
video samples using IWMWriter::WriteSample(), I tried to
write compressed video samples from a file to the same
file using IWMWriterAdvanced::WriteStreamSamples(). The
writing process returns no error. However, the output
file has some problem when playing it.
When playing to the time of the beginning of compressed
samples are written, the video image is broken. This
broken status continues for a while. After a while, the
video image is okay.
What causes the broken image?? How to fix it??
Please help....
|
|
| Back to top |
|
 |
Chris P. [MVP]
Guest
|
Posted:
Thu Oct 07, 2004 6:44 pm Post subject:
Re: Saving compressed samples and uncompressed samples to a |
|
|
Rubing Chiu wrote:
| Quote: | When output a wmv file, after writing some uncompressed
video samples using IWMWriter::WriteSample(), I tried to
write compressed video samples from a file to the same
file using IWMWriterAdvanced::WriteStreamSamples(). The
writing process returns no error. However, the output
file has some problem when playing it.
When playing to the time of the beginning of compressed
samples are written, the video image is broken. This
broken status continues for a while. After a while, the
video image is okay.
What causes the broken image?? How to fix it??
|
I don't think you can do that. All audiences must use the same video codec.
So even if you set up seperate profiles and 2 audiences, it is not permitted
unless both video streams are either compressed (with the same codec) or
uncompressed. You should write to a new file, or make them in the same
format. |
|
| Back to top |
|
 |
Rubing Chiu
Guest
|
Posted:
Fri Oct 08, 2004 7:09 am Post subject:
Re: Saving compressed samples and uncompressed samples to a |
|
|
The profile is the same to the input file and output
file. So, we can write compressed data from input file
to output file.
However, we forced the problem described in my previous
post. :-(
Anyone has a solution for my problem? Please help...
| Quote: | -----Original Message-----
I don't think you can do that. All audiences must use
the same video codec.
So even if you set up seperate profiles and 2 audiences,
it is not permitted
unless both video streams are either compressed (with
the same codec) or
uncompressed. You should write to a new file, or make
them in the same
format.
.
|
|
|
| Back to top |
|
 |
Becky Weiss [MS]
Guest
|
Posted:
Sat Oct 09, 2004 4:21 am Post subject:
Re: Saving compressed samples and uncompressed samples to a |
|
|
Rubing,
The problem, most likely, is that even if both segments of the stream are
compressed to the exact same format, they're not compressed by the exact same
_instance_ of the video codec.
This matters, because the only way to ensure that the stream actually fits
within the bitrate and buffer window specified in the profile is to have one
video codec encode the whole thing. What is likely happening in your case is
that your samples are overflowing those parameters near that junction point,
and some frames therefore are getting dropped.
Here's what I suggest: First encode your uncompressed data into a temporary
file. Then, using your temporary file and the file with the compressed data,
you can write the compressed samples to your final output file. For this
final output file, you will need to set the buffer window equal to the sum of
the buffer windows for the temporary file and the compressed input file.
This is important, since this is what will allow you to avoid the problem you
were running into.
Becky
This posting is provided AS IS with no warranties and confers no rights.
"Rubing Chiu" wrote:
| Quote: | The profile is the same to the input file and output
file. So, we can write compressed data from input file
to output file.
However, we forced the problem described in my previous
post. :-(
Anyone has a solution for my problem? Please help...
-----Original Message-----
I don't think you can do that. All audiences must use
the same video codec.
So even if you set up seperate profiles and 2 audiences,
it is not permitted
unless both video streams are either compressed (with
the same codec) or
uncompressed. You should write to a new file, or make
them in the same
format.
.
|
|
|
| Back to top |
|
 |
|
|
|
|