Hi,
I tried to execute the sample 10_camera_reording from latest 28.2.1 on TX2 board with built-in camera, but found it could not select the 120FPS mode ?
diff --git a/samples/10_camera_recording/main.cpp b/samples/10_camera_recording/main.cpp
index 6f531b8..432b225 100644
--- a/samples/10_camera_recording/main.cpp
+++ b/samples/10_camera_recording/main.cpp
@@ -47,7 +47,7 @@ using namespace EGLStream;
// Constant configuration.
static const int MAX_ENCODER_FRAMES = 5;
-static const int DEFAULT_FPS = 30;
+static const int DEFAULT_FPS = 120;
static const int Y_INDEX = 0;
static const int START_POS = 32;
static const int FONT_SIZE = 64;
@@ -65,7 +65,7 @@ static const int array_n[8][8] = {
// Configurations which can be overrided by cmdline
static int CAPTURE_TIME = 1; // In seconds.
-static Size2D<uint32_t> STREAM_SIZE (640, 480);
+static Size2D<uint32_t> STREAM_SIZE (1280, 720);
static std::string OUTPUT_FILENAME ("output.h264");
static uint32_t ENCODER_PIXFMT = V4L2_PIX_FMT_H264;
static bool DO_STAT = false;
@@ -367,11 +367,11 @@ bool ConsumerThread::createVideoEncoder()
if (ret < 0)
ORIGINATE_ERROR("Could not set rate control mode");
- ret = m_VideoEncoder->setIFrameInterval(30);
+ ret = m_VideoEncoder->setIFrameInterval(120);
if (ret < 0)
ORIGINATE_ERROR("Could not set I-frame interval");
- ret = m_VideoEncoder->setFrameRate(30, 1);
+ ret = m_VideoEncoder->setFrameRate(120, 1);
if (ret < 0)
ORIGINATE_ERROR("Could not set m_VideoEncoderoder framerate");
@@ -468,6 +468,7 @@ static bool execute()
if (!iStreamSettings)
ORIGINATE_ERROR("Failed to get IOutputStreamSettings interface");
+ iStreamSettings->setCameraDevice(cameraDevices[0]);
iStreamSettings->setPixelFormat(PIXEL_FMT_YCbCr_420_888);
iStreamSettings->setResolution(STREAM_SIZE);
UniqueObj<OutputStream> outputStream(iCaptureSession->createOutputStream(streamSettings.get()));
@@ -490,6 +491,9 @@ static bool execute()
ISourceSettings *iSourceSettings = interface_cast<ISourceSettings>(iRequest->getSourceSettings());
if (!iSourceSettings)
ORIGINATE_ERROR("Failed to get ISourceSettings interface");
+
+ const Range<uint64_t> &frameDurationRange = iSourceSettings->getFrameDurationRange();
+ std::cout << "*Frame Duration Range " << frameDurationRange.min() << ' ' << frameDurationRange.max() << std::endl;
iSourceSettings->setFrameDurationRange(Range<uint64_t>(1e9/DEFAULT_FPS));
// Submit capture requests.
The change printed the supported frame duration range from the ISourceSettings,
*Frame Duration Range 33333334 83333336
So it only supports 30fps :(
Is there anything to be configured ? I noticed the argus_camera would select 1280*720@120 properly, have no idea about why.
Thank you very much.