Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
libav muxer: added WEBM support
  • Loading branch information
perexg committed Oct 17, 2014
1 parent 94ff39d commit 53b168c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.ffmpeg
Expand Up @@ -57,7 +57,7 @@ EXTLIBS = libx264 libvorbis libvpx
COMPONENTS = avutil avformat avcodec swresample swscale avresample
DECODERS = mpeg2video mp2 ac3 eac3 h264 h264_vdpau aac aac_latm vorbis libvorbis
ENCODERS = mpeg2video mp2 libx264 libvpx_vp8 libvpx_vp9 aac libaacplus vorbis libvorbis
MUXERS = mpegts mpeg2dvd matroska
MUXERS = mpegts mpeg2dvd matroska webm
BSFS = h264_mp4toannexb

LIBOGG = libogg-1.3.2
Expand Down
1 change: 1 addition & 0 deletions src/muxer.h
Expand Up @@ -32,6 +32,7 @@ typedef enum {
MC_RAW = 5,
MC_WEBM = 6,
MC_AVMATROSKA = 7,
MC_AVWEBM = 8,
} muxer_container_type_t;

typedef enum {
Expand Down
10 changes: 10 additions & 0 deletions src/muxer/muxer_libav.c
Expand Up @@ -163,6 +163,12 @@ lav_muxer_support_stream(muxer_container_type_t mc,
ret |= SCT_ISSUBTITLE(type);
break;

case MC_WEBM:
case MC_AVWEBM:
ret |= type == SCT_VP8;
ret |= type == SCT_VORBIS;
break;

case MC_MPEGTS:
ret |= (type == SCT_MPEG2VIDEO);
ret |= (type == SCT_H264);
Expand Down Expand Up @@ -517,6 +523,10 @@ lav_muxer_create(const muxer_config_t *m_cfg)
case MC_AVMATROSKA:
mux_name = "matroska";
break;
case MC_WEBM:
case MC_AVWEBM:
mux_name = "webm";
break;
default:
mux_name = muxer_container_type2txt(m_cfg->m_type);
break;
Expand Down
4 changes: 4 additions & 0 deletions src/muxer/tvh/mkmux.c
Expand Up @@ -258,6 +258,10 @@ mk_build_tracks(mk_mux_t *mkm, const streaming_start_t *ss)
mkm->tracks[i].sri = ssc->ssc_sri;
mkm->tracks[i].nextpts = PTS_UNSET;

if (mkm->webm && ssc->ssc_type != SCT_VP8 && ssc->ssc_type != SCT_VORBIS)
tvhwarn("mkv", "WEBM format supports only VP8+VORBIS streams (detected %s)",
streaming_component_type2txt(ssc->ssc_type));

switch(ssc->ssc_type) {
case SCT_MPEG2VIDEO:
tracktype = 1;
Expand Down
1 change: 1 addition & 0 deletions src/profile.c
Expand Up @@ -646,6 +646,7 @@ profile_class_mc_list ( void *o )
{ "MPEG-TS /av-lib", MC_MPEGTS },
{ "MPEG-PS (DVD) /av-lib", MC_MPEGPS },
{ "Matroska (mkv) /av-lib", MC_AVMATROSKA },
{ "WEBM /av-lib", MC_AVWEBM },
};
return strtab2htsmsg(tab);
}
Expand Down

0 comments on commit 53b168c

Please sign in to comment.