]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
libav muxer: added WEBM support
authorJaroslav Kysela <perex@perex.cz>
Fri, 17 Oct 2014 18:53:57 +0000 (20:53 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 17 Oct 2014 18:53:57 +0000 (20:53 +0200)
Makefile.ffmpeg
src/muxer.h
src/muxer/muxer_libav.c
src/muxer/tvh/mkmux.c
src/profile.c

index 7d6bc7fdb4eacf1b763fbf9384a57c6dbef4ed7c..fc72ff2f348774b2cfdf21c9b1bbac03a5d894ea 100644 (file)
@@ -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
index d70c10fe63fe86d4b91b1a4a44498bcc7cf4a3d2..5ebb6f586491ca07ca9b160cc595a106359078a2 100644 (file)
@@ -32,6 +32,7 @@ typedef enum {
   MC_RAW         = 5,
   MC_WEBM        = 6,
   MC_AVMATROSKA  = 7,
+  MC_AVWEBM      = 8,
 } muxer_container_type_t;
 
 typedef enum {
index d2476e62a7e75228ced732c20059565d4aefa452..ea2d8d65872054500a25fe63027e1c7a4f46d9d5 100644 (file)
@@ -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);
@@ -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;
index 0c8352cbe543ce5d5b46f497c1b4933dc43b1822..0c6d6c506b11e606ec1a71b2fc0d5db725dc1f90 100644 (file)
@@ -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;
index 9ad6c7ab79e90c37e29b5409774a1fcd0a82d216..7d396569734209769eafaf6d70045268abafe178 100644 (file)
@@ -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);
 }