libav: set the frame rate values in ffmpeg stream context

To avoid a default value to be used in mux.c+304, give the
frame rate detected from the caps.

Fix IVF header.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4248>
This commit is contained in:
Stéphane Cerveau 2023-03-23 10:32:09 +01:00 committed by GStreamer Marge Bot
parent 6f21ef9d3a
commit f0d61ac8b0

View file

@ -486,6 +486,9 @@ gst_ffmpegmux_setcaps (GstPad * pad, GstObject * parent, GstCaps * caps)
/* copy over the aspect ratios, ffmpeg expects the stream aspect to match the /* copy over the aspect ratios, ffmpeg expects the stream aspect to match the
* codec aspect. */ * codec aspect. */
st->sample_aspect_ratio = st->codecpar->sample_aspect_ratio; st->sample_aspect_ratio = st->codecpar->sample_aspect_ratio;
/* copy over the frame rate to be used in the container format. */
st->time_base.num = tmp.time_base.num;
st->time_base.den = tmp.time_base.den;
GST_LOG_OBJECT (pad, "accepted caps %" GST_PTR_FORMAT, caps); GST_LOG_OBJECT (pad, "accepted caps %" GST_PTR_FORMAT, caps);
return TRUE; return TRUE;