vp9_streamer.cpp
Go to the documentation of this file.
00001 #include "web_video_server/vp9_streamer.h"
00002 
00003 namespace web_video_server
00004 {
00005 
00006 Vp9Streamer::Vp9Streamer(const async_web_server_cpp::HttpRequest& request,
00007                          async_web_server_cpp::HttpConnectionPtr connection, ros::NodeHandle& nh) :
00008     LibavStreamer(request, connection, nh, "webm", "libvpx-vp9", "video/webm")
00009 {
00010 }
00011 Vp9Streamer::~Vp9Streamer()
00012 {
00013 }
00014 
00015 void Vp9Streamer::initializeEncoder()
00016 {
00017 
00018   // codec options set up to provide somehow reasonable performance in cost of poor quality
00019   // should be updated as soon as VP9 encoding matures
00020   av_opt_set_int(codec_context_->priv_data, "pass", 1, 0);
00021   av_opt_set_int(codec_context_->priv_data, "speed", 8, 0);
00022   av_opt_set_int(codec_context_->priv_data, "cpu-used", 4, 0);  // 8 is max
00023   av_opt_set_int(codec_context_->priv_data, "crf", 20, 0);      // 0..63 (higher is lower quality)
00024 }
00025 
00026 Vp9StreamerType::Vp9StreamerType() :
00027     LibavStreamerType("webm", "libvpx-vp9", "video/webm")
00028 {
00029 }
00030 
00031 boost::shared_ptr<ImageStreamer> Vp9StreamerType::create_streamer(const async_web_server_cpp::HttpRequest& request,
00032                                                                   async_web_server_cpp::HttpConnectionPtr connection,
00033                                                                   ros::NodeHandle& nh)
00034 {
00035   return boost::shared_ptr<ImageStreamer>(new Vp9Streamer(request, connection, nh));
00036 }
00037 
00038 }


web_video_server
Author(s): Mitchell Wills
autogenerated on Thu Jun 6 2019 18:02:48