Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add VP9 stream type, but VP9 encoding does not work (1-pass VP9 encod…
…er in libvpx is broken)
  • Loading branch information
perexg committed Oct 15, 2014
1 parent 8d1eb5b commit bce2c52
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/esfilter.h
Expand Up @@ -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) | \
Expand Down
6 changes: 6 additions & 0 deletions src/libav.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/muxer/tvh/mkmux.c
Expand Up @@ -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;
Expand Down
11 changes: 6 additions & 5 deletions src/plumbing/transcoding.c
Expand Up @@ -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)

/**
*
Expand Down Expand Up @@ -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();

Expand Down
1 change: 1 addition & 0 deletions src/streaming.c
Expand Up @@ -501,6 +501,7 @@ static struct strtab streamtypetab[] = {
{ "VP8", SCT_VP8 },
{ "VORBIS", SCT_VORBIS },
{ "HEVC", SCT_HEVC },
{ "VP9", SCT_VP9 },
};

/**
Expand Down
3 changes: 2 additions & 1 deletion src/tvheadend.h
Expand Up @@ -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 || \
Expand Down

0 comments on commit bce2c52

Please sign in to comment.