[FFmpeg-devel] Purely synthetic PTS and DTS...

Tomas Härdin tjoppen at acc.umu.se
Tue Feb 13 13:02:59 EET 2018


sön 2018-02-11 klockan 17:44 -0500 skrev Tony Di Croce:
> I have video frames in a buffer in memory... and I know their frame
> rate
> (and other information like resolution, etc)... I am attempting to
> mux this
> video into an mp4... But I don't know how to set PTS/DTS
> appropriately. I
> have two questions:
> 
> 1) What should I set AVStream->time_base to?
> 2) How do I compute PTS/DTS per frame (given only a framerate)?
> 
> Thanks in advance!

I don't think MP4 allows raw video. You probably mean MOV.

If your framerate is constant then I believe setting time_base to it
and just having PTS increase monotonically from zero is enough (ptr =
0, pts = 1, pts = 2 ...). There may also be some API for this, or lavf
may come up with some PTSes for you if you say AV_NOPTS_VALUE

/Tomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180213/6e504ad7/attachment.sig>


More information about the ffmpeg-devel mailing list