hi all,
i have tried all the methods but fail to figure out.
need your helps on this:
i would like to create a VR.
Thus, i create RTSP server to link to my Zedmini, it is work if i use h265 encoder,
but the bad thing is the RTSP only work if i use Iphone7 VLC app or computer window 8 VLC software,
my Android phone huawei p7 Onvifer app cannot generic this RTSP address at all. And i need to use huawei p7 for my project as i am going to create the app and link to this RTSP server.
Based on my checking, Some Android device not support h265 encoder, so i decided to use h264 and i have been googling a lot for few weeks but frustrated without finding a solution for using h264.
Really need your assistance if you hv any idea>>>>
This is the code which i amend from test-readme.c >>>>>>
#include <gst/gst.h>
#include <gst/rtsp-server/rtsp-server.h>
int
main (int argc, char *argv[])
{
GMainLoop *loop;
GstRTSPServer *server;
GstRTSPMountPoints *mounts;
GstRTSPMediaFactory *factory;
gst_init (&argc, &argv);
loop = g_main_loop_new (NULL, FALSE);
/* create a server instance */
server = gst_rtsp_server_new ();
/* get the mount points for this server, every server has a default object
* that be used to map uri mount points to media factories */
mounts = gst_rtsp_server_get_mount_points (server);
/* make a media factory for a test stream. The default media factory can use
* gst-launch syntax to create pipelines.
* any launch line works as long as it contains elements named pay%d. Each
* element with pay%d names will be a stream */
factory = gst_rtsp_media_factory_new ();
//working case for streaming video
//gst_rtsp_media_factory_set_launch (factory,"( videotestsrc is-live=1 ! x264enc ! rtph264pay name=pay0 pt=96 )");
//working case for external camera
//gst_rtsp_media_factory_set_launch (factory,"( v4l2src is-live=1 device=/dev/video1 ! video/x-raw, width=(int)720, height=(int)480 framerate=30/1 format=I420 ! timeoverlay ! omxh265enc ! rtph265pay name=pay0 pt=96 )");
//working case for JX2 camera
//gst_rtsp_media_factory_set_launch (factory,"( nvcamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1, format=I420 ! nvvidconv flip-method=4 !video/x-raw, width=(int)720, height=(int)480 framerate=30/1 format=I420 ! timeoverlay ! omxh265enc ! rtph265pay name=pay0 pt=96 )");
//Fail or not working case for Zed mini camera testing FOR H264
gst_rtsp_media_factory_set_launch (factory,"(v4l2src is-live=1 device=/dev/video1 ! video/x-raw, width=2560, height=720, framerate=30/1, format=I420 ! nvvidconv !video/x-raw, width=(int)720, height=(int)480, framerate=30/1, format=NV12 ! omxh264enc bitrate=10000000 ! rtph264pay name=pay0 pt=96 )");
//working case for Zed mini camera FOR H265
//gst_rtsp_media_factory_set_launch (factory,"(v4l2src is-live=1 device=/dev/video1 ! video/x-raw, width=2560, height=720, framerate=30/1, format=I420 ! nvvidconv !video/x-raw, width=(int)720, height=(int)480 framerate=30/1 format=I420 ! timeoverlay ! omxh265enc ! rtph265pay name=pay0 pt=96 )");
gst_rtsp_media_factory_set_shared (factory, TRUE);
/* attach the test factory to the /test url */
gst_rtsp_mount_points_add_factory (mounts, "/test", factory);
/* don't need the ref to the mapper anymore */
g_object_unref (mounts);
/* attach the server to the default maincontext */
gst_rtsp_server_attach (server, NULL);
/* start serving */
g_print ("stream ready at rtsp://172.16.124.75:8554/test\n");
g_main_loop_run (loop);
return 0;
}
This code is working on streaming video, JX2 camera, simple USB camera (low end), also zedmini camera but using h265. i need the code running using h264, there must be some element missed out here or wrong, pls help me if you hv any idea for it, thanks again:
gst_rtsp_media_factory_set_launch (factory,"(v4l2src is-live=1 device=/dev/video1 ! video/x-raw, width=2560, height=720, framerate=30/1, format=I420 ! nvvidconv !video/x-raw, width=(int)720, height=(int)480, framerate=30/1, format=NV12 ! omxh264enc bitrate=10000000 ! rtph264pay name=pay0 pt=96 )");