ffmpeg_grabber
: An image frame grabber device using ffmpeg to capture images from AVI files.
More...
#include <ffmpeg/FfmpegGrabber.h>
Public Member Functions | |
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 image from the frame grabber. 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 | isRecording (bool &recording_enabled) override |
Check if the recording has been enabled (e.g. More... | |
bool | getRecordingAudioBufferMaxSize (yarp::dev::AudioBufferSize &) override |
bool | getRecordingAudioBufferCurrentSize (yarp::dev::AudioBufferSize &) override |
bool | resetRecordingAudioBuffer () override |
bool | setHWGain (double gain) override |
Sets the hardware gain of the grabbing device (if supported by the hardware) More... | |
bool | setSWGain (double gain) override |
Sets a software gain for the grabbed audio. More... | |
![]() | |
virtual bool | getImage (yarp::sig::ImageOf< yarp::sig::PixelRgb > &image)=0 |
Get an image from the frame grabber. 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 image from the frame grabber. More... | |
![]() | |
virtual | ~IFrameGrabberImageBase () |
Destructor. More... | |
virtual int | height () const =0 |
Return the height of each frame. More... | |
virtual int | width () const =0 |
Return the width of each frame. More... | |
![]() | |
virtual | ~IAudioGrabberSound () |
Destructor. More... | |
virtual bool | getSound (yarp::sig::Sound &sound, size_t min_number_of_samples, size_t max_number_of_samples, double max_samples_timeout_s)=0 |
Get a sound from a device. More... | |
virtual bool | startRecording ()=0 |
Start the recording. More... | |
virtual bool | stopRecording ()=0 |
Stop the recording. More... | |
virtual bool | isRecording (bool &recording_enabled)=0 |
Check if the recording has been enabled (e.g. More... | |
virtual bool | getRecordingAudioBufferMaxSize (yarp::dev::AudioBufferSize &size)=0 |
virtual bool | getRecordingAudioBufferCurrentSize (yarp::dev::AudioBufferSize &size)=0 |
virtual bool | resetRecordingAudioBuffer ()=0 |
virtual bool | setSWGain (double gain)=0 |
Sets a software gain for the grabbed audio. More... | |
virtual bool | setHWGain (double gain)=0 |
Sets the hardware gain of the grabbing device (if supported by the hardware) More... | |
![]() | |
virtual | ~IAudioVisualGrabber () |
Destructor. More... | |
virtual bool | getAudioVisual (yarp::sig::ImageOf< yarp::sig::PixelRgb > &image, yarp::sig::Sound &sound)=0 |
Get an image and sound. More... | |
![]() | |
virtual | ~IAudioVisualStream () |
Destructor. More... | |
virtual bool | hasAudio ()=0 |
virtual bool | hasVideo ()=0 |
virtual bool | hasRawVideo () |
![]() | |
DeviceDriver () | |
DeviceDriver (const DeviceDriver &other)=delete | |
DeviceDriver (DeviceDriver &&other) noexcept=delete | |
DeviceDriver & | operator= (const DeviceDriver &other)=delete |
DeviceDriver & | operator= (DeviceDriver &&other) noexcept=delete |
~DeviceDriver () override | |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. More... | |
bool | close () override |
Close the DeviceDriver. More... | |
virtual std::string | id () const |
Return the id assigned to the PolyDriver. More... | |
virtual void | setId (const std::string &id) |
Set the id for this device. 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 | open (Searchable &config) |
Initialize the object. More... | |
virtual bool | close () |
Shut the object down. More... | |
virtual bool | configure (Searchable &config) |
Change online parameters. More... | |
Protected Member Functions | |
bool | openFirewire (yarp::os::Searchable &config, AVFormatContext **ppFormatCtx) |
bool | openV4L (yarp::os::Searchable &config, AVFormatContext **ppFormatCtx, AVFormatContext **ppFormatCtx2) |
bool | openFile (AVFormatContext **ppFormatCtx, const char *fname) |
Protected Attributes | |
void * | system_resource |
AVDictionary * | formatParamsVideo |
AVDictionary * | formatParamsAudio |
AVFormatContext * | pFormatCtx |
AVFormatContext * | pFormatCtx2 |
AVFormatContext * | pAudioFormatCtx |
AVPacket | packet |
bool | active |
double | startTime |
bool | _hasAudio |
bool | _hasVideo |
bool | needRateControl |
bool | shouldLoop |
double | pace |
bool | imageSync |
std::string | m_uri |
Uri of the images a grabber produces. More... | |
int | m_w |
Width of the images a grabber produces. More... | |
int | m_h |
Height of the images a grabber produces. More... | |
int | m_channels |
int | m_rate |
void * | m_capture |
Opaque ffmpeg structure for image capture. More... | |
ffmpeg_grabber
: An image frame grabber device using ffmpeg to capture images from AVI files.
Definition at line 34 of file FfmpegGrabber.h.
|
inline |
Definition at line 43 of file FfmpegGrabber.h.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 610 of file FfmpegGrabber.cpp.
|
overridevirtual |
Get an image and sound.
image | the image to be filled |
sound | the sound to be filled |
Implements yarp::dev::IAudioVisualGrabber.
Definition at line 660 of file FfmpegGrabber.cpp.
|
overridevirtual |
Get an image from the frame grabber.
image | the image to be filled |
Implements yarp::dev::IFrameGrabberOf< yarp::sig::ImageOf< yarp::sig::PixelRgb > >.
Definition at line 641 of file FfmpegGrabber.cpp.
|
inlineoverridevirtual |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 107 of file FfmpegGrabber.h.
|
inlineoverridevirtual |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 103 of file FfmpegGrabber.h.
|
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).
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. |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 650 of file FfmpegGrabber.cpp.
|
inlineoverridevirtual |
Implements yarp::dev::IAudioVisualStream.
Definition at line 83 of file FfmpegGrabber.h.
|
inlineoverridevirtual |
Implements yarp::dev::IAudioVisualStream.
Definition at line 87 of file FfmpegGrabber.h.
|
inlineoverridevirtual |
Return the height of each frame.
Implements yarp::dev::IFrameGrabberImageBase.
Definition at line 75 of file FfmpegGrabber.h.
|
inlineoverridevirtual |
Check if the recording has been enabled (e.g.
via startRecording()/stopRecording())
recording_enabled | the status of the device |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 99 of file FfmpegGrabber.h.
|
overridevirtual |
Open the DeviceDriver.
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). |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 458 of file FfmpegGrabber.cpp.
|
protected |
Definition at line 450 of file FfmpegGrabber.cpp.
|
protected |
Definition at line 434 of file FfmpegGrabber.cpp.
|
protected |
Definition at line 326 of file FfmpegGrabber.cpp.
|
inlineoverridevirtual |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 111 of file FfmpegGrabber.h.
|
inlineoverridevirtual |
Sets the hardware gain of the grabbing device (if supported by the hardware)
gain | the audio gain (1.0 is the default value) |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 115 of file FfmpegGrabber.h.
|
inlineoverridevirtual |
Sets a software gain for the grabbed audio.
gain | the audio gain (1.0 is the default value) |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 119 of file FfmpegGrabber.h.
|
inlineoverridevirtual |
Start the recording.
Implements yarp::dev::IAudioGrabberSound.
Definition at line 91 of file FfmpegGrabber.h.
|
inlineoverridevirtual |
Stop the recording.
Implements yarp::dev::IAudioGrabberSound.
Definition at line 95 of file FfmpegGrabber.h.
|
inlineoverridevirtual |
Return the width of each frame.
Implements yarp::dev::IFrameGrabberImageBase.
Definition at line 77 of file FfmpegGrabber.h.
|
protected |
Definition at line 134 of file FfmpegGrabber.h.
|
protected |
Definition at line 134 of file FfmpegGrabber.h.
|
protected |
Definition at line 132 of file FfmpegGrabber.h.
|
protected |
Definition at line 127 of file FfmpegGrabber.h.
|
protected |
Definition at line 126 of file FfmpegGrabber.h.
|
protected |
Definition at line 138 of file FfmpegGrabber.h.
|
protected |
Opaque ffmpeg structure for image capture.
Definition at line 152 of file FfmpegGrabber.h.
|
protected |
Definition at line 148 of file FfmpegGrabber.h.
|
protected |
Height of the images a grabber produces.
Definition at line 146 of file FfmpegGrabber.h.
|
protected |
Definition at line 149 of file FfmpegGrabber.h.
|
protected |
Uri of the images a grabber produces.
Definition at line 141 of file FfmpegGrabber.h.
|
protected |
Width of the images a grabber produces.
Definition at line 144 of file FfmpegGrabber.h.
|
protected |
Definition at line 135 of file FfmpegGrabber.h.
|
protected |
Definition at line 137 of file FfmpegGrabber.h.
|
protected |
Definition at line 131 of file FfmpegGrabber.h.
|
protected |
Definition at line 130 of file FfmpegGrabber.h.
|
protected |
Definition at line 128 of file FfmpegGrabber.h.
|
protected |
Definition at line 129 of file FfmpegGrabber.h.
|
protected |
Definition at line 136 of file FfmpegGrabber.h.
|
protected |
Definition at line 133 of file FfmpegGrabber.h.
|
protected |
Definition at line 124 of file FfmpegGrabber.h.