|
AGXDynamics
2.31.1.0
|
#include <VideoFFMPEGPipeCapture.h>
Inheritance diagram for agxOSG::VideoFFMPEGPipeCapture:Classes | |
| struct | CodecHash |
Public Types | |
| typedef agx::HashTable< OutputCodec, agx::String, CodecHash > | CodecStringConversionMap |
| Map for storing codec string conversion for FFMPEG. More... | |
| enum | OutputCodec : agx::UInt32 { OutputCodec::H264 = 0, OutputCodec::H264RGB = 1, OutputCodec::XVID = 2 } |
| Enum describing the different types of codecs that are available. More... | |
Public Member Functions | |
| VideoFFMPEGPipeCapture (agx::UInt width, agx::UInt height, agx::Real fps, agxSDK::Simulation *sim=nullptr) | |
| Constructor. More... | |
| virtual void | apply (osg::RenderInfo &renderInfo) |
| template<typename T > | |
| T * | as () |
| Subclass casting. More... | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. More... | |
| template<typename T > | |
| const T * | asSafe () const |
| DrawCallback (ImageCaptureBase *capture) | |
| bool | getCaptureStarted () const |
| Return whether the capturing is enabled or not. More... | |
| DrawCallback * | getDrawCallback () |
| bool | getEnableLossless () const |
| Get true/false if lossless encoding should be enabled. This will produce videos not supported by older media players. More... | |
| bool | getEnableSyncWithSimulation () const |
| agx::String | getFilename () const |
| Gets the video filename, excluding the postfix. More... | |
| agx::Real | getFps () |
| Return the specified desired frame rate for capture. More... | |
| ImageCaptureBase * | getImageCapture () |
| agx::Real | getImageCaptureFPS () |
| Get the image capture FPS. Synchronize this with video FPS to control the real time factor. (videoFPS / imageFPS == 1.0 for realtime) More... | |
| int | getImageNum () const |
| agx::Vec2u | getImageResolution () const |
| OutputCodec | getOutputCodec () const |
| Get the video codec for the output. Available codecs are given in OutPutCodecs. More... | |
| int | getReferenceCount () const |
| agxSDK::Simulation * | getSimulation () |
| agx::UInt | getVideoCRF () const |
| get the CRF of the video More... | |
| agx::Real | getVideoFPS () const |
| Get the current FPS of the video. More... | |
| agx::String | getVideoPostFix () const |
| Gets the video postfix. More... | |
| bool | hasActiveVideo () const |
| Returns true if we have active video that is being created. More... | |
| void | init () |
| Initializes the FFMPEG process and the named pipes. More... | |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| virtual void | operator() (osg::RenderInfo &renderInfo) const |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
| void | resetTime () |
| void | setEnableLossless (bool enable) |
| Set true/false if lossless encoding should be enabled. This will produce videos not supported by older media players. More... | |
| void | setEnableSyncWithSimulation (bool enableSync) |
| void | setFilename (const agx::String &filename) |
| Sets the filename for the video, excluding the postfix. More... | |
| void | setFps (agx::Real fps) |
| Set the desired frame rate (rate of capture). More... | |
| void | setImageCapture (ImageCaptureBase *ic) |
| void | setImageCaptureFPS (agx::Real imageFPS) |
| Set the image capture FPS. Synchronize this with video FPS to control the real time factor. (videoFPS / imageFPS == 1.0 for realtime) More... | |
| void | setImageResolution (agx::UInt width, agx::UInt height) |
| void | setMaxImages (int i) |
| Set a limit of the maximum number of images that should be captured Set -1 for no limit. More... | |
| void | setOutputVideoCodec (OutputCodec codec) |
| Set the video codec for the output. Available codecs are given in OutPutCodecs. More... | |
| void | setSimulation (agxSDK::Simulation *simulation) |
| void | setVideoCRF (agx::UInt crf) |
| Set the CRF of the video. More... | |
| void | setVideoFPS (agx::Real videoFPS) |
| Set the FPS of the video. More... | |
| void | setVideoPostFix (const agx::String &postFix) |
| Sets the video postfix. More... | |
| virtual void | startCapture (int startImageNumber=0) |
| Enable/disable capturing. More... | |
| virtual bool | stopCapture () |
| Return false if stopping an already stopped capture process. More... | |
| bool | stopProcess () |
| Stops the ffmpeg process and finalizes the video file, allowing a new video capture to be started using startCapture(). More... | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
Static Public Member Functions | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Public Attributes | |
| static CodecStringConversionMap | OutputCodecStrings |
Protected Member Functions | |
| virtual | ~VideoFFMPEGPipeCapture () |
| void | allocateObserverVector () const |
| void | closeExternalFFMPEGProcess () |
| void | deleteUsingDeleteHandler () const |
| agx::String | generatePipeName () const |
| agx::String | getCompleteFileName () const |
| agx::String | getFFMPEGBinaryPath () const |
| agx::String | getPipeName () const |
| void | setCaptureStarted (bool f) |
| void | shutdown () |
| void | startExternalFFMPEGProcess () |
Static Protected Member Functions | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More... | |
Protected Attributes | |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Definition at line 35 of file VideoFFMPEGPipeCapture.h.
| typedef agx::HashTable<OutputCodec, agx::String, CodecHash> agxOSG::VideoFFMPEGPipeCapture::CodecStringConversionMap |
Map for storing codec string conversion for FFMPEG.
Definition at line 59 of file VideoFFMPEGPipeCapture.h.
|
strong |
Enum describing the different types of codecs that are available.
| Enumerator | |
|---|---|
| H264 | |
| H264RGB | |
| XVID | |
Definition at line 41 of file VideoFFMPEGPipeCapture.h.
| agxOSG::VideoFFMPEGPipeCapture::VideoFFMPEGPipeCapture | ( | agx::UInt | width, |
| agx::UInt | height, | ||
| agx::Real | fps, | ||
| agxSDK::Simulation * | sim = nullptr |
||
| ) |
Constructor.
| width | The width of the finalized video |
| height | The height of the finalized video |
| fps | The video FPS |
| sim | attached simulation, used for timestep synchronization |
|
protectedvirtual |
|
protectedinherited |
|
virtualinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
protected |
|
protectedinherited |
|
inherited |
|
protected |
|
inherited |
Return whether the capturing is enabled or not.
|
protected |
|
staticprotectedinherited |
|
inherited |
| bool agxOSG::VideoFFMPEGPipeCapture::getEnableLossless | ( | ) | const |
Get true/false if lossless encoding should be enabled. This will produce videos not supported by older media players.
|
inherited |
|
protected |
| agx::String agxOSG::VideoFFMPEGPipeCapture::getFilename | ( | ) | const |
Gets the video filename, excluding the postfix.
|
inherited |
Return the specified desired frame rate for capture.
|
inherited |
| agx::Real agxOSG::VideoFFMPEGPipeCapture::getImageCaptureFPS | ( | ) |
Get the image capture FPS. Synchronize this with video FPS to control the real time factor. (videoFPS / imageFPS == 1.0 for realtime)
|
inherited |
|
inherited |
| OutputCodec agxOSG::VideoFFMPEGPipeCapture::getOutputCodec | ( | ) | const |
Get the video codec for the output. Available codecs are given in OutPutCodecs.
|
protected |
|
inherited |
|
inherited |
| agx::UInt agxOSG::VideoFFMPEGPipeCapture::getVideoCRF | ( | ) | const |
get the CRF of the video
| agx::Real agxOSG::VideoFFMPEGPipeCapture::getVideoFPS | ( | ) | const |
Get the current FPS of the video.
| agx::String agxOSG::VideoFFMPEGPipeCapture::getVideoPostFix | ( | ) | const |
Gets the video postfix.
| bool agxOSG::VideoFFMPEGPipeCapture::hasActiveVideo | ( | ) | const |
Returns true if we have active video that is being created.
| void agxOSG::VideoFFMPEGPipeCapture::init | ( | ) |
Initializes the FFMPEG process and the named pipes.
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::EntityStorage::getInstances(), and agx::Object::getResource().
|
virtualinherited |
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
|
inherited |
|
protectedinherited |
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
| void agxOSG::VideoFFMPEGPipeCapture::setEnableLossless | ( | bool | enable | ) |
Set true/false if lossless encoding should be enabled. This will produce videos not supported by older media players.
|
inherited |
| void agxOSG::VideoFFMPEGPipeCapture::setFilename | ( | const agx::String & | filename | ) |
Sets the filename for the video, excluding the postfix.
Set the desired frame rate (rate of capture).
|
inherited |
Set the image capture FPS. Synchronize this with video FPS to control the real time factor. (videoFPS / imageFPS == 1.0 for realtime)
|
inherited |
Set a limit of the maximum number of images that should be captured Set -1 for no limit.
| void agxOSG::VideoFFMPEGPipeCapture::setOutputVideoCodec | ( | OutputCodec | codec | ) |
Set the video codec for the output. Available codecs are given in OutPutCodecs.
|
inherited |
| void agxOSG::VideoFFMPEGPipeCapture::setVideoPostFix | ( | const agx::String & | postFix | ) |
Sets the video postfix.
|
protectedinherited |
|
virtualinherited |
Enable/disable capturing.
|
protected |
|
virtualinherited |
Return false if stopping an already stopped capture process.
| bool agxOSG::VideoFFMPEGPipeCapture::stopProcess | ( | ) |
Stops the ffmpeg process and finalizes the video file, allowing a new video capture to be started using startCapture().
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
|
staticinherited |
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
static |
Definition at line 60 of file VideoFFMPEGPipeCapture.h.