transcode: enable experimental codecs
This commit is contained in:
parent
3ba4597ce2
commit
022fcd195f
3 changed files with 16 additions and 7 deletions
|
@ -135,8 +135,11 @@ static AVCodecContext *
|
|||
avcodec_alloc_context3_tvh(const AVCodec *codec)
|
||||
{
|
||||
AVCodecContext *ctx = avcodec_alloc_context3(codec);
|
||||
if (ctx)
|
||||
if (ctx) {
|
||||
ctx->codec_id = AV_CODEC_ID_NONE;
|
||||
ctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
|
||||
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
@ -205,7 +208,6 @@ transcoder_get_encoder(streaming_component_type_t ty)
|
|||
streaming_component_type2txt(ty));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
tvhlog(LOG_DEBUG, "transcode", "Using encoder %s", codec->name);
|
||||
|
||||
return codec;
|
||||
|
@ -1933,7 +1935,7 @@ transcoder_destroy(streaming_target_t *st)
|
|||
*
|
||||
*/
|
||||
htsmsg_t *
|
||||
transcoder_get_capabilities(void)
|
||||
transcoder_get_capabilities(int experimental)
|
||||
{
|
||||
AVCodec *p = NULL;
|
||||
streaming_component_type_t sct;
|
||||
|
@ -1947,6 +1949,9 @@ transcoder_get_capabilities(void)
|
|||
if (!WORKING_ENCODER(p->id))
|
||||
continue;
|
||||
|
||||
if ((p->capabilities & CODEC_CAP_EXPERIMENTAL) && !experimental)
|
||||
continue;
|
||||
|
||||
sct = codec_id2streaming_component_type(p->id);
|
||||
if (sct == SCT_NONE)
|
||||
continue;
|
||||
|
|
|
@ -36,7 +36,7 @@ extern uint32_t transcoding_enabled;
|
|||
streaming_target_t *transcoder_create (streaming_target_t *output);
|
||||
void transcoder_destroy(streaming_target_t *tr);
|
||||
|
||||
htsmsg_t *transcoder_get_capabilities(void);
|
||||
htsmsg_t *transcoder_get_capabilities(int experimental);
|
||||
void transcoder_set_properties (streaming_target_t *tr,
|
||||
transcoder_props_t *prop);
|
||||
|
||||
|
|
|
@ -505,6 +505,8 @@ profile_matroska_builder(void)
|
|||
|
||||
#if ENABLE_LIBAV
|
||||
|
||||
static int profile_transcode_experimental_codecs = 1;
|
||||
|
||||
/*
|
||||
* Transcoding + packet-like muxers
|
||||
*/
|
||||
|
@ -600,7 +602,7 @@ profile_class_vcodec_list(void *o)
|
|||
htsmsg_add_s32(e, "key", 0);
|
||||
htsmsg_add_str(e, "val", "Copy codec type");
|
||||
htsmsg_add_msg(l, NULL, e);
|
||||
c = transcoder_get_capabilities();
|
||||
c = transcoder_get_capabilities(profile_transcode_experimental_codecs);
|
||||
for (i = 0; i <= SCT_LAST; i++) {
|
||||
if (!SCT_ISVIDEO(i))
|
||||
continue;
|
||||
|
@ -629,7 +631,7 @@ profile_class_acodec_list(void *o)
|
|||
htsmsg_add_s32(e, "key", 0);
|
||||
htsmsg_add_str(e, "val", "Copy codec type");
|
||||
htsmsg_add_msg(l, NULL, e);
|
||||
c = transcoder_get_capabilities();
|
||||
c = transcoder_get_capabilities(profile_transcode_experimental_codecs);
|
||||
for (i = 0; i <= SCT_LAST; i++) {
|
||||
if (!SCT_ISAUDIO(i))
|
||||
continue;
|
||||
|
@ -658,7 +660,7 @@ profile_class_scodec_list(void *o)
|
|||
htsmsg_add_s32(e, "key", 0);
|
||||
htsmsg_add_str(e, "val", "Copy codec type");
|
||||
htsmsg_add_msg(l, NULL, e);
|
||||
c = transcoder_get_capabilities();
|
||||
c = transcoder_get_capabilities(profile_transcode_experimental_codecs);
|
||||
for (i = 0; i <= SCT_LAST; i++) {
|
||||
if (!SCT_ISSUBTITLE(i))
|
||||
continue;
|
||||
|
@ -835,6 +837,8 @@ profile_init(void)
|
|||
profile_register(&profile_mpegts_pass_class, profile_mpegts_pass_builder);
|
||||
profile_register(&profile_matroska_class, profile_matroska_builder);
|
||||
#if ENABLE_LIBAV
|
||||
profile_transcode_experimental_codecs =
|
||||
getenv("TVHEADEND_LIBAV_NO_EXPERIMENTAL_CODECS") ? 0 : 1;
|
||||
profile_register(&profile_transcode_class, profile_transcode_builder);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue