Hi Luca. > The situation described there is very similar to my own, namely a network > > source (camera in his case) which sends frames with rate that varies from > 1 > > to 10. > > > > The purposed solution (which I hope I understood correctly) was to: > > > > a) Use very small value for timebase, such as 1/2520, or even > microseconds > > (1/1000000?). > > You have to set your time base so that all the timestamps can be multiple > of the time base. This (as far as I understand) is what Rich is also saying > in the email you quote. So, where are your timestamps coming from? In which > time unit are they expressed? Just set the time base to this time unit, and > you are done... > > I'm getting these timestamps in two variables: * seconds since Linux epoch (~1970) and * milliseconds, which reset every second
According to this I presume that my timeunit is millisecond, so setting the time base to 1/1000 should work? > > > b) Use same value both for format and codec timebases. > > I am not sure about this. > Do you know what needs to be then in each of them then? > c) Timestamp the frames according to source frames. What Rich says in that email is "you need to set the pts values correctly > for each frame you write". Whis is the same thing that has been told in > this mailing list :) > > Assuming that there is no bug in libav* and you ara using a codec/format > which supports variable frame rate, if you use the input timestamps and > the result does not play well, this might mean that your input timestamps > are wrong. > If I remember well, you are using some strange SDK for the input, which > associates questionable timestamps to the frames... > Actually, these were bugs in my code :). I'm currently using the SDK timestamps deltas for live RTP streaming, and this works just fine. But when I tried to use same time base and timestamps deltas for recorded media, the video just stuck. Hopefully, changing the time base would help and finally resolve this issue - I'll update here as it goes. Regards. _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
