i'm trying to build an RTSP server with GStreamer in Visual Studio but i'm encountering some errors.
error LNK2019: unresolved external symbol __imp_gst_rtsp_media_factory_new referenced in function main error LNK2019: unresolved external symbol __imp_gst_rtsp_media_factory_set_launch referenced in function main error LNK2019: unresolved external symbol __imp_gst_rtsp_mount_points_add_factory referenced in function main error LNK2019: unresolved external symbol __imp_gst_rtsp_server_new referenced in function main error LNK2019: unresolved external symbol __imp_gst_rtsp_server_get_mount_points referenced in function main error LNK2019: unresolved external symbol __imp_gst_rtsp_server_attach referenced in function main
And this is the code i'm trying to build
#include <gst/gst.h>
#include <gst/rtsp-server/rtsp-server.h>
int main(int argc, char* argv[])
{
gst_init(&argc, &argv);
// Create the RTSP server
GstRTSPServer* server = gst_rtsp_server_new();
// Get the mount points for the server
GstRTSPMountPoints* mounts = gst_rtsp_server_get_mount_points(server);
// Create the RTSP media factory
GstRTSPMediaFactory* factory = gst_rtsp_media_factory_new();
// Set the launch string for the media factory
gst_rtsp_media_factory_set_launch(factory, "uridecodebin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm ! videoconvert ! x264enc ! rtph264pay name=pay0");
// Mount the factory to the "/test" path
gst_rtsp_mount_points_add_factory(mounts, "/test", factory);
// Release the reference to the mounts
g_object_unref(mounts);
// Attach the server to a specific port
int port = 8554; // Choose the desired port number
gchar* address = "192.168.0.100"; // Set the desired IP address or "0.0.0.0" for any address
gst_rtsp_server_attach(server, NULL, port, &address);
// Start the main loop
GMainLoop* loop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(loop);
// Clean up
g_main_loop_unref(loop);
gst_object_unref(server);
return 0;
}
and i followed the steps provided in this question to configure gstreamer in visual studio How do I configure Visual Studio 2017 to run Gstreamer tutorials? and i was able to build and run the tutorials but i still don't know what is missing or how to solve the problem