Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Raspberry Pi server performance #2172

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions src/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,52 @@ namespace video {
},
LIMITED_GOP_SIZE | PARALLEL_ENCODING | SINGLE_SLICE_ONLY | NO_RC_BUF_LIMIT
};

static encoder_t v4l2m2m {
"V4L2M2M"sv,
std::make_unique<encoder_platform_formats_avcodec>(
AV_HWDEVICE_TYPE_NONE, AV_HWDEVICE_TYPE_NONE,
AV_PIX_FMT_NONE,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10,
nullptr),
{
// Common options
{},
// SDR-specific options
{},
// HDR-specific options
{},
// Fallback options
{},
std::make_optional<encoder_t::option_t>("qp"s, &config::video.qp),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the encoder really not support CBR/VBR bitrate control? QP shouldn't be provided if CBR or VBR is available.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, I was just copying what the others did as a first step. I'll give it a try.

"av1_v4l2m2m"s,
},
{
// Common options
{},
// SDR-specific options
{},
// HDR-specific options
{},
// Fallback options
{},
std::make_optional<encoder_t::option_t>("qp"s, &config::video.qp),
"hevc_v4l2m2m"s,
},
{
// Common options
{},
// SDR-specific options
{},
// HDR-specific options
{},
// Fallback options
{},
std::make_optional<encoder_t::option_t>("qp"s, &config::video.qp),
"h264_v4l2m2m"s,
},
PARALLEL_ENCODING
};
#endif

#ifdef __APPLE__
Expand Down Expand Up @@ -1065,6 +1111,7 @@ namespace video {
#endif
#ifdef __linux__
&vaapi,
&v4l2m2m,
#endif
#ifdef __APPLE__
&videotoolbox,
Expand Down