7#ifndef FfmpegGrabber_INC
8#define FfmpegGrabber_INC
13#include <libavcodec/avcodec.h>
14#include <libavformat/avformat.h>
59 bool close()
override;
63 bool getSound(
yarp::sig::Sound& sound,
size_t min_number_of_samples,
size_t max_number_of_samples,
double max_samples_timeout_s)
override;
144 AVFormatContext **ppFormatCtx);
147 AVFormatContext **ppFormatCtx,
148 AVFormatContext **ppFormatCtx2);
150 bool openFile(AVFormatContext **ppFormatCtx,
This class is the parameters parser for class FfmpegGrabber.
ffmpeg_grabber: An image frame grabber device using ffmpeg to capture images from AVI files.
bool openV4L(yarp::os::Searchable &config, AVFormatContext **ppFormatCtx, AVFormatContext **ppFormatCtx2)
int m_w
Width of the images a grabber produces.
bool getRecordingAudioBufferCurrentSize(yarp::sig::AudioBufferSize &) override
bool openFile(AVFormatContext **ppFormatCtx, const char *fname)
int m_h
Height of the images a grabber produces.
bool getRecordingAudioBufferMaxSize(yarp::sig::AudioBufferSize &) override
bool openFirewire(yarp::os::Searchable &config, AVFormatContext **ppFormatCtx)
bool setSWGain(double gain) override
Sets a software gain for the grabbed audio.
bool setHWGain(double gain) override
Sets the hardware gain of the grabbing device (if supported by the hardware)
int height() const override
Return the height of each frame.
AVFormatContext * pAudioFormatCtx
bool resetRecordingAudioBuffer() override
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.
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override
Get an image from the frame grabber.
bool stopRecording() override
Stop the recording.
int width() const override
Return the width of each frame.
bool startRecording() override
Start the recording.
bool isRecording(bool &recording_enabled) override
Check if the recording has been enabled (e.g.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
AVDictionary * formatParamsAudio
AVFormatContext * pFormatCtx2
std::string m_uri
Uri of the images a grabber produces.
virtual bool getAudioVisual(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image, yarp::sig::Sound &sound) override
Get an image and sound.
AVFormatContext * pFormatCtx
AVDictionary * formatParamsVideo
void * m_capture
Opaque ffmpeg structure for image capture.
bool close() override
Close the DeviceDriver.
Interface implemented by all device drivers.
Read a YARP-format sound block from a device.
Read a YARP-format image and sound from a device.
A base class for nested structures that can be searched.
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.