[Libav-user] muxing h264/aac stream

Nisar Ahmed nisar.med at gmail.com
Sat Aug 17 08:05:40 CEST 2013


Thanks for your answer, when I set timestamp of decoder, the frame rate
jumps up to a very large value

pts/dts = (2002/0, 0/0, 1001/0, 5005/0, 3003/0...)

am I setting the time_base to correct values 1001/30000 and pkt.duration =
1001? the timescale of the timestamp is also 30000


On Sat, Aug 17, 2013 at 2:10 AM, Anshul maheshwari <
er.anshul.maheshwari at gmail.com> wrote:

> -
>
> On Aug 16, 2013 7:30 PM, "Nisar Ahmed" <nisar.med at gmail.com> wrote:
> >
> > I am muxing h264/aac stream to mp4 coming from an encoder and having
> issues syncing audio and video streams.
> >
> > I suspect that the problem is with PTS and DTS but I am not sure what
> values should i set to properly sync both streams.
> >
> > I have set the time_base of video stream's AVCodecContext to 1001/30000
> and each AVPacket gets a duration of 1001
> >
> > I am recieving time stamps from the encoder with each NAL packet which
> is set as PTS of the AVPacket. the sequence of PTS/DTS I set is (2002/0,
> 0/1001, 1001/2002, 5005/3003, 3003/4004...)
> >
> > Audio stream AVCodecContext sample rate is 48000 and PTS/DTS are simply
> multiples of 1024 starting from 0 and AVPacket duration is 1024.
> >
> > The output movie 's frame rate is 20fps when it should be 29.97fps as it
> is ntsc.
> >
> > Please tell me how to debug this problem and what are the guidelines of
> creating pts/dts for both video and audio in my case
> >
> > _______________________________________________
> > Libav-user mailing list
> > Libav-user at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/libav-user
> >
> Hi naseer
>
> If you are getting timestamp with encoder,  i would suggest "dont try to
> manuplate that" you may set that same timestamp as presentation timestamp
> (pts) if your video is realtime then try not to generate B type video frame
> hence no need to set dts.
> Whatever clock is set by encoder try generating the pts of audio according
> to that.
>
> @enjoy
> Anshul
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130817/b3ac4917/attachment.html>


More information about the Libav-user mailing list