diff --git a/src/libav.c b/src/libav.c index 956016af..f9e3c29f 100644 --- a/src/libav.c +++ b/src/libav.c @@ -62,6 +62,9 @@ streaming_component_type2codec_id(streaming_component_type_t type) case SCT_MPEG2VIDEO: codec_id = CODEC_ID_MPEG2VIDEO; break; + case SCT_VP8: + codec_id = CODEC_ID_VP8; + break; case SCT_AC3: codec_id = CODEC_ID_AC3; break; @@ -107,6 +110,9 @@ codec_id2streaming_component_type(enum CodecID id) case CODEC_ID_MPEG2VIDEO: type = SCT_MPEG2VIDEO; break; + case CODEC_ID_VP8: + type = SCT_VP8; + break; case CODEC_ID_AC3: type = SCT_AC3; break; diff --git a/src/muxer/tvh/mkmux.c b/src/muxer/tvh/mkmux.c index f641feb7..4b903903 100644 --- a/src/muxer/tvh/mkmux.c +++ b/src/muxer/tvh/mkmux.c @@ -227,6 +227,11 @@ mk_build_tracks(mk_mux_t *mkm, const streaming_start_t *ss) codec_id = "V_MPEG4/ISO/AVC"; break; + case SCT_VP8: + tracktype = 1; + codec_id = "V_VP8"; + break; + case SCT_MPEG2AUDIO: tracktype = 2; codec_id = "A_MPEG/L2"; diff --git a/src/plumbing/transcoding.c b/src/plumbing/transcoding.c index 471696c7..7c9a5276 100644 --- a/src/plumbing/transcoding.c +++ b/src/plumbing/transcoding.c @@ -107,7 +107,8 @@ typedef struct transcoder { #define WORKING_ENCODER(x) (x == CODEC_ID_H264 || x == CODEC_ID_MPEG2VIDEO || \ - x == CODEC_ID_AAC || x == CODEC_ID_MP2) + x == CODEC_ID_VP8 || x == CODEC_ID_AAC || \ + x == CODEC_ID_MP2) uint32_t transcoding_enabled = 0; @@ -532,6 +533,20 @@ transcoder_stream_video(transcoder_stream_t *ts, th_pkt_t *pkt) octx->rc_buffer_size = 2 * octx->rc_max_rate; break; + case SCT_VP8: + octx->codec_id = CODEC_ID_VP8; + octx->pix_fmt = PIX_FMT_YUV420P; + + octx->qmin = 10; + octx->qmax = 20; + + av_dict_set(&opts, "quality", "realtime", 0); + + octx->bit_rate = 3 * octx->width * octx->height; + octx->rc_buffer_size = 8 * 1024 * 224; + octx->rc_max_rate = 2 * octx->bit_rate; + break; + case SCT_H264: octx->codec_id = CODEC_ID_H264; octx->pix_fmt = PIX_FMT_YUV420P; diff --git a/src/psi.c b/src/psi.c index 378cc4c4..5b69d1e9 100644 --- a/src/psi.c +++ b/src/psi.c @@ -945,6 +945,7 @@ static struct strtab streamtypetab[] = { { "TEXTSUB", SCT_TEXTSUB }, { "EAC3", SCT_EAC3 }, { "AAC", SCT_MP4A }, + { "VP8", SCT_VP8 }, }; diff --git a/src/tvheadend.h b/src/tvheadend.h index 9586a063..b53435be 100644 --- a/src/tvheadend.h +++ b/src/tvheadend.h @@ -199,9 +199,12 @@ typedef enum { SCT_TEXTSUB, SCT_EAC3, SCT_MP4A, + SCT_VP8, } streaming_component_type_t; -#define SCT_ISVIDEO(t) ((t) == SCT_MPEG2VIDEO || (t) == SCT_H264) +#define SCT_ISVIDEO(t) ((t) == SCT_MPEG2VIDEO || (t) == SCT_H264 || \ + (t) == SCT_VP8) + #define SCT_ISAUDIO(t) ((t) == SCT_MPEG2AUDIO || (t) == SCT_AC3 || \ (t) == SCT_AAC || (t) == SCT_MP4A || \ (t) == SCT_EAC3)