Skip to content

Commit

Permalink
add streaming port input
Browse files Browse the repository at this point in the history
  • Loading branch information
adujardin committed Jun 26, 2019
1 parent 181a3fc commit 5ba69c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions camera streaming/sender/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ int main(int argc, char **argv) {
initParameters.camera_resolution = RESOLUTION_HD2K;
initParameters.depth_mode = DEPTH_MODE_NONE;
initParameters.sdk_verbose = true;

// Open the camera
ERROR_CODE err = zed.open(initParameters);
if (err != SUCCESS) {
Expand All @@ -49,18 +50,20 @@ int main(int argc, char **argv) {
return -1; // Quit if an error occurred
}



sl::StreamingParameters stream_params;
stream_params.codec = sl::STREAMING_CODEC_AVCHD;
stream_params.bitrate = 8000;
if(argc > 1) stream_params.port = atoi(argv[1]);

err = zed.enableStreaming(stream_params);
if (err != SUCCESS) {
std::cout << "Streaming initialization error. " << toString(err) << std::endl;
zed.close();
return -2;
}

std::cout << "Streaming on port " << stream_params.port << std::endl;

SetCtrlHandler();

int fc = 0;
Expand Down

0 comments on commit 5ba69c3

Please sign in to comment.