Skip to content

Instantly share code, notes, and snippets.

View karthickai's full-sized avatar
🎯
Focusing

Karthick Panner Selvam karthickai

🎯
Focusing
View GitHub Profile
static NvDsInferParseObjectInfo convertBBoxYoloV4(const float& bx1, const float& by1, const float& bx2,
const float& by2, const uint& netW, const uint& netH)
{
NvDsInferParseObjectInfo b;
// Restore coordinates to network input resolution
float x1 = bx1 * netW;
float y1 = by1 * netH;
float x2 = bx2 * netW;
float y2 = by2 * netH;
#include <iostream>
#include <gst/gst.h>
/* Structure to contain all our information, so we can pass it to callbacks */
struct CustomData {
GstElement *pipeline;
GstElement *source;
GstElement *convert;
GstElement *resample;
GstElement *tee;
#include <iostream>
#include <gst/gst.h>
int main(int arg, char *argv[]) {
GstElement *pipeline = nullptr;
GstBus *bus = nullptr;
GstMessage *msg = nullptr;
// gstreamer initialization
gst_init(&arg, &argv);
cmake_minimum_required(VERSION 3.16)
project(gstreamer_01) #Project name
set(CMAKE_CXX_STANDARD 14) #setting C++ 14 standard
find_package(PkgConfig) #finding pkg-config is a helper tool
#using pkg-config to getting Gstreamer
pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)
#include <string.h>
#include <string>
#include <sstream>
#include <iostream>
#include <ostream>
#include <fstream>
#include "gstdsexample.h"
#include <npp.h>
#include <sys/time.h>
GST_DEBUG_CATEGORY_STATIC (gst_dsexample_debug);