|
OpenShot Library | libopenshot
0.7.0
|
This class uses the FFmpeg libraries, to open video files and audio files, and return openshot::Frame objects for any frame in the file. More...
#include <FFmpegReader.h>
Public Member Functions | |
| void | Close () override |
| Close File. More... | |
| FFmpegReader (const std::string &path, bool inspect_reader=true) | |
| Constructor for FFmpegReader. More... | |
| FFmpegReader (const std::string &path, DurationStrategy duration_strategy, bool inspect_reader=true) | |
| Constructor for FFmpegReader with duration strategy. More... | |
| CacheMemory * | GetCache () override |
| Get the cache object used by this reader. More... | |
| std::shared_ptr< openshot::Frame > | GetFrame (int64_t requested_frame) override |
| bool | GetIsDurationKnown () |
| Return true if frame can be read with GetFrame() More... | |
| bool | HardwareDecodeSuccessful () const override |
| Return true if hardware decode was requested and successfully produced at least one frame. More... | |
| bool | IsOpen () override |
| Determine if reader is open or closed. More... | |
| std::string | Json () const override |
| Generate JSON string of this object. More... | |
| Json::Value | JsonValue () const override |
| Generate Json::Value for this object. More... | |
| std::string | Name () override |
| Return the type name of the class. More... | |
| void | Open () override |
| Open File - which is called by the constructor automatically. More... | |
| void | SetJson (const std::string value) override |
| Load JSON string into this object. More... | |
| void | SetJsonValue (const Json::Value root) override |
| Load Json::Value into this object. More... | |
| virtual | ~FFmpegReader () |
| Destructor. More... | |
Public Member Functions inherited from openshot::ReaderBase | |
| bool | ApplyOrientationMetadata () const |
| Return whether readers apply source orientation metadata to returned frames. More... | |
| void | ApplyOrientationMetadata (bool value) |
| Set whether readers should apply source orientation metadata to returned frames. More... | |
| void | DisplayInfo (std::ostream *out=&std::cout) |
| Display file information in the standard output stream (stdout) More... | |
| bool | HasMaxDecodeSize () const |
| Return true when a maximum decoded frame size is active. More... | |
| int | MaxDecodeHeight () const |
| Return the current maximum decoded frame height (0 when unlimited). More... | |
| int | MaxDecodeWidth () const |
| Return the current maximum decoded frame width (0 when unlimited). More... | |
| openshot::ClipBase * | ParentClip () |
| Parent clip object of this reader (which can be unparented and NULL) More... | |
| void | ParentClip (openshot::ClipBase *new_clip) |
| Set parent clip object of this reader. More... | |
| ReaderBase () | |
| Constructor for the base reader, where many things are initialized. More... | |
| void | SetMaxDecodeSize (int width, int height) |
| Set an optional maximum decoded frame size. Use 0,0 to disable the limit. More... | |
| virtual | ~ReaderBase ()=default |
Public Attributes | |
| bool | enable_seek |
| CacheMemory | final_cache |
| Final cache object used to hold final frames. More... | |
Public Attributes inherited from openshot::ReaderBase | |
| openshot::ReaderInfo | info |
| Information about the current media file. More... | |
Additional Inherited Members | |
Protected Attributes inherited from openshot::ReaderBase | |
| bool | apply_orientation_metadata |
| Apply source orientation metadata while reading frames. More... | |
| openshot::ClipBase * | clip |
| Pointer to the parent clip instance (if any) More... | |
| std::recursive_mutex | getFrameMutex |
| Mutex for multiple threads. More... | |
| int | max_decode_height |
| Optional maximum decoded frame height (0 disables the limit) More... | |
| int | max_decode_width |
| Optional maximum decoded frame width (0 disables the limit) More... | |
This class uses the FFmpeg libraries, to open video files and audio files, and return openshot::Frame objects for any frame in the file.
All seeking and caching is handled internally, and the primary public interface is the GetFrame() method. To use this reader, simply create an instance of this class, and call the GetFrame method to start retrieving frames. Use the info struct to obtain information on the file, such as the length (# of frames), height, width, bit rate, frames per second (fps), etc...
Definition at line 103 of file FFmpegReader.h.
| FFmpegReader::FFmpegReader | ( | const std::string & | path, |
| bool | inspect_reader = true |
||
| ) |
Constructor for FFmpegReader.
Sets (and possibly opens) the media file path, or throws an exception.
| path | The filesystem location to load |
| inspect_reader | if true (the default), automatically open the media file and loads frame 1. |
Definition at line 104 of file FFmpegReader.cpp.
| FFmpegReader::FFmpegReader | ( | const std::string & | path, |
| DurationStrategy | duration_strategy, | ||
| bool | inspect_reader = true |
||
| ) |
Constructor for FFmpegReader with duration strategy.
| path | The filesystem location to load |
| duration_strategy | Which duration source to prioritize |
| inspect_reader | if true (the default), automatically open the media file and loads frame 1. |
Definition at line 107 of file FFmpegReader.cpp.
|
virtual |
Destructor.
Definition at line 139 of file FFmpegReader.cpp.
|
overridevirtual |
Close File.
Implements openshot::ReaderBase.
Definition at line 751 of file FFmpegReader.cpp.
Referenced by openshot::AudioWaveformer::ExtractSamples(), and ~FFmpegReader().
|
inlineoverridevirtual |
Get the cache object used by this reader.
Implements openshot::ReaderBase.
Definition at line 293 of file FFmpegReader.h.
|
overridevirtual |
Get a shared pointer to a openshot::Frame object for a specific frame number of this reader.
| requested_frame | The frame number that is requested. |
Implements openshot::ReaderBase.
Definition at line 1259 of file FFmpegReader.cpp.
| bool FFmpegReader::GetIsDurationKnown | ( | ) |
Return true if frame can be read with GetFrame()
Definition at line 1255 of file FFmpegReader.cpp.
|
overridevirtual |
Return true if hardware decode was requested and successfully produced at least one frame.
Reimplemented from openshot::ReaderBase.
Definition at line 1825 of file FFmpegReader.cpp.
|
inlineoverridevirtual |
Determine if reader is open or closed.
Implements openshot::ReaderBase.
Definition at line 302 of file FFmpegReader.h.
|
overridevirtual |
Generate JSON string of this object.
Implements openshot::ReaderBase.
Definition at line 3085 of file FFmpegReader.cpp.
|
overridevirtual |
Generate Json::Value for this object.
Implements openshot::ReaderBase.
Definition at line 3092 of file FFmpegReader.cpp.
Referenced by Json().
|
inlineoverridevirtual |
Return the type name of the class.
Implements openshot::ReaderBase.
Definition at line 308 of file FFmpegReader.h.
|
overridevirtual |
Open File - which is called by the constructor automatically.
Implements openshot::ReaderBase.
Definition at line 263 of file FFmpegReader.cpp.
Referenced by openshot::AudioWaveformer::ExtractSamples().
|
overridevirtual |
Load JSON string into this object.
Implements openshot::ReaderBase.
Definition at line 3116 of file FFmpegReader.cpp.
|
overridevirtual |
Load Json::Value into this object.
Implements openshot::ReaderBase.
Definition at line 3131 of file FFmpegReader.cpp.
Referenced by SetJson().
| bool openshot::FFmpegReader::enable_seek |
Enable or disable seeking. Seeking can more quickly locate the requested frame, but some codecs have trouble seeking, and can introduce artifacts or blank images into the video.
Definition at line 270 of file FFmpegReader.h.
Referenced by GetFrame().
| CacheMemory openshot::FFmpegReader::final_cache |
Final cache object used to hold final frames.
Definition at line 266 of file FFmpegReader.h.
Referenced by GetCache(), and GetFrame().
1.8.17