[Libav-user] FPS in mkv

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[Libav-user] FPS in mkv

Paweł Kopalko
Hi all!

I'm muxing H264 frames with alaw audio frames coming from the RTP stream but I'm having some problems with setting fps for the mkv container.

For the AVPacket::pts I am using the calculated presentation time (from RTCP SR reports)
I am rescaling them as follows ( I had assumed exactly the same for audio):

pkt.pts  = av_rescale_q(s_video_sync.fSyncTime.tv_sec * 1000000 + s_video_sync.fSyncTime.tv_usec, av_encode_codec_ctx->time_base, video_st->time_base); 

* the timestamp in the end is in microseconds (the first parameter)
* av_encode_codec_ctx->time_base is set to  {1,fps} where fps is depending on the stream, let's say 5
* video_st->time_base is auto seto to {1,1000} (I gather that this is forced by mkv container)

I gather that this is what should be set to te rescale function (at least that's what examples show), but the ffprobe show strange readouts for duration and fps is set to 1k... and well the video plays strangely.

my question is how should I approach this?
Should I rescale the timestamp to start counting from 0 for the first packet, or I'm messing two different time domains and thus muxer can't figure out what to do?


Libav-user mailing list
[hidden email]