|
Blender V4.5
|
Go to the source code of this file.
Functions | |
| MovieReader * | MOV_open_file (const char *filepath, int ib_flags, int streamindex, char colorspace[IM_MAX_SPACE]) |
| void | MOV_close (MovieReader *anim) |
| ImBuf * | MOV_decode_frame (MovieReader *anim, int position, IMB_Timecode_Type tc, IMB_Proxy_Size preview_size) |
| ImBuf * | MOV_decode_preview_frame (MovieReader *anim) |
| int | MOV_get_duration_frames (MovieReader *anim, IMB_Timecode_Type tc) |
| double | MOV_get_start_offset_seconds (const MovieReader *anim) |
| float | MOV_get_fps (const MovieReader *anim) |
| bool | MOV_get_fps_num_denom (const MovieReader *anim, short &r_fps_num, float &r_fps_denom) |
| int | MOV_get_image_width (const MovieReader *anim) |
| int | MOV_get_image_height (const MovieReader *anim) |
| bool | MOV_is_initialized_and_valid (const MovieReader *anim) |
| void | MOV_get_filename (const MovieReader *anim, char *filename, int filename_maxncpy) |
| IDProperty * | MOV_load_metadata (MovieReader *anim) |
| void | MOV_set_multiview_suffix (MovieReader *anim, const char *suffix) |
| void | MOV_close_proxies (MovieReader *anim) |
| void | MOV_set_custom_proxy_dir (MovieReader *anim, const char *dir) |
| int | MOV_calc_frame_index_with_timecode (MovieReader *anim, IMB_Timecode_Type tc, int position) |
| int | MOV_get_existing_proxies (const MovieReader *anim) |
| MovieProxyBuilder * | MOV_proxy_builder_start (MovieReader *anim, IMB_Timecode_Type tcs_in_use, int proxy_sizes_in_use, int quality, const bool overwrite, blender::Set< std::string > *processed_paths, bool build_only_on_bad_performance) |
| void | MOV_proxy_builder_process (MovieProxyBuilder *context, bool *stop, bool *do_update, float *progress) |
| void | MOV_proxy_builder_finish (MovieProxyBuilder *context, bool stop) |
Movie file reading / playback functions.
Definition in file MOV_read.hh.
| int MOV_calc_frame_index_with_timecode | ( | MovieReader * | anim, |
| IMB_Timecode_Type | tc, | ||
| int | position ) |
Given a frame index, calculate final frame index taking timecode into account.
This does nothing (returns input frame position) if IMB_TC_NONE is used, or movie proxy/index file is not built.
When a timecode index file is present and is requested to be used, this can return a different frame index than input frame, particularly for IMB_TC_RECORD_RUN_NO_GAPS.
Definition at line 1293 of file movie_proxy_indexer.cc.
References MovieIndex::get_frame_index(), and movie_open_index().
Referenced by MOV_decode_frame(), and blender::seq::seq_proxy_fetch().
| void MOV_close | ( | MovieReader * | anim | ) |
Release memory and other resources associated with movie playback.
Definition at line 58 of file movie_read.cc.
References IMB_metadata_free(), MovieReader::metadata, and MOV_close_proxies().
Referenced by build_pict_list_from_anim(), free_buffers(), blender::seq::free_strip_proxy(), image_free_anims(), MOV_close_proxies(), openanim(), blender::ed::vse::prefetch_data_fn(), blender::seq::relations_strip_free_anim(), blender::seq::seq_free_strip(), thumb_create_ex(), and wm_main_playanim_intern().
| void MOV_close_proxies | ( | MovieReader * | anim | ) |
Close any internally opened proxies of this movie.
Definition at line 1201 of file movie_proxy_indexer.cc.
References i, IMB_PROXY_MAX_SLOT, MovieReader::indices_tried, MOV_close(), movie_index_free(), MovieReader::no_gaps, MovieReader::proxies_tried, MovieReader::proxy_anim, and MovieReader::record_run.
Referenced by MOV_close(), MOV_set_custom_proxy_dir(), proxy_endjob(), and blender::seq::proxy_rebuild_finish().
| ImBuf * MOV_decode_frame | ( | MovieReader * | anim, |
| int | position, | ||
| IMB_Timecode_Type | tc, | ||
| IMB_Proxy_Size | preview_size ) |
Fetches a frame from a movie at given frame position.
Internally this will seek within the movie as/if needed. For most movie files, decoding frames sequentially is much more efficient than decoding random frames.
If proxy_size is not IMB_PROXY_NONE, a proxy file of given size will be attempted. If it exists, the frame will be decoded from it. If the proxy does not exist, original file will be used.
Movies that are <= 8 bits/color channel are returned as byte images; higher bit depth movies are returned as float images. Note that the color space is returned as-is, i.e. a float image might not be in linear space.
Returned image can be null if movie file does not exist, is not supported or failed decoding.
Definition at line 1363 of file movie_read.cc.
References anim_getnew(), MovieReader::cur_position, MovieReader::duration_in_frames, ImBuf::fileframe, ImBuf::filepath, MovieReader::filepath, IMB_PROXY_NONE, IMB_TC_NONE, MOV_calc_frame_index_with_timecode(), MOV_decode_frame(), movie_open_proxy(), MovieReader::state, STRNCPY(), MovieReader::Uninitialized, and MovieReader::Valid.
Referenced by build_pict_list_from_anim(), ibuf_from_picture(), load_movie_single(), MOV_decode_frame(), MOV_decode_preview_frame(), movieclip_load_movie_file(), openanim(), blender::seq::seq_proxy_fetch(), blender::seq::seq_render_movie_strip_custom_file_proxy(), blender::seq::seq_render_movie_strip_view(), thumb_create_ex(), and wm_main_playanim_intern().
| ImBuf * MOV_decode_preview_frame | ( | MovieReader * | anim | ) |
Fetches a frame from a movie used for preview/thumbnails. The frame will be halfway into the file duration. Thumbnail related metadata ("Thumb::Video::*") will be set on the returned image.
Definition at line 1325 of file movie_read.cc.
References MovieReader::duration_in_frames, IMB_freeImBuf(), IMB_metadata_ensure(), IMB_metadata_set_field(), IMB_PROXY_NONE, IMB_TC_NONE, ImBuf::metadata, MOV_decode_frame(), SNPRINTF, MovieReader::x, and MovieReader::y.
Referenced by thumb_create_ex(), and ui_tooltip_from_clip().
| int MOV_get_duration_frames | ( | MovieReader * | anim, |
| IMB_Timecode_Type | tc ) |
Return the length (in frames) of the movie.
Definition at line 1413 of file movie_read.cc.
References MovieReader::duration_in_frames, MovieIndex::get_duration(), IMB_TC_NONE, and movie_open_index().
Referenced by blender::seq::add_movie_strip(), blender::seq::add_reload_new_file(), build_pict_list_from_anim(), image_match_len_exec(), load_movie_single(), movieclip_calc_length(), blender::nodes::node_geo_image_info_cc::node_geo_exec(), blender::ed::vse::prefetch_data_fn(), ui_tooltip_from_clip(), ui_tooltip_from_image(), and uiTemplateImageInfo().
| int MOV_get_existing_proxies | ( | const MovieReader * | anim | ) |
Queries which proxies exist for this movie.
Note that it does not check whether proxies are up to date, or valid files; just merely whether the expected files exist.
Returns bitmask of IMB_Proxy_Size flags.
Definition at line 1304 of file movie_proxy_indexer.cc.
References BLI_exists(), FILE_MAX, get_proxy_filepath(), i, IMB_PROXY_MAX_SLOT, IMB_PROXY_NONE, and proxy_sizes.
Referenced by MOV_proxy_builder_start(), and blender::seq::seq_proxy_need_rebuild().
| void MOV_get_filename | ( | const MovieReader * | anim, |
| char * | filename, | ||
| int | filename_maxncpy ) |
Gets filename (without the folder) part of the movie.
Definition at line 73 of file movie_read.cc.
References BLI_path_split_file_part(), and MovieReader::filepath.
Referenced by blender::seq::seq_proxy_index_dir_set().
| float MOV_get_fps | ( | const MovieReader * | anim | ) |
Returns the frames per second of the movie, or zero if the information is not available. Note that if you want the most accurate representation, use MOV_get_fps_num_denom.
Definition at line 1432 of file movie_read.cc.
References MovieReader::frs_sec, and MovieReader::frs_sec_base.
Referenced by blender::seq::add_movie_strip(), BKE_movieclip_get_fps(), blender::nodes::node_geo_image_info_cc::node_geo_exec(), blender::ed::vse::prefetch_data_fn(), blender::seq::seq_render_movie_strip(), blender::seq::time_strip_fps_get(), uiTemplateMovieclipInformation(), and wm_main_playanim_intern().
| bool MOV_get_fps_num_denom | ( | const MovieReader * | anim, |
| short & | r_fps_num, | ||
| float & | r_fps_denom ) |
Returns the frames per second of the movie as numerator and denominator. False will be returned if the information is not available.
Definition at line 1440 of file movie_read.cc.
References MovieReader::frs_sec, and MovieReader::frs_sec_base.
Referenced by blender::seq::add_movie_strip().
| int MOV_get_image_height | ( | const MovieReader * | anim | ) |
Get movie image height in pixels.
Definition at line 1462 of file movie_read.cc.
References ELEM, MovieReader::video_rotation, MovieReader::x, and MovieReader::y.
Referenced by blender::seq::add_movie_strip(), and ui_tooltip_from_clip().
| int MOV_get_image_width | ( | const MovieReader * | anim | ) |
Get movie image width in pixels.
Definition at line 1457 of file movie_read.cc.
References ELEM, MovieReader::video_rotation, MovieReader::x, and MovieReader::y.
Referenced by blender::seq::add_movie_strip(), and ui_tooltip_from_clip().
| double MOV_get_start_offset_seconds | ( | const MovieReader * | anim | ) |
Return the encoded start offset (in seconds) of the movie.
Definition at line 1427 of file movie_read.cc.
References MovieReader::start_offset.
Referenced by blender::seq::add_movie_strip().
| bool MOV_is_initialized_and_valid | ( | const MovieReader * | anim | ) |
Returns true if movie playback has been fully initialized and is supported. Note that immediately after MOV_open_file the playback is not initialized yet.
Definition at line 129 of file movie_read.cc.
References UNUSED_VARS.
Referenced by blender::seq::add_movie_reload_if_needed().
| IDProperty * MOV_load_metadata | ( | MovieReader * | anim | ) |
Loads metadata of the movie. Metadata is only loaded for already initialized movies.
Definition at line 78 of file movie_read.cc.
References BLI_assert, IMB_metadata_ensure(), IMB_metadata_set_field(), MovieReader::metadata, MovieReader::state, and MovieReader::Valid.
Referenced by blender::seq::add_movie_strip(), and blender::seq::add_reload_new_file().
| MovieReader * MOV_open_file | ( | const char * | filepath, |
| int | ib_flags, | ||
| int | streamindex, | ||
| char | colorspace[IM_MAX_SPACE] ) |
Opens a movie file for reading / playback. ib_flags are IB_ ImBuf bitmask (only IB_animdeinterlace is taken into account). streamindex is for multi-track movie files.
Returned MovieReader object can be used in other playback related functions. Note that a valid object will be returned even if file does not exist or is not a video file. The actual initialization is delayed until MOV_decode_frame is called.
When done with playback, use MOV_close to delete it.
Definition at line 101 of file movie_read.cc.
References BLI_assert, BLI_path_is_rel(), BLI_strncpy(), COLOR_ROLE_DEFAULT_BYTE, MovieReader::colorspace, MovieReader::filepath, MovieReader::ib_flags, IM_MAX_SPACE, IMB_colormanagement_role_colorspace_name_get(), MovieReader::streamindex, and STRNCPY().
Referenced by build_pict_list_from_anim(), movie_open_proxy(), openanim(), openanim_noload(), thumb_create_ex(), and wm_main_playanim_intern().
| void MOV_proxy_builder_finish | ( | MovieProxyBuilder * | context, |
| bool | stop ) |
Finish building proxies / time-codes indices, and delete the builder.
Definition at line 1190 of file movie_proxy_indexer.cc.
References proxy_sizes, stop, and UNUSED_VARS.
Referenced by proxy_endjob(), and blender::seq::proxy_rebuild_finish().
| void MOV_proxy_builder_process | ( | MovieProxyBuilder * | context, |
| bool * | stop, | ||
| bool * | do_update, | ||
| float * | progress ) |
Will rebuild all used indices and proxies at once.
Definition at line 1172 of file movie_proxy_indexer.cc.
References do_update, progress, stop, and UNUSED_VARS.
Referenced by do_movie_proxy(), and blender::seq::proxy_rebuild().
| MovieProxyBuilder * MOV_proxy_builder_start | ( | MovieReader * | anim, |
| IMB_Timecode_Type | tcs_in_use, | ||
| int | proxy_sizes_in_use, | ||
| int | quality, | ||
| const bool | overwrite, | ||
| blender::Set< std::string > * | processed_paths, | ||
| bool | build_only_on_bad_performance ) |
Initialize movie proxies / time-code indices builder.
Definition at line 1108 of file movie_proxy_indexer.cc.
References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), FILE_MAX, get_proxy_filepath(), i, IMB_PROXY_MAX_SLOT, MOV_get_existing_proxies(), printf, proxy_sizes, MovieReader::state, UNUSED_VARS, and MovieReader::Valid.
Referenced by clip_rebuild_proxy_exec(), and blender::seq::proxy_rebuild_context().
| void MOV_set_custom_proxy_dir | ( | MovieReader * | anim, |
| const char * | dir ) |
Custom directory to be used for loading or building proxies. By default "BL_proxy" within the directory of the movie file is used.
Definition at line 1227 of file movie_proxy_indexer.cc.
References MovieReader::index_dir, MOV_close_proxies(), STREQ, and STRNCPY().
Referenced by movieclip_open_anim_file(), and blender::seq::seq_proxy_index_dir_set().
| void MOV_set_multiview_suffix | ( | MovieReader * | anim, |
| const char * | suffix ) |
Sets multi-view suffix to be used when building proxies for this movie.
Definition at line 143 of file movie_read.cc.
References STRNCPY(), and MovieReader::suffix.
Referenced by blender::seq::open_anim_file_multiview(), and blender::seq::seq_anim_add_suffix().