Skip to content
Snippets Groups Projects
Commit 74ff08ca authored by Steve Lhomme's avatar Steve Lhomme
Browse files

chromecast: try to encode with QSV if possible

It will be handled by the GPU so use less resource.
parent 11bd3483
Loading
......@@ -929,6 +929,45 @@ static std::string GetVencVPXOption( sout_stream_t * /* p_stream */,
return "venc=vpx{quality-mode=1}";
}
static std::string GetVencQSVH264Option( sout_stream_t * /* p_stream */,
const video_format_t * /* p_vid */,
int i_quality )
{
std::stringstream ssout;
static const char video_target_usage_quality[] = "quality";
static const char video_target_usage_balanced[] = "balanced";
static const char video_target_usage_speed[] = "speed";
static const char video_bitrate_high[] = "vb=8000000";
static const char video_bitrate_low[] = "vb=3000000";
const char *psz_video_target_usage;
const char *psz_video_bitrate;
switch ( i_quality )
{
case CONVERSION_QUALITY_HIGH:
psz_video_target_usage = video_target_usage_quality;
psz_video_bitrate = video_bitrate_high;
break;
case CONVERSION_QUALITY_MEDIUM:
psz_video_target_usage = video_target_usage_balanced;
psz_video_bitrate = video_bitrate_high;
break;
case CONVERSION_QUALITY_LOW:
psz_video_target_usage = video_target_usage_balanced;
psz_video_bitrate = video_bitrate_low;
break;
default:
case CONVERSION_QUALITY_LOWCPU:
psz_video_target_usage = video_target_usage_speed;
psz_video_bitrate = video_bitrate_low;
break;
}
ssout << "venc=qsv{target-usage=" << psz_video_target_usage <<
"}," << psz_video_bitrate;
return ssout.str();
}
static std::string GetVencX264Option( sout_stream_t * /* p_stream */,
const video_format_t *p_vid,
int i_quality )
......@@ -1008,6 +1047,7 @@ static struct
#ifdef __APPLE__
{ .fcc = VLC_CODEC_H264, .get_opt = GetVencAvcodecVTOption },
#endif
{ .fcc = VLC_CODEC_H264, .get_opt = GetVencQSVH264Option },
{ .fcc = VLC_CODEC_H264, .get_opt = GetVencX264Option },
{ .fcc = VLC_CODEC_VP8, .get_opt = GetVencVPXOption },
{ .fcc = VLC_CODEC_H264, .get_opt = NULL },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment