OpenShot Library | libopenshot
0.2.4
|
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 () |
Close File. More... | |
FFmpegReader (std::string path) | |
FFmpegReader (std::string path, bool inspect_reader) | |
CacheMemory * | GetCache () |
Get the cache object used by this reader. More... | |
std::shared_ptr< openshot::Frame > | GetFrame (int64_t requested_frame) |
bool | IsOpen () |
Determine if reader is open or closed. More... | |
std::string | Json () |
Get and Set JSON methods. More... | |
Json::Value | JsonValue () |
Generate Json::JsonValue for this object. More... | |
std::string | Name () |
Return the type name of the class. More... | |
void | Open () |
Open File - which is called by the constructor automatically. More... | |
void | SetJson (std::string value) |
Load JSON string into this object. More... | |
void | SetJsonValue (Json::Value root) |
Load Json::JsonValue into this object. More... | |
virtual | ~FFmpegReader () |
Destructor. More... | |
![]() | |
void | DisplayInfo () |
Display file information in the standard output stream (stdout) More... | |
openshot::ClipBase * | GetClip () |
Parent clip object of this reader (which can be unparented and NULL) More... | |
ReaderBase () | |
Constructor for the base reader, where many things are initialized. More... | |
void | SetClip (openshot::ClipBase *clip) |
Set parent clip object of this reader. More... | |
virtual | ~ReaderBase ()=default |
Public Attributes | |
bool | enable_seek |
CacheMemory | final_cache |
Final cache object used to hold final frames. More... | |
![]() | |
openshot::ReaderInfo | info |
Information about the current media file. More... | |
Additional Inherited Members | |
![]() | |
juce::CriticalSection | getFrameCriticalSection |
Section lock for multiple threads. More... | |
openshot::ClipBase * | parent |
juce::CriticalSection | processingCriticalSection |
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 94 of file FFmpegReader.h.
FFmpegReader::FFmpegReader | ( | std::string | path | ) |
Constructor for FFmpegReader. This automatically opens the media file and loads frame 1, or it throws one of the following exceptions.
Definition at line 86 of file FFmpegReader.cpp.
FFmpegReader::FFmpegReader | ( | std::string | path, |
bool | inspect_reader | ||
) |
Constructor for FFmpegReader. This only opens the media file to inspect its properties if inspect_reader=true. When not inspecting the media file, it's much faster, and useful when you are inflating the object using JSON after instantiating it.
Definition at line 108 of file FFmpegReader.cpp.
|
virtual |
Destructor.
Definition at line 132 of file FFmpegReader.cpp.
|
virtual |
Close File.
Implements openshot::ReaderBase.
Definition at line 577 of file FFmpegReader.cpp.
Referenced by FFmpegReader(), GetFrame(), SetJsonValue(), and ~FFmpegReader().
|
inlinevirtual |
Get the cache object used by this reader.
Implements openshot::ReaderBase.
Definition at line 253 of file FFmpegReader.h.
|
virtual |
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 810 of file FFmpegReader.cpp.
|
inlinevirtual |
Determine if reader is open or closed.
Implements openshot::ReaderBase.
Definition at line 262 of file FFmpegReader.h.
|
virtual |
Get and Set JSON methods.
Generate JSON string of this object
Implements openshot::ReaderBase.
Definition at line 2430 of file FFmpegReader.cpp.
|
virtual |
Generate Json::JsonValue for this object.
Implements openshot::ReaderBase.
Definition at line 2437 of file FFmpegReader.cpp.
Referenced by Json().
|
inlinevirtual |
Return the type name of the class.
Implements openshot::ReaderBase.
Definition at line 265 of file FFmpegReader.h.
|
virtual |
Open File - which is called by the constructor automatically.
Implements openshot::ReaderBase.
Definition at line 239 of file FFmpegReader.cpp.
Referenced by FFmpegReader(), GetFrame(), and SetJsonValue().
|
virtual |
Load JSON string into this object.
Implements openshot::ReaderBase.
Definition at line 2449 of file FFmpegReader.cpp.
|
virtual |
Load Json::JsonValue into this object.
Implements openshot::ReaderBase.
Definition at line 2476 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 235 of file FFmpegReader.h.
Referenced by GetFrame().
CacheMemory openshot::FFmpegReader::final_cache |
Final cache object used to hold final frames.
Definition at line 231 of file FFmpegReader.h.
Referenced by FFmpegReader(), and GetFrame().