[vlc-commits] chromecast: use vpx encoder if there is no x264 module
Thomas Guillem
git at videolan.org
Tue Mar 27 11:38:54 CEST 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 27 11:26:36 2018 +0200| [4529f8add415995c0e959edee3626d063c66885b] | committer: Thomas Guillem
chromecast: use vpx encoder if there is no x264 module
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4529f8add415995c0e959edee3626d063c66885b
---
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 78533c2a10..e1cea56f89 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -918,6 +918,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 )
@@ -977,11 +984,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