mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
[record] add more recording options
This commit is contained in:
parent
3ca4ac2a21
commit
f9c12866bf
@ -375,6 +375,15 @@ static void setting_get_string_representation_video_record_quality(rarch_setting
|
||||
case 4:
|
||||
strlcpy(s, "Lossless", len);
|
||||
break;
|
||||
case 5:
|
||||
strlcpy(s, "WebM Fast", len);
|
||||
break;
|
||||
case 6:
|
||||
strlcpy(s, "WebM High Quality", len);
|
||||
break;
|
||||
case 7:
|
||||
strlcpy(s, "GIF", len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -6689,7 +6698,7 @@ static bool setting_append_list(
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
(*list)[list_info->index - 1].get_string_representation =
|
||||
&setting_get_string_representation_video_record_quality;
|
||||
menu_settings_list_current_add_range(list, list_info, RECORD_CONFIG_TYPE_RECORDING_CUSTOM, RECORD_CONFIG_TYPE_RECORDING_LOSSLESS_QUALITY, 1, true, true);
|
||||
menu_settings_list_current_add_range(list, list_info, RECORD_CONFIG_TYPE_RECORDING_CUSTOM, RECORD_CONFIG_TYPE_RECORDING_GIF, 1, true, true);
|
||||
|
||||
CONFIG_PATH(
|
||||
list, list_info,
|
||||
|
@ -97,6 +97,14 @@ extern "C" {
|
||||
#define PIX_FMT_BGR24 AV_PIX_FMT_BGR24
|
||||
#endif
|
||||
|
||||
#ifndef PIX_FMT_RGB24
|
||||
#define PIX_FMT_RGB24 AV_PIX_FMT_RGB24
|
||||
#endif
|
||||
|
||||
#ifndef PIX_FMT_RGB8
|
||||
#define PIX_FMT_RGB8 AV_PIX_FMT_RGB8
|
||||
#endif
|
||||
|
||||
#ifndef PIX_FMT_RGB565
|
||||
#define PIX_FMT_RGB565 AV_PIX_FMT_RGB565
|
||||
#endif
|
||||
@ -556,7 +564,7 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
|
||||
{
|
||||
case RECORD_CONFIG_TYPE_RECORDING_LOW_QUALITY:
|
||||
case RECORD_CONFIG_TYPE_STREAMING_LOW_QUALITY:
|
||||
params->threads = 1;
|
||||
params->threads = 2;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
params->audio_global_quality = 75;
|
||||
@ -572,7 +580,7 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
|
||||
break;
|
||||
case RECORD_CONFIG_TYPE_RECORDING_MED_QUALITY:
|
||||
case RECORD_CONFIG_TYPE_STREAMING_MED_QUALITY:
|
||||
params->threads = 1;
|
||||
params->threads = 2;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
params->audio_global_quality = 75;
|
||||
@ -588,7 +596,7 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
|
||||
break;
|
||||
case RECORD_CONFIG_TYPE_RECORDING_HIGH_QUALITY:
|
||||
case RECORD_CONFIG_TYPE_STREAMING_HIGH_QUALITY:
|
||||
params->threads = 1;
|
||||
params->threads = 2;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
params->audio_global_quality = 100;
|
||||
@ -603,10 +611,10 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
|
||||
av_dict_set(¶ms->audio_opts, "audio_global_quality", "100", 0);
|
||||
break;
|
||||
case RECORD_CONFIG_TYPE_RECORDING_LOSSLESS_QUALITY:
|
||||
params->threads = 1;
|
||||
params->threads = 2;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
params->audio_global_quality = 100;
|
||||
params->audio_global_quality = 80;
|
||||
params->out_pix_fmt = PIX_FMT_BGR24;
|
||||
|
||||
strlcpy(params->vcodec, "libx264rgb", sizeof(params->vcodec));
|
||||
@ -615,10 +623,51 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
|
||||
av_dict_set(¶ms->video_opts, "preset", "medium", 0);
|
||||
av_dict_set(¶ms->video_opts, "tune", "animation", 0);
|
||||
av_dict_set(¶ms->video_opts, "crf", "0", 0);
|
||||
av_dict_set(¶ms->audio_opts, "audio_global_quality", "100", 0);
|
||||
av_dict_set(¶ms->audio_opts, "audio_global_quality", "80", 0);
|
||||
break;
|
||||
case RECORD_CONFIG_TYPE_RECORDING_WEBM_FAST:
|
||||
params->threads = 2;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
params->audio_global_quality = 50;
|
||||
params->out_pix_fmt = PIX_FMT_YUV420P;
|
||||
|
||||
strlcpy(params->vcodec, "libvpx", sizeof(params->vcodec));
|
||||
strlcpy(params->acodec, "libopus", sizeof(params->acodec));
|
||||
|
||||
av_dict_set(¶ms->video_opts, "deadline", "realtime", 0);
|
||||
av_dict_set(¶ms->video_opts, "crf", "14", 0);
|
||||
av_dict_set(¶ms->audio_opts, "audio_global_quality", "50", 0);
|
||||
break;
|
||||
case RECORD_CONFIG_TYPE_RECORDING_WEBM_HIGH_QUALITY:
|
||||
params->threads = 2;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
params->audio_global_quality = 75;
|
||||
params->out_pix_fmt = PIX_FMT_YUV420P;
|
||||
|
||||
strlcpy(params->vcodec, "libvpx", sizeof(params->vcodec));
|
||||
strlcpy(params->acodec, "libopus", sizeof(params->acodec));
|
||||
|
||||
av_dict_set(¶ms->video_opts, "deadline", "realtime", 0);
|
||||
av_dict_set(¶ms->video_opts, "crf", "4", 0);
|
||||
av_dict_set(¶ms->audio_opts, "audio_global_quality", "75", 0);
|
||||
break;
|
||||
case RECORD_CONFIG_TYPE_RECORDING_GIF:
|
||||
params->threads = 2;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = false;
|
||||
params->audio_global_quality = 0;
|
||||
params->out_pix_fmt = PIX_FMT_RGB8;
|
||||
|
||||
strlcpy(params->vcodec, "gif", sizeof(params->vcodec));
|
||||
strlcpy(params->acodec, "", sizeof(params->acodec));
|
||||
|
||||
av_dict_set(¶ms->video_opts, "framerate", "50", 0);
|
||||
av_dict_set(¶ms->audio_opts, "audio_global_quality", "0", 0);
|
||||
break;
|
||||
case RECORD_CONFIG_TYPE_STREAMING_NETPLAY:
|
||||
params->threads = 1;
|
||||
params->threads = 2;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
params->audio_global_quality = 50;
|
||||
@ -645,6 +694,24 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
|
||||
params->scale_factor = 1;
|
||||
strlcpy(params->format, "matroska", sizeof(params->format));
|
||||
}
|
||||
else if (preset >= RECORD_CONFIG_TYPE_RECORDING_WEBM_FAST && settings->uints.video_record_quality < RECORD_CONFIG_TYPE_RECORDING_GIF)
|
||||
{
|
||||
if (!settings->bools.video_gpu_record)
|
||||
params->scale_factor = settings->uints.video_record_scale_factor > 0 ?
|
||||
settings->uints.video_record_scale_factor : 1;
|
||||
else
|
||||
params->scale_factor = 1;
|
||||
strlcpy(params->format, "webm", sizeof(params->format));
|
||||
}
|
||||
else if (preset <= RECORD_CONFIG_TYPE_STREAMING_LOW_QUALITY)
|
||||
{
|
||||
if (!settings->bools.video_gpu_record)
|
||||
params->scale_factor = settings->uints.video_record_scale_factor > 0 ?
|
||||
settings->uints.video_record_scale_factor : 1;
|
||||
else
|
||||
params->scale_factor = 1;
|
||||
strlcpy(params->format, "gif", sizeof(params->format));
|
||||
}
|
||||
else if (preset <= RECORD_CONFIG_TYPE_STREAMING_HIGH_QUALITY)
|
||||
{
|
||||
if (!settings->bools.video_gpu_record)
|
||||
|
@ -366,10 +366,24 @@ bool recording_init(void)
|
||||
else
|
||||
{
|
||||
const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME));
|
||||
fill_str_dated_filename(buf, game_name,
|
||||
"mkv", sizeof(buf));
|
||||
fill_pathname_join(output, global->record.output_dir, buf, sizeof(output));
|
||||
|
||||
if (settings->uints.video_record_quality < RECORD_CONFIG_TYPE_RECORDING_WEBM_FAST)
|
||||
{
|
||||
fill_str_dated_filename(buf, game_name,
|
||||
"mkv", sizeof(buf));
|
||||
fill_pathname_join(output, global->record.output_dir, buf, sizeof(output));
|
||||
}
|
||||
else if (settings->uints.video_record_quality >= RECORD_CONFIG_TYPE_RECORDING_WEBM_FAST && settings->uints.video_record_quality < RECORD_CONFIG_TYPE_RECORDING_GIF)
|
||||
{
|
||||
fill_str_dated_filename(buf, game_name,
|
||||
"webm", sizeof(buf));
|
||||
fill_pathname_join(output, global->record.output_dir, buf, sizeof(output));
|
||||
}
|
||||
else
|
||||
{
|
||||
fill_str_dated_filename(buf, game_name,
|
||||
"gif", sizeof(buf));
|
||||
fill_pathname_join(output, global->record.output_dir, buf, sizeof(output));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,11 +46,15 @@ enum record_config_type
|
||||
RECORD_CONFIG_TYPE_RECORDING_MED_QUALITY,
|
||||
RECORD_CONFIG_TYPE_RECORDING_HIGH_QUALITY,
|
||||
RECORD_CONFIG_TYPE_RECORDING_LOSSLESS_QUALITY,
|
||||
RECORD_CONFIG_TYPE_RECORDING_WEBM_FAST,
|
||||
RECORD_CONFIG_TYPE_RECORDING_WEBM_HIGH_QUALITY,
|
||||
RECORD_CONFIG_TYPE_RECORDING_GIF,
|
||||
RECORD_CONFIG_TYPE_STREAMING_CUSTOM,
|
||||
RECORD_CONFIG_TYPE_STREAMING_LOW_QUALITY,
|
||||
RECORD_CONFIG_TYPE_STREAMING_MED_QUALITY,
|
||||
RECORD_CONFIG_TYPE_STREAMING_HIGH_QUALITY,
|
||||
RECORD_CONFIG_TYPE_STREAMING_NETPLAY
|
||||
|
||||
};
|
||||
|
||||
/* Parameters passed to ffemu_new() */
|
||||
|
Loading…
x
Reference in New Issue
Block a user