|
AGX Dynamics 2.42.1.1
|
#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. | |
| enum class | OutputCodec : agx::UInt32 { H264 = 0 , H264RGB = 1 , 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. | |
| bool | getEnableLossless () const |
| Get true/false if lossless encoding should be enabled. This will produce videos not supported by older media players. | |
| agx::String | getFilename () const |
| Gets the video filename, including the extension. | |
| agx::String | getFilenameExtension () const |
| Gets the file extension (without the .) | |
| 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) | |
| OutputCodec | getOutputCodec () const |
| Get the video codec for the output. Available codecs are given in OutPutCodecs. | |
| agx::UInt | getVideoCRF () const |
| get the CRF of the video | |
| agx::Real | getVideoFPS () const |
| Get the current FPS of the video. | |
| bool | hasActiveVideo () const |
| Returns true if we have active video that is being created. | |
| void | init () |
| Initializes the FFMPEG process and the named pipes. | |
| void | setEnableLossless (bool enable) |
| Set true/false if lossless encoding should be enabled. This will produce videos not supported by older media players. | |
| void | setFilename (const agx::String &filename) |
| Sets the filename for the video, including the file extension. | |
| void | setFilenameExtension (const agx::String &extension) |
| Sets the video file extension (without the .) | |
| 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) | |
| void | setOutputVideoCodec (OutputCodec codec) |
| Set the video codec for the output. Available codecs are given in OutPutCodecs. | |
| void | setVideoCRF (agx::UInt crf) |
| Set the CRF of the video. | |
| void | setVideoFPS (agx::Real videoFPS) |
| Set the FPS of the video. | |
| bool | stopProcess () |
| Stops the ffmpeg process and finalizes the video file, allowing a new video capture to be started using startCapture(). | |
Public Member Functions inherited from agxOSG::ImageCaptureBase | |
| ImageCaptureBase (agxSDK::Simulation *sim=nullptr) | |
| virtual void | apply (osg::RenderInfo &renderInfo) |
| DrawCallback (ImageCaptureBase *capture) | |
| bool | getCaptureStarted () const |
| Return whether the capturing is enabled or not. | |
| DrawCallback * | getDrawCallback () |
| bool | getEnableSyncWithSimulation () const |
| agx::Real | getFps () |
| Return the specified desired frame rate for capture. | |
| ImageCaptureBase * | getImageCapture () |
| int | getImageNum () const |
| agx::Vec2u | getImageResolution () const |
| agxSDK::Simulation * | getSimulation () |
| virtual void | operator() (osg::RenderInfo &renderInfo) const |
| void | resetTime () |
| void | setEnableSyncWithSimulation (bool enableSync) |
| void | setFps (agx::Real fps) |
| Set the desired frame rate (rate of capture). | |
| void | setImageCapture (ImageCaptureBase *ic) |
| 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. | |
| void | setSimulation (agxSDK::Simulation *simulation) |
| virtual void | startCapture (int startImageNumber=0) |
| Enable/disable capturing. | |
| virtual bool | stopCapture () |
| Return false if stopping an already stopped capture process. | |
| virtual void | writeImage (osg::Image *image, agx::Index index)=0 |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Static Public Attributes | |
| static CodecStringConversionMap | OutputCodecStrings |
Protected Member Functions | |
| virtual | ~VideoFFMPEGPipeCapture () |
| void | closeExternalFFMPEGProcess () |
| agx::String | generatePipeName () const |
| agx::String | getFFMPEGBinaryPath () const |
| agx::String | getPipeName () const |
| void | startExternalFFMPEGProcess () |
Protected Member Functions inherited from agxOSG::ImageCaptureBase | |
| virtual | ~ImageCaptureBase () |
| void | setCaptureStarted (bool f) |
| void | shutdown () |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Additional Inherited Members | |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| 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 |
|
protected |
|
protected |
| bool agxOSG::VideoFFMPEGPipeCapture::getEnableLossless | ( | ) | const |
Get true/false if lossless encoding should be enabled. This will produce videos not supported by older media players.
|
protected |
| agx::String agxOSG::VideoFFMPEGPipeCapture::getFilename | ( | ) | const |
Gets the video filename, including the extension.
| agx::String agxOSG::VideoFFMPEGPipeCapture::getFilenameExtension | ( | ) | const |
Gets the file extension (without the .)
| 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)
| OutputCodec agxOSG::VideoFFMPEGPipeCapture::getOutputCodec | ( | ) | const |
Get the video codec for the output. Available codecs are given in OutPutCodecs.
|
protected |
| 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.
| 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.
| 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.
| void agxOSG::VideoFFMPEGPipeCapture::setFilename | ( | const agx::String & | filename | ) |
Sets the filename for the video, including the file extension.
| void agxOSG::VideoFFMPEGPipeCapture::setFilenameExtension | ( | const agx::String & | extension | ) |
Sets the video file extension (without the .)
| void agxOSG::VideoFFMPEGPipeCapture::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)
| void agxOSG::VideoFFMPEGPipeCapture::setOutputVideoCodec | ( | OutputCodec | codec | ) |
Set the video codec for the output. Available codecs are given in OutPutCodecs.
| void agxOSG::VideoFFMPEGPipeCapture::setVideoCRF | ( | agx::UInt | crf | ) |
Set the CRF of the video.
| void agxOSG::VideoFFMPEGPipeCapture::setVideoFPS | ( | agx::Real | videoFPS | ) |
Set the FPS of the video.
|
protected |
| bool agxOSG::VideoFFMPEGPipeCapture::stopProcess | ( | ) |
Stops the ffmpeg process and finalizes the video file, allowing a new video capture to be started using startCapture().
|
static |
Definition at line 60 of file VideoFFMPEGPipeCapture.h.