ffmpeg_grabber: An image frame grabber device using ffmpeg to capture images from AVI files.
More...
#include <ffmpeg/FfmpegGrabber.h>
|
| | FfmpegGrabber () |
| |
| bool | open (yarp::os::Searchable &config) override |
| | Open the DeviceDriver. More...
|
| |
| bool | close () override |
| | Close the DeviceDriver. More...
|
| |
| bool | getImage (yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override |
| | Get an rgb image from the frame grabber, if required demosaicking/color reconstruction is applied. More...
|
| |
| bool | getSound (yarp::sig::Sound &sound, size_t min_number_of_samples, size_t max_number_of_samples, double max_samples_timeout_s) override |
| | Get a sound from a device. More...
|
| |
| int | height () const override |
| | Return the height of each frame. More...
|
| |
| int | width () const override |
| | Return the width of each frame. More...
|
| |
| virtual bool | getAudioVisual (yarp::sig::ImageOf< yarp::sig::PixelRgb > &image, yarp::sig::Sound &sound) override |
| | Get an image and sound. More...
|
| |
| bool | hasAudio () override |
| |
| bool | hasVideo () override |
| |
| bool | startRecording () override |
| | Start the recording. More...
|
| |
| bool | stopRecording () override |
| | Stop the recording. More...
|
| |
| bool | getRecordingAudioBufferMaxSize (yarp::dev::AudioBufferSize &) override |
| |
| bool | getRecordingAudioBufferCurrentSize (yarp::dev::AudioBufferSize &) override |
| |
| bool | resetRecordingAudioBuffer () override |
| |
| virtual | ~IFrameGrabberImage () |
| | Destructor. More...
|
| |
| virtual bool | getImageCrop (cropType_id_t cropType, yarp::sig::VectorOf< std::pair< int, int > > vertices, yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) |
| | Get a crop of the rgb image from the frame grabber, if required demosaicking/color reconstruction is applied. More...
|
| |
| virtual | ~IAudioGrabberSound () |
| | Destructor. More...
|
| |
| virtual | ~IAudioVisualGrabber () |
| | Destructor. More...
|
| |
| virtual | ~IAudioVisualStream () |
| | Destructor. More...
|
| |
| virtual bool | hasRawVideo () |
| |
| | ~DeviceDriver () override=default |
| | Destructor. More...
|
| |
| template<class T > |
| bool | view (T *&x) |
| | Get an interface to the device driver. More...
|
| |
| virtual DeviceDriver * | getImplementation () |
| | Some drivers are bureaucrats, pointing at others. More...
|
| |
| virtual | ~IConfig () |
| | Destructor. More...
|
| |
| virtual bool | configure (Searchable &config) |
| | Change online parameters. More...
|
| |
ffmpeg_grabber: An image frame grabber device using ffmpeg to capture images from AVI files.
Definition at line 36 of file FfmpegGrabber.h.
◆ FfmpegGrabber()
| FfmpegGrabber::FfmpegGrabber |
( |
| ) |
|
|
inline |
◆ close()
| bool FfmpegGrabber::close |
( |
| ) |
|
|
overridevirtual |
◆ getAudioVisual()
◆ getImage()
Get an rgb image from the frame grabber, if required demosaicking/color reconstruction is applied.
- Parameters
-
| image | the image to be filled |
- Returns
- true/false upon success/failure
Implements yarp::dev::IFrameGrabberImage.
Definition at line 638 of file FfmpegGrabber.cpp.
◆ getRecordingAudioBufferCurrentSize()
◆ getRecordingAudioBufferMaxSize()
◆ getSound()
| bool FfmpegGrabber::getSound |
( |
yarp::sig::Sound & |
sound, |
|
|
size_t |
min_number_of_samples, |
|
|
size_t |
max_number_of_samples, |
|
|
double |
max_samples_timeout_s |
|
) |
| |
|
overridevirtual |
Get a sound from a device.
Examples: getSound(s, 0, 100, 0.1); returns a sound whose size can vary between 0 and 100, with a maximum blocking time of 0.1 getSound(s, 100, 100, 0.0); returns a sound with exact size of 100. It may block forever (more specifically, until sound size is at least 100). getSound(s, 100, 100000, 0.0); returns a sound with a minimum size of 0, while trying to transfer all the internal buffer. It may block forever (more specifically, until sound size is at least 100).
- Parameters
-
| sound | the sound to be filled |
| min_number_of_samples. | The function will block until the driver is able to collect at least min_number_of_samples. If set to zero, the function may return empty sounds. |
| max_number_of_samples. | The function will block until the driver is either able to collect max_number_of_samples or the timeout expires. |
| max_samples_timeout_s. | The timeout (in seconds) to retrieve max_number_of_samples. |
- Returns
- true upon success, false for an invalid set of parameters, such as max_number_of_samples<min_number_of_samples, etc.
Implements yarp::dev::IAudioGrabberSound.
Definition at line 647 of file FfmpegGrabber.cpp.
◆ hasAudio()
| bool FfmpegGrabber::hasAudio |
( |
| ) |
|
|
inlineoverridevirtual |
◆ hasVideo()
| bool FfmpegGrabber::hasVideo |
( |
| ) |
|
|
inlineoverridevirtual |
◆ height()
| int FfmpegGrabber::height |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ open()
Open the DeviceDriver.
- Parameters
-
| config | is a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device). |
- Returns
- true/false upon success/failure
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 459 of file FfmpegGrabber.cpp.
◆ openFile()
| bool FfmpegGrabber::openFile |
( |
AVFormatContext ** |
ppFormatCtx, |
|
|
const char * |
fname |
|
) |
| |
|
protected |
◆ openFirewire()
◆ openV4L()
| bool FfmpegGrabber::openV4L |
( |
yarp::os::Searchable & |
config, |
|
|
AVFormatContext ** |
ppFormatCtx, |
|
|
AVFormatContext ** |
ppFormatCtx2 |
|
) |
| |
|
protected |
◆ resetRecordingAudioBuffer()
| bool FfmpegGrabber::resetRecordingAudioBuffer |
( |
| ) |
|
|
inlineoverridevirtual |
◆ startRecording()
| bool FfmpegGrabber::startRecording |
( |
| ) |
|
|
inlineoverridevirtual |
◆ stopRecording()
| bool FfmpegGrabber::stopRecording |
( |
| ) |
|
|
inlineoverridevirtual |
◆ width()
| int FfmpegGrabber::width |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ _hasAudio
| bool FfmpegGrabber::_hasAudio |
|
protected |
◆ _hasVideo
| bool FfmpegGrabber::_hasVideo |
|
protected |
◆ active
| bool FfmpegGrabber::active |
|
protected |
◆ formatParamsAudio
| AVDictionary* FfmpegGrabber::formatParamsAudio |
|
protected |
◆ formatParamsVideo
| AVDictionary* FfmpegGrabber::formatParamsVideo |
|
protected |
◆ imageSync
| bool FfmpegGrabber::imageSync |
|
protected |
◆ m_capture
| void* FfmpegGrabber::m_capture |
|
protected |
Opaque ffmpeg structure for image capture.
Definition at line 142 of file FfmpegGrabber.h.
◆ m_channels
| int FfmpegGrabber::m_channels |
|
protected |
◆ m_h
◆ m_rate
| int FfmpegGrabber::m_rate |
|
protected |
◆ m_uri
| std::string FfmpegGrabber::m_uri |
|
protected |
◆ m_w
◆ needRateControl
| bool FfmpegGrabber::needRateControl |
|
protected |
◆ pace
| double FfmpegGrabber::pace |
|
protected |
◆ packet
| AVPacket FfmpegGrabber::packet |
|
protected |
◆ pAudioFormatCtx
| AVFormatContext* FfmpegGrabber::pAudioFormatCtx |
|
protected |
◆ pFormatCtx
| AVFormatContext* FfmpegGrabber::pFormatCtx |
|
protected |
◆ pFormatCtx2
| AVFormatContext* FfmpegGrabber::pFormatCtx2 |
|
protected |
◆ shouldLoop
| bool FfmpegGrabber::shouldLoop |
|
protected |
◆ startTime
| double FfmpegGrabber::startTime |
|
protected |
◆ system_resource
| void* FfmpegGrabber::system_resource |
|
protected |
The documentation for this class was generated from the following files: