diff options
author | Peter Schlaile <peter@schlaile.de> | 2011-08-28 18:46:03 +0400 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2011-08-28 18:46:03 +0400 |
commit | c07bd1439a3f026b8603c52662c3e7ccc364321a (patch) | |
tree | f6ce8cd3e01b0701c9b3d0cd3e17987be33803b8 /source/blender/makesrna/intern | |
parent | 852a03a6af6d67da58154b848b45a118eb38cdc0 (diff) |
== Sequencer ==
This patch adds:
* support for proxy building again (missing feature from Blender 2.49)
additionally to the way, Blender 2.49 worked, you can select several
strips at once and make Blender build proxies in the background (using
the job system)
Also a new thing: movie proxies are now build into AVI files, and
the proxy system is moved into ImBuf-library, so that other parts
of blender can also benefit from it.
* Timecode support: to fix seeking issues with files, that have
a) varying frame rates
b) very large GOP lengths
c) are broken inbetween
d) use different time code tracks
the proxy builder can now also build timecode indices, which are
used (optionally) for seeking.
For the first time, it is possible, to do frame exact seeking on
all file types.
* Support for different video-streams in one video file (can be
selected in sequencer, other parts of blender can also use it,
but UI has to be added accordingly)
* IMPORTANT: this patch *requires* ffmpeg 0.7 or newer, since
older versions don't support the pkt_pts field, that is essential
for building timecode indices.
Windows and Mac libs are already updated, Linux-users have to build
their own ffmpeg verions until distros keep up.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 93 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 1 |
2 files changed, 93 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 476ac325848..b6e2117956d 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -245,6 +245,10 @@ static void rna_Sequence_use_proxy_set(PointerRNA *ptr, int value) seq->flag |= SEQ_USE_PROXY; if(seq->strip->proxy == NULL) { seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy"); + seq->strip->proxy->quality = 90; + seq->strip->proxy->build_tc_flags = SEQ_PROXY_TC_ALL; + seq->strip->proxy->build_size_flags + = SEQ_PROXY_IMAGE_SIZE_25; } } else { seq->flag ^= SEQ_USE_PROXY; @@ -587,6 +591,34 @@ static void rna_Sequence_filepath_update(Main *bmain, Scene *scene, PointerRNA * rna_Sequence_update(bmain, scene, ptr); } +static int seqproxy_seq_cmp_cb(Sequence *seq, void *arg_pt) +{ + struct { Sequence *seq; void *seq_proxy; } *data= arg_pt; + + if(seq->strip && seq->strip->proxy == data->seq_proxy) { + data->seq= seq; + return -1; /* done so bail out */ + } + return 1; +} + +static void rna_Sequence_tcindex_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + Editing *ed= seq_give_editing(scene, FALSE); + Sequence *seq; + + struct { Sequence *seq; void *seq_proxy; } data; + + data.seq= NULL; + data.seq_proxy = ptr->data; + + seqbase_recursive_apply(&ed->seqbase, seqproxy_seq_cmp_cb, &data); + seq= data.seq; + + reload_sequence_new_file(scene, seq, FALSE); + rna_Sequence_frame_change_update(scene, seq); +} + /* do_versions? */ static float rna_Sequence_opacity_get(PointerRNA *ptr) { @@ -789,6 +821,19 @@ static void rna_def_strip_proxy(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; + + static const EnumPropertyItem seq_tc_items[]= { + {SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""}, + {SEQ_PROXY_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", + "use images in the order as they are recorded"}, + {SEQ_PROXY_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", + "use global timestamp written by recording device"}, + {SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", + 0, "Free Run (rec date)", + "interpolate a global timestamp using the " + "record date and time written by recording " + "device"}, + {0, NULL, 0, NULL, NULL}}; srna = RNA_def_struct(brna, "SequenceProxy", NULL); RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip"); @@ -804,6 +849,46 @@ static void rna_def_strip_proxy(BlenderRNA *brna) RNA_def_property_string_funcs(prop, "rna_Sequence_proxy_filepath_get", "rna_Sequence_proxy_filepath_length", "rna_Sequence_proxy_filepath_set"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + + prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_25); + RNA_def_property_ui_text(prop, "25%", "Build 25% proxy resolution"); + + prop= RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_50); + RNA_def_property_ui_text(prop, "50%", "Build 50% proxy resolution"); + + prop= RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_75); + RNA_def_property_ui_text(prop, "75%", "Build 75% proxy resolution"); + + prop= RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_size_flags", SEQ_PROXY_IMAGE_SIZE_100); + RNA_def_property_ui_text(prop, "100%", "Build 100% proxy resolution"); + + prop= RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_RECORD_RUN); + RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index"); + + prop= RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_FREE_RUN); + RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index"); + + prop= RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flags", SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN); + RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time"); + + prop= RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "quality"); + RNA_def_property_ui_text(prop, "Quality", "JPEG Quality of proxies to build"); + RNA_def_property_ui_range(prop, 1, 100, 1, 0); + + prop= RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "tc"); + RNA_def_property_enum_items(prop, seq_tc_items); + RNA_def_property_ui_text(prop, "Timecode", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_tcindex_update"); + } static void rna_def_strip_color_balance(BlenderRNA *brna) @@ -1208,7 +1293,7 @@ static void rna_def_proxy(StructRNA *srna) prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY); - RNA_def_property_ui_text(prop, "Use Proxy", "Use a preview proxy for this strip"); + RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this strip"); RNA_def_property_boolean_funcs(prop, NULL, "rna_Sequence_use_proxy_set"); prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE); @@ -1330,6 +1415,12 @@ static void rna_def_movie(BlenderRNA *brna) RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + prop= RNA_def_property(srna, "streamindex", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "streamindex"); + RNA_def_property_range(prop, 0, 20); + RNA_def_property_ui_text(prop, "Streamindex", "For files with several movie streams, use the stream with the given index"); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update_reopen_files"); + prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL); RNA_def_property_struct_type(prop, "SequenceElement"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index b79d5395eec..0166baa8443 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1674,6 +1674,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna) {SEQ_PROXY_RENDER_SIZE_25, "PROXY_25", 0, "Proxy size 25%", ""}, {SEQ_PROXY_RENDER_SIZE_50, "PROXY_50", 0, "Proxy size 50%", ""}, {SEQ_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""}, + {SEQ_PROXY_RENDER_SIZE_100, "PROXY_100", 0, "Proxy size 100%", ""}, {SEQ_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""}, {0, NULL, 0, NULL, NULL}}; |