Commit 06c249ca authored by Mathieu Duponchelle's avatar Mathieu Duponchelle 🐸 Committed by Sebastian Dröge

avvidenc: timestamp output buffers

Same approach as x264enc, with the one hour offset
parent 6382be09
Pipeline #56137 passed with stages
in 39 minutes and 28 seconds
...@@ -682,6 +682,15 @@ gst_ffmpegvidenc_receive_packet (GstFFMpegVidEnc * ffmpegenc, ...@@ -682,6 +682,15 @@ gst_ffmpegvidenc_receive_packet (GstFFMpegVidEnc * ffmpegenc,
GST_VIDEO_CODEC_FRAME_UNSET_SYNC_POINT (frame); 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); ret = gst_video_encoder_finish_frame (GST_VIDEO_ENCODER (ffmpegenc), frame);
done: done:
...@@ -836,6 +845,8 @@ gst_ffmpegvidenc_start (GstVideoEncoder * encoder) ...@@ -836,6 +845,8 @@ gst_ffmpegvidenc_start (GstVideoEncoder * encoder)
return FALSE; return FALSE;
} }
gst_video_encoder_set_min_pts (encoder, GST_SECOND * 60 * 60 * 1000);
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment