i tried to mux 2 streams
one video and other mp3...........
the problem i get is initailly both video and audio play fine then video stops and audio plays fine .....video plays in small parts while audio is continuous ....after audio finishes the video plays continously ..........
where cud be the problema nd wot cud the problem how can i rectify it ...............it works fine if i make a avi of video stream first and then add the audio stream through virtual dub
some bodyyyy help me
+ Reply to Thread
Results 1 to 8 of 8
-
all thats awesome is awkward
-
Hi-
it works fine if i make a avi of video stream first and then add the audio stream through virtual dub
But that's what muxing is-adding one stream to another. So I don't really understand your problem. Maybe if you describe the process that lead to the problem, someone can help.
However, I'll make a guess. You were adding the audio to the video as the video was being encoded? And that's what lead to the problem? Is the MP3 VBR? And were you using Virtual Dub for this? Because VDub doesn't properly support VBR MP3. So you should probably use VDubMod for the process. Just a guess, though. -
iam sorry as i wasnt clear
i have peice of code which does this muxing its just a set of the functions
AVIFileOpen,AVIFileCreateStream, AVIStreamSetFormat and AVIStreamWrite which are defined in vfw.h
whic works pretty fine with ogg vorbis .........whereas in the case of muxing with mp3 there are 4 more feilds which need to be filled theMPEGLAYER3WAVEFORMAT struct apart from the normal WAVEFORMATEX
wID=1;
fdwFlags=2;
BlockSize=576;//AS I USE AUDIO OF 8KHZ nFramesPerBlock=1;
nCodecDelay=0;
i filled those feilds as mentioned above
AND THEN FOLLOWED each frame of audio with one frame of video
when i try to do with this peice of code then it gives me the problem that i mentioned .....if any other clarifiaction is required regarding the question please mention
thank uall thats awesome is awkward -
Sorry. I won't be much good to you, as I haven't the foggiest notion of what you're talking about. Maybe someone else can help.
-
well anyway i have found away out
the problem was due the field dwrate in the AVISTREAMINFO struct
when the audiorate was 16000 .it gave me breaks in video and when it was just 120 the video used to play fast in parts where there used to be break .....................
can any body give me some explanationas to how its value should be calculated and it wot units is this value...........i eman (milliseconds or microseconds)
this is wot i read
dwscale:-"Used with dwRate to specify the time scale that this stream will use. Dividing dwRate by dwScale gives the number of samples per second. For video streams, this is the frame rate. For audio streams, this rate corresponds to the time needed to play nBlockAlign bytes of audio, which for PCM audio is the just the sample rate."
is there any exact way that we can calculate this value so that the sync between audio and video are also maintainedall thats awesome is awkward -
Originally Posted by awkawe
As the docs state, for PCM audio you just set the values to any pair that gives you the correct sampling rate. Assuming 44100 samples/sec you could set dwRate to 44100 and dwScale to 1, or you could set dwRate to 441000 and dwScale to 10, or you could set dwRate to 88200 and dwScale to 2. Any pair that gives you the correct ratio is fine.
I'm not sure what happens when you use MP3 audio though. Given how so many programs have problems with variable bitrate MP3, I supect that you set the pair to reflect the average bitrate of the MP3 audio, not the actual sampling rate. -
well thanx .............
the thing that I read meant that i need to give the time required to play nblockalign bytes of audio data..............ie the ratio of dwscale /dwrate gives the time required to play nblockalign of audio data ...that is wot i understood but in case of VBR mp3 how do we calculate it ?
i hope somebody will surely help me out
thanxall thats awesome is awkward -
This AVI file structure viewer might help you out:
http://www.thozie.de/avimaster/
Looking at a few AVI files with MP3 audio, the dwScale and dwRate values appear to reflect the underlying digital audio, not the compressed mp3 data.
Similar Threads
-
vc1 to avi problems
By happyhippo in forum Video ConversionReplies: 3Last Post: 14th Jan 2012, 13:41 -
.rm to .avi problems
By xNovaXx in forum ffmpegX general discussionReplies: 2Last Post: 21st Feb 2010, 19:54 -
AVI file problems.
By wicked_pix in forum Newbie / General discussionsReplies: 9Last Post: 5th Dec 2007, 10:27 -
.avi problems with quicktime
By Larz02 in forum MacReplies: 1Last Post: 4th Jun 2007, 14:31 -
DVD to AVI Problems
By Harvey__ in forum DVD RippingReplies: 2Last Post: 31st May 2007, 19:04