Hello,
In my application I receive from a remote server synchronized video
(mpeg4 asp) and audio (mp3) and mux them to avi file. The video comes
frame-by-frame, and the audio comes in small chunks, say 200-250 ms.
Both video frames and audio chunks have time-stamps in ms.
My question is how to set audio time_base and pts correctly?
For video I set time_base.num = framerate, time_base.den = 1; and
calculate pts as follows:
AVRational time_base_1kHz;
time_base_1kHz.num = 1;
time_base_1kHz.den = 1000;
packet.pts = av_rescale_q(timeStamp - baseTimeStamp_,
time_base_1kHz, videoStream_->time_base);
where baseTimeStamp_ is the 1st timestamp of the stream.
But if I try do similar calculation for audio, I don't get playable
avi. If I always set to audio AV_NOPTS_VALUE, then avi has playable
video, but no audio.
So what are the correct values for audio time_base and pts's?
Thanks!
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user