[Libav-user] How to perform drift compensation in MPEG-2 recorder

Mike Versteeg mike at mikeversteeg.com
Thu Dec 20 11:12:50 CET 2012


>>>> video PTS, at least for MPEG-2, increments as integer (0, 1, 2, ...)
>>>
>>> Oops, my bad... I lost your original requirement to be MPEG-2
>>> compliant. But maybe it would be enough to set REPEAT_FIRST_FIELD once
>>> in a while.
>>
>> Thanks. I am not familiar with that. Won't that introduce a double frame?
>
> No, it is sued to fight interlaced video (a.k.a telecine). The effect
> of this flag is that the frame is slowed down by 50%. It should be
> good enough to keep a ~30 fps video seamlessly synchronized with the
> audio stream that is a bit slower.

If this does not introduce any other problems, like in editing
software, then yes it should work. Unfortunately I'd still need a
trick to speed up.

>> So other formats do support "true" time stamping?
>
> Absolutely. MPEG-4 h264 stream has full support of flexible PTS per
> frame, and it will deliver much better quality. But it really needs
> more CPU, and you may face questions of licenses, patents, and
> royalties for use of different h264 encoders.

So far I've not been able to buy a licence for x264, but also it is
too heavy on CPU.

> Anyway, if you are looking at player support, MPEG-2 is the king. I
> hope that other people on this list will have more to share on this
> topic.

Thanks Alex, you've been very helpful!

Mike


More information about the Libav-user mailing list