Re: AVIStream mp3 stream - stream size?
- From: "Alessandro Angeli" <nobody@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 21 Feb 2007 19:12:06 +0100
From: "dominolog"
You don't really deserve an aswer because of the abusive
multipost...
I have created an output AVI file with
AVIOpen/AVICreateStream. This is a video stream encoded
with selectable codec (XVID). Then i create an output
audio stream, configure it to be MPEGLAYER3WAVEFORMAT
format. Then I open a mp3 file, read chunk by chunk and
write it to the audio stream. The problems are: - I have
to synchornize video and audio stream - the video and
audio streams have to have the same time length. How to
get the
output audio stream time? The AVIStreamLengthTime
function seems to be returnig not correct values (not the
stream time value). What do I have to do?
If the MP3 stream is VBR, then there is no way to correctly
guess its duration unless the bitrate in the stream header
is set to the average bitrate, which is not always the case.
AVI does *not* properly support VBR audio streams and
AVIFile does not know how to handle them, which means you
have to do your own magic (a.k.a. parse the MP3 stream) to
properly handle VBR MP3 via AVIFile.
- Second issue is the output movie seems to have problem
with video synchronization - the video plays but with
some "hoops" - the movie plays for 3-5s and then stops
for 1-2s. If I dont create the audio stream in output
movie, the video stream plays correct.
This may be caused by incorrectly muxing the VBR MP3 stream
so that the latency between audio and video frames may grow
beyond the tolerance of the playback system. When you mux
VBR streams, you have to take care to interleave an audio
frame very close to the corresponding video frame, because
the AVIFile systems does not know how to properly interleave
VBR audio streams.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
.
- Follow-Ups:
- Re: AVIStream mp3 stream - stream size?
- From: dominiktomczak
- Re: AVIStream mp3 stream - stream size?
- Prev by Date: Re: Converting from PCM to G.723.1
- Next by Date: Re: convert bitmap file to JPEG FİLE
- Previous by thread: Re:Converting from PCM to G.723.1
- Next by thread: Re: AVIStream mp3 stream - stream size?
- Index(es):
Relevant Pages
|