Hi.

> The time base for the various RTP payloads is defined in the RFCs
>  describing the payloads. All the RFCs for all the video payloads I've
>  seen use 90000.

>  But in general different file formats use different time bases.

Thanks for the info - probably it's due to 90Hz standard I read about
in RTP RFC.
All mp4 related formats seems to be on this one as well.

> Which file format did you use? Maybe you set the wrong time base?
>  When using av_write_frame(), you have to use the time base from the
>  AVStream you are writing to.

I'm using plain mp4 (even not H.264).

The time_base is used from the file AVStream, and it has same values
as the RTP one (1,90000).

> What do you mean with "RTP timing method"? When writing to files, you
>  do not have to respect any particular timing, but you can write frames
>  as soon as possible. You just need to properly set the timestamp values
>  in the AVPacket. See output_example.c::write_video_frame for details.

Here is the important point - until now I never set the timestamps,
just set the frame rate once (which caused issues on variable fps such
as slowdowns and speedups).

I believe you speak about the following code?

if (c->coded_frame->pts != AV_NOPTS_VALUE)
    pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base);

It seems as it rescales the coded pts to stream pts. Question is - how
exactly it adapts to the changing source frame rate? There is no
mention of source PTS here.


>  > If not, what are the methods there to deal with changing frame rate?
>
> I'd suggest to start by writing the file without changing the frame
>  rate: you just need to convert timestamps to the correct time base.
>  Again, have a look at output_example.c

Problem is that if:
1) If source frame rate faster then set frame - you get speed up in movie.
2) If source frame rate slower then set frame - you get slowdown up in movie.

Hence I hoped that the recorded movie can somehow adapt to changing
frame rate by re-using the source timestamps, as in RTP case.

Thanks for your help.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to