Skip to content

Commit

Permalink
changed encoder in config file
Browse files Browse the repository at this point in the history
  • Loading branch information
shortstheory committed Oct 29, 2020
1 parent b6c013b commit 8be0bdb
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 14 deletions.
4 changes: 1 addition & 3 deletions config/AR0521Camera.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
camera: {
properties: {
launch_string = "v4l2src name=src device=%device ! capsfilter name=capsfilter caps=%capsfilter ! nvvidconv ! video/x-raw(memory:NVMM), format=(string)I420 ! omxh264enc name=omxh264enc bitrate=%bitrate preset-level=3 ! tee name=tee_element tee_element. ! queue ! h264parse ! rtph264pay name=pay0";
launch_string = "v4l2src name=src device=%device ! capsfilter name=capsfilter caps=%capsfilter ! nvvidconv ! video/x-raw(memory:NVMM), format=(string)I420 ! omxh264enc name=encoder bitrate=%bitrate preset-level=3 ! tee name=tee_element tee_element. ! queue ! h264parse ! rtph264pay name=pay0";
capsfilter = "video/x-raw,format=(string)UYVY,width=(int)%width,height=(int)%height";
mode = "encoder";
encoder_name = "omxh264enc";
supported_qualities = 511;
dynamic_res = false;
dynamic_bitrate = true;
Expand Down
2 changes: 0 additions & 2 deletions config/C920Camera.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ camera: {
properties: {
launch_string = "uvch264src device=%device average-bitrate=%bitrate name=src auto-start=true src.vidsrc ! queue ! capsfilter name=capsfilter caps=%capsfilter ! tee name=tee_element tee_element. ! queue ! h264parse ! rtph264pay name=pay0";
capsfilter = "video/x-h264,width=(int)%width,height=(int)%height,framerate=(fraction)%framerate/1";
mode = "device";
encoder_name = "";
supported_qualities = 63;
dynamic_res = false;
dynamic_bitrate = true;
Expand Down
8 changes: 1 addition & 7 deletions src/Camera/AR0521Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ AR0521Camera::AR0521Camera(string device, Quality q) : Camera(device, q), encode

bool AR0521Camera::set_element_references(GstElement *pipeline)
{
encoder = gst_bin_get_by_name(GST_BIN(pipeline), encoder_name.c_str());
encoder = gst_bin_get_by_name(GST_BIN(pipeline), "encoder");
capsfilter_element = gst_bin_get_by_name(GST_BIN(pipeline), "capsfilter");
if (encoder && capsfilter_element) {
return true;
Expand Down Expand Up @@ -51,12 +51,6 @@ bool AR0521Camera::set_quality(Quality q)
return false;
}

bool AR0521Camera::read_configuration(Setting &camera_config, Setting &quality_config)
{
encoder_name = static_cast<const char *>(camera_config.lookup("camera.properties.encoder_name"));
return Camera::read_configuration(camera_config, quality_config);
}

string AR0521Camera::generate_launch_string() const
{
string capsfilter_string;
Expand Down
2 changes: 0 additions & 2 deletions src/Camera/AR0521Camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class AR0521Camera : public Camera
protected:
GstElement *encoder;
GstElement *capsfilter_element;
string encoder_name;
virtual bool read_configuration(Setting &camera_config, Setting &quality_config) override;

public:
AR0521Camera(string device, Quality q);
Expand Down

0 comments on commit 8be0bdb

Please sign in to comment.