summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Khamidullin <ruslank@borisfx.com>2023-07-12 22:45:28 +0000
committerTim-Philipp Müller <tim@centricular.com>2023-07-19 16:05:06 +0100
commitaded70efaf6eb1c3b7c64d0df7bcd833b6dfc8f1 (patch)
treef900e2723720606eb74f7531cfd2b8e831298598
parent6910a24c1437a0e49c21a51d147d66688fa5336c (diff)
video: accept timecode of 119.88 (120/1.001) FPS
The drop-frame rules are specified in “SMPTE ST 12-3:2016” and are consistent with the traditional ones: “ To minimize fractional time deviation from real time, the first two super-frame numbers (00 and 01) shall be omitted from the count at the start of each minute except minutes 00, 10, 20, 30, 40, and 50. Thus the first eight frame numbers (0 through 7) are omitted from the count at the start of each minute except minutes 00, 10, 20, 30, 40, and 50. ” Where “super-frame” is a group of 4 frames for 120 FPS. Fixes #2797 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5061>
-rw-r--r--subprojects/gst-plugins-base/gst-libs/gst/video/gstvideotimecode.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideotimecode.c b/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideotimecode.c
index e92aeb4779..5713032a47 100644
--- a/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideotimecode.c
+++ b/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideotimecode.c
@@ -95,28 +95,28 @@ gst_video_time_code_is_valid (const GstVideoTimeCode * tc)
return FALSE;
}
- /* We either need a specific X/1001 framerate, otherwise an integer
- * framerate or less than 1 frame per second */
+ /* We need either a specific X/1001 framerate, or less than 1 FPS,
+ * otherwise an integer framerate. */
if (tc->config.fps_d == 1001) {
if (tc->config.fps_n != 30000 && tc->config.fps_n != 60000 &&
- tc->config.fps_n != 24000)
+ tc->config.fps_n != 24000 && tc->config.fps_n != 120000)
return FALSE;
} else if (tc->config.fps_n >= tc->config.fps_d
&& tc->config.fps_n % tc->config.fps_d != 0) {
return FALSE;
}
- /* We only support 30000/1001 and 60000/1001 as drop-frame framerates.
- * 24000/1001 is *not* a drop-frame framerate! */
+ /* We support only 30000/1001, 60000/1001, and 120000/1001 (see above) as
+ * drop-frame framerates. 24000/1001 is *not* a drop-frame framerate! */
if (tc->config.flags & GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME) {
- if (tc->config.fps_d != 1001 || (tc->config.fps_n != 30000
- && tc->config.fps_n != 60000))
+ if (tc->config.fps_d != 1001 || tc->config.fps_n == 24000)
return FALSE;
}
/* Drop-frame framerates require skipping over the first two
- * timecodes every minutes except for every tenth minute in case
- * of 30000/1001 and the first four timecodes for 60000/1001 */
+ * timecodes every minute except for every tenth minute in case
+ * of 30000/1001, the first four timecodes for 60000/1001,
+ * and the first eight timecodes for 120000/1001. */
if ((tc->config.flags & GST_VIDEO_TIME_CODE_FLAGS_DROP_FRAME) &&
tc->minutes % 10 && tc->seconds == 0 && tc->frames < fr / 15) {
return FALSE;