[vlc-commits] chromecast: use vpx encoder if there is no x264 module

Thomas Guillem git at videolan.org
Thu Mar 29 14:04:05 CEST 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 27 11:26:36 2018 +0200| [87b510a361e544af492d666f01966c59d7ae7281] | committer: Thomas Guillem

chromecast: use vpx encoder if there is no x264 module

(cherry picked from commit 4529f8add415995c0e959edee3626d063c66885b)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=87b510a361e544af492d666f01966c59d7ae7281
---

 modules/stream_out/chromecast/cast.cpp | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index 29282ae4ea..0e7956fcc9 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -906,6 +906,13 @@ bool sout_stream_sys_t::transcodingCanFallback() const
     return transcoding_state != (TRANSCODING_VIDEO|TRANSCODING_AUDIO);
 }
 
+static std::string GetVencVPXOption( sout_stream_t * /* p_stream */,
+                                      const video_format_t * /* p_vid */,
+                                      int /* i_quality */ )
+{
+    return "venc=vpx{quality-mode=1}";
+}
+
 static std::string GetVencX264Option( sout_stream_t * /* p_stream */,
                                       const video_format_t *p_vid,
                                       int i_quality )
@@ -965,11 +972,19 @@ sout_stream_sys_t::GetVcodecOption( sout_stream_t *p_stream, vlc_fourcc_t *p_cod
             psz_video_maxres = video_maxres_720p;
     }
 
-    *p_codec_video = VLC_CODEC_H264;
-
     std::string venc_option;
     if( module_exists("x264") )
+    {
+        *p_codec_video = VLC_CODEC_H264;
         venc_option = GetVencX264Option( p_stream, p_vid, i_quality );
+    }
+    else if( module_exists("vpx") )
+    {
+        *p_codec_video = VLC_CODEC_VP8;
+        venc_option = GetVencVPXOption( p_stream, p_vid, i_quality );
+    }
+    else /* Fallback to h264 with an unknown module */
+        *p_codec_video = VLC_CODEC_H264;
 
     msg_Dbg( p_stream, "Converting video to %.4s", (const char*)p_codec_video );
 



More information about the vlc-commits mailing list