mfvideoenc: Don't pass 0/1 framerate to MFT

Some MFT implementations do not accept 0/1 framerate and it will
result in encoder open failure. If framerate is unknown,
we will use arbitrary 25/1 framerate value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2106>
This commit is contained in:
Seungha Yang 2021-03-25 03:24:11 +09:00
parent 90181642a3
commit cc7bb86aa6

View file

@ -320,8 +320,11 @@ gst_mf_video_enc_set_format (GstVideoEncoder * enc, GstVideoCodecState * state)
fps_n = GST_VIDEO_INFO_FPS_N (info);
fps_d = GST_VIDEO_INFO_FPS_D (info);
if (fps_n == 0 || fps_d == 0) {
fps_n = 0;
if (fps_n <= 0 || fps_d <= 0) {
/* XXX: not sure why. NVIDIA MFT accepts 0/1 framerate, but Intel or
* Microsoft's software MFT doesn't accept 0/1 framerate.
* Need to set something meaningful value here therefore */
fps_n = 25;
fps_d = 1;
}