Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2021-05-31 19:12:44 +0300
committerSebastian Parborg <darkdefende@gmail.com>2021-05-31 19:22:24 +0300
commit261a10edb0a9da53b2554ca64bcf445a8b9b3d9f (patch)
treeb9a3fba0343d24a93a592e3e566463710c084c98
parentd647e730fbc23233b572594eeb6083978bdb882d (diff)
Display source video fps in the VSE
Now FPS is displayed in the video source for videos to provide easy access. Reviewed By: Richard Antalik Differential Revision: http://developer.blender.org/D11441
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py12
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c5
-rw-r--r--source/blender/sequencer/intern/render.c6
-rw-r--r--source/blender/sequencer/intern/strip_add.c13
5 files changed, 34 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index b24b6e84939..e9bfe6cd4e2 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -1398,8 +1398,8 @@ class SEQUENCER_PT_source(SequencerButtonsPanel, Panel):
box.template_image_stereo_3d(strip.stereo_3d_format)
# Resolution.
- col = layout.column(align=True)
- col = col.box()
+ col = layout.box()
+ col = col.column(align=True)
split = col.split(factor=0.5, align=False)
split.alignment = 'RIGHT'
split.label(text="Resolution")
@@ -1409,6 +1409,14 @@ class SEQUENCER_PT_source(SequencerButtonsPanel, Panel):
split.label(text="%dx%d" % size, translate=False)
else:
split.label(text="None")
+ #FPS
+ if elem.orig_fps:
+ split = col.split(factor=0.5, align=False)
+ split.alignment = 'RIGHT'
+ split.label(text="FPS")
+ split.alignment = 'LEFT'
+ split.label(text="%.2f" % elem.orig_fps, translate=False)
+
class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 4b95dd41b30..f59f51ea28a 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -57,6 +57,7 @@ typedef struct StripElem {
char name[256];
/** Ignore when zeroed. */
int orig_width, orig_height;
+ float orig_fps;
} StripElem;
typedef struct StripCrop {
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 9ba92431723..8fbad449cf6 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -1346,6 +1346,11 @@ static void rna_def_strip_element(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "orig_height");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Orig Height", "Original image height");
+
+ prop = RNA_def_property(srna, "orig_fps", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "orig_fps");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Orig FPS", "Original frames per second");
}
static void rna_def_strip_crop(BlenderRNA *brna)
diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c
index d881c90a1e0..8ed769880a4 100644
--- a/source/blender/sequencer/intern/render.c
+++ b/source/blender/sequencer/intern/render.c
@@ -1237,6 +1237,12 @@ static ImBuf *seq_render_movie_strip(const SeqRenderData *context,
}
if (*r_is_proxy_image == false) {
+ if (sanim && sanim->anim) {
+ short fps_denom;
+ float fps_num;
+ IMB_anim_get_fps(sanim->anim, &fps_denom, &fps_num, true);
+ seq->strip->stripdata->orig_fps = fps_denom / fps_num;
+ }
seq->strip->stripdata->orig_width = ibuf->x;
seq->strip->stripdata->orig_height = ibuf->y;
}
diff --git a/source/blender/sequencer/intern/strip_add.c b/source/blender/sequencer/intern/strip_add.c
index 5ec2269b993..64671aeb265 100644
--- a/source/blender/sequencer/intern/strip_add.c
+++ b/source/blender/sequencer/intern/strip_add.c
@@ -548,15 +548,25 @@ Sequence *SEQ_add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqL
seq->blend_mode = SEQ_TYPE_CROSS; /* so alpha adjustment fade to the strip below */
+ float video_fps = 0.0f;
+
if (anim_arr[0] != NULL) {
seq->anim_preseek = IMB_anim_get_preseek(anim_arr[0]);
seq->len = IMB_anim_get_duration(anim_arr[0], IMB_TC_RECORD_RUN);
IMB_anim_load_metadata(anim_arr[0]);
+ short fps_denom;
+ float fps_num;
+
+ IMB_anim_get_fps(anim_arr[0], &fps_denom, &fps_num, true);
+
+ video_fps = fps_denom / fps_num;
+
/* Adjust scene's frame rate settings to match. */
if (load_data->flags & SEQ_LOAD_MOVIE_SYNC_FPS) {
- IMB_anim_get_fps(anim_arr[0], &scene->r.frs_sec, &scene->r.frs_sec_base, true);
+ scene->r.frs_sec = fps_denom;
+ scene->r.frs_sec_base = fps_num;
}
/* Set initial scale based on load_data->fit_method. */
@@ -577,6 +587,7 @@ Sequence *SEQ_add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqL
strip->stripdata = se = MEM_callocN(sizeof(StripElem), "stripelem");
strip->stripdata->orig_width = orig_width;
strip->stripdata->orig_height = orig_height;
+ strip->stripdata->orig_fps = video_fps;
BLI_split_dirfile(load_data->path, strip->dir, se->name, sizeof(strip->dir), sizeof(se->name));
seq_add_set_view_transform(scene, seq, load_data);