Add VP9 stream type, but VP9 encoding does not work (1-pass VP9 encoder in libvpx is broken)

This commit is contained in:
Jaroslav Kysela 2014-10-15 12:05:20 +02:00
parent 8d1eb5b6c6
commit bce2c52e63
6 changed files with 21 additions and 7 deletions

View file

@ -46,7 +46,7 @@ extern const idclass_t esfilter_class_other;
#define ESF_MASK_VIDEO \
(SCT_MASK(SCT_MPEG2VIDEO) | SCT_MASK(SCT_H264) | SCT_MASK(SCT_VP8) | \
SCT_MASK(SCT_HEVC))
SCT_MASK(SCT_HEVC) | SCT_MASK(SCT_VP9))
#define ESF_MASK_AUDIO \
(SCT_MASK(SCT_MPEG2AUDIO) | SCT_MASK(SCT_AC3) | SCT_MASK(SCT_AAC) | \

View file

@ -65,6 +65,9 @@ streaming_component_type2codec_id(streaming_component_type_t type)
case SCT_VP8:
codec_id = AV_CODEC_ID_VP8;
break;
case SCT_VP9:
codec_id = AV_CODEC_ID_VP9;
break;
case SCT_AC3:
codec_id = AV_CODEC_ID_AC3;
break;
@ -116,6 +119,9 @@ codec_id2streaming_component_type(enum AVCodecID id)
case AV_CODEC_ID_VP8:
type = SCT_VP8;
break;
case AV_CODEC_ID_VP9:
type = SCT_VP9;
break;
case AV_CODEC_ID_AC3:
type = SCT_AC3;
break;

View file

@ -274,6 +274,11 @@ mk_build_tracks(mk_mux_t *mkm, const streaming_start_t *ss)
codec_id = "V_VP8";
break;
case SCT_VP9:
tracktype = 1;
codec_id = "V_VP9";
break;
case SCT_HEVC:
tvherror("mkv", "HEVC (H265) codec is not suppored for Matroska muxer (work in progress)");
continue;

View file

@ -121,10 +121,11 @@ typedef struct transcoder {
#define WORKING_ENCODER(x) (x == AV_CODEC_ID_H264 || x == AV_CODEC_ID_MPEG2VIDEO || \
x == AV_CODEC_ID_VP8 || x == AV_CODEC_ID_AAC || \
x == AV_CODEC_ID_MP2 || x == AV_CODEC_ID_VORBIS)
#define WORKING_ENCODER(x) \
((x) == AV_CODEC_ID_H264 || (x) == AV_CODEC_ID_MPEG2VIDEO || \
(x) == AV_CODEC_ID_VP8 || /* (x) == AV_CODEC_ID_VP9 || */ \
(x) == AV_CODEC_ID_AAC || \
(x) == AV_CODEC_ID_MP2 || (x) == AV_CODEC_ID_VORBIS)
/**
*
@ -1420,7 +1421,7 @@ transcoder_init_video(transcoder_t *t, streaming_start_component_t *ssc)
vs->vid_ictx->thread_count = sysconf(_SC_NPROCESSORS_ONLN);
vs->vid_octx->thread_count = sysconf(_SC_NPROCESSORS_ONLN);
vs->vid_dec_frame = avcodec_alloc_frame();
vs->vid_enc_frame = avcodec_alloc_frame();

View file

@ -501,6 +501,7 @@ static struct strtab streamtypetab[] = {
{ "VP8", SCT_VP8 },
{ "VORBIS", SCT_VORBIS },
{ "HEVC", SCT_HEVC },
{ "VP9", SCT_VP9 },
};
/**

View file

@ -230,13 +230,14 @@ typedef enum {
SCT_VP8,
SCT_VORBIS,
SCT_HEVC,
SCT_VP9,
SCT_LAST = SCT_HEVC
} streaming_component_type_t;
#define SCT_MASK(t) (1 << (t))
#define SCT_ISVIDEO(t) ((t) == SCT_MPEG2VIDEO || (t) == SCT_H264 || \
(t) == SCT_VP8 || (t) == SCT_HEVC)
(t) == SCT_VP8 || (t) == SCT_HEVC || (t) == SCT_VP9)
#define SCT_ISAUDIO(t) ((t) == SCT_MPEG2AUDIO || (t) == SCT_AC3 || \
(t) == SCT_AAC || (t) == SCT_MP4A || \