mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
avvidenc: timestamp output buffers
Same approach as x264enc, with the one hour offset
This commit is contained in:
parent
6382be0996
commit
06c249cabb
1 changed files with 11 additions and 0 deletions
|
@ -682,6 +682,15 @@ gst_ffmpegvidenc_receive_packet (GstFFMpegVidEnc * ffmpegenc,
|
|||
GST_VIDEO_CODEC_FRAME_UNSET_SYNC_POINT (frame);
|
||||
}
|
||||
|
||||
frame->dts =
|
||||
gst_ffmpeg_time_ff_to_gst (pkt->dts, ffmpegenc->context->time_base);
|
||||
/* This will lose some precision compared to setting the PTS from the input
|
||||
* buffer directly, but that way we're sure PTS and DTS are consistent, in
|
||||
* particular DTS should always be <= PTS
|
||||
*/
|
||||
frame->pts =
|
||||
gst_ffmpeg_time_ff_to_gst (pkt->pts, ffmpegenc->context->time_base);
|
||||
|
||||
ret = gst_video_encoder_finish_frame (GST_VIDEO_ENCODER (ffmpegenc), frame);
|
||||
|
||||
done:
|
||||
|
@ -836,6 +845,8 @@ gst_ffmpegvidenc_start (GstVideoEncoder * encoder)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gst_video_encoder_set_min_pts (encoder, GST_SECOND * 60 * 60 * 1000);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue