[Bug 751720] New: qmlplayer2 example shows incorrect stride when using videotestsrc through an rtsp server

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Jun 30 05:57:58 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=751720

            Bug ID: 751720
           Summary: qmlplayer2 example shows incorrect stride when using
                    videotestsrc through an rtsp server
    Classification: Platform
           Product: GStreamer
           Version: 1.2.0
                OS: Linux
            Status: NEW
          Severity: blocker
          Priority: Normal
         Component: qt-gstreamer
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: randy.spruyt at christiedigital.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

Created attachment 306397
  --> https://bugzilla.gnome.org/attachment.cgi?id=306397&action=edit
qmlplayer2 output when using videotestsrc through an rtsp server

Using gstreamer 1.2.0 git master HEAD, When using an RTSP server, the stride
looks fine for:

 gst-launch-1.0 playbin uri=192.168.232.62:8554/test

but incorrect for:

./qmlplayer2 192.168.232.62:8554/test

See attached image of qmlplayer2 output. I see the same incorrect stride for my
own H264 live source. A handful of non-live H.264 videos seem to work fine. The
included http big-buck-bunny example in qmlplayer2 also works fine.

For the RTSP server, I am using the gst-rtsp-server/examples/test-netclock.c
example with the launch line:

gst_rtsp_media_factory_set_launch (factory, "(videotestsrc pattern=19
is-live=true horizontal-speed=1 ! video/x-raw, framerate=(fraction)60/1,
height=(int)1000, width=(int)1000 ! x264enc ! rtph264pay name=pay0 pt=96 )");


full server code:

#include <gst/gst.h>

#include <gst/net/gstnettimeprovider.h>
#include <gst/rtsp-server/rtsp-server.h>

GstClock *global_clock;

#define TEST_TYPE_RTSP_MEDIA_FACTORY      (test_rtsp_media_factory_get_type ())
#define TEST_TYPE_RTSP_MEDIA              (test_rtsp_media_get_type ())

GType test_rtsp_media_factory_get_type (void);
GType test_rtsp_media_get_type (void);

static GstRTSPMediaFactory *test_rtsp_media_factory_new (void);
static GstElement *create_pipeline (GstRTSPMediaFactory * factory,
    GstRTSPMedia * media);

typedef struct TestRTSPMediaFactoryClass TestRTSPMediaFactoryClass;
typedef struct TestRTSPMediaFactory TestRTSPMediaFactory;

struct TestRTSPMediaFactoryClass
{
  GstRTSPMediaFactoryClass parent;
};

struct TestRTSPMediaFactory
{
  GstRTSPMediaFactory parent;
};

typedef struct TestRTSPMediaClass TestRTSPMediaClass;
typedef struct TestRTSPMedia TestRTSPMedia;

struct TestRTSPMediaClass
{
  GstRTSPMediaClass parent;
};

struct TestRTSPMedia
{
  GstRTSPMedia parent;
};

GstRTSPMediaFactory *
test_rtsp_media_factory_new (void)
{
  GstRTSPMediaFactory *result;

  result = g_object_new (TEST_TYPE_RTSP_MEDIA_FACTORY, NULL);

  return result;
}

G_DEFINE_TYPE (TestRTSPMediaFactory, test_rtsp_media_factory,
    GST_TYPE_RTSP_MEDIA_FACTORY);

static gboolean custom_setup_rtpbin (GstRTSPMedia * media, GstElement *
rtpbin);

static void
test_rtsp_media_factory_class_init (TestRTSPMediaFactoryClass * test_klass)
{
  GstRTSPMediaFactoryClass *mf_klass =
      (GstRTSPMediaFactoryClass *) (test_klass);
  mf_klass->create_pipeline = create_pipeline;
}

static void
test_rtsp_media_factory_init (TestRTSPMediaFactory * factory)
{
}

static GstElement *
create_pipeline (GstRTSPMediaFactory * factory, GstRTSPMedia * media)
{
  GstElement *pipeline;

  pipeline = gst_pipeline_new ("media-pipeline");
  gst_pipeline_use_clock (GST_PIPELINE (pipeline), global_clock);
  gst_rtsp_media_take_pipeline (media, GST_PIPELINE_CAST (pipeline));

  return pipeline;
}

G_DEFINE_TYPE (TestRTSPMedia, test_rtsp_media, GST_TYPE_RTSP_MEDIA);

static void
test_rtsp_media_class_init (TestRTSPMediaClass * test_klass)
{
  GstRTSPMediaClass *klass = (GstRTSPMediaClass *) (test_klass);
  klass->setup_rtpbin = custom_setup_rtpbin;
}

static void
test_rtsp_media_init (TestRTSPMedia * media)
{
}

static gboolean
custom_setup_rtpbin (GstRTSPMedia * media, GstElement * rtpbin)
{
  g_object_set (rtpbin, "ntp-time-source", 3, NULL);
  return TRUE;
}

int
main (int argc, char *argv[])
{
  GMainLoop *loop;
  GstRTSPServer *server;
  GstRTSPMountPoints *mounts;
  GstRTSPMediaFactory *factory;
  GstRTSPAddressPool *pool;

  gst_init (&argc, &argv);

  loop = g_main_loop_new (NULL, FALSE);

  global_clock = gst_system_clock_obtain ();
  gst_net_time_provider_new (global_clock, "0.0.0.0", 8554);

  /* 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 = test_rtsp_media_factory_new ();
  gst_rtsp_media_factory_set_launch (factory, "(videotestsrc pattern=19
is-live=true horizontal-speed=1 ! video/x-raw, framerate=(fraction)60/1,
height=(int)1000, width=(int)1000 ! x264enc ! rtph264pay name=pay0 pt=96 )");
  // gst_rtsp_media_factory_set_launch (factory, "(christiedesktopcapturenvidia
! h264parse ! rtph264pay name=pay0 )");
  //gst_rtsp_media_factory_set_launch (factory, "( filesrc
location=/mnt/share/HD-60Hz-H264.mov ! qtdemux ! h264parse ! queue ! rtph264pay
name=pay0 )");
  // gst_rtsp_media_factory_set_launch (factory, "( filesrc
location=/mnt/share/batman.begins.mp4 ! qtdemux ! h264parse ! rtph264pay
name=pay0 )");

  //gst_rtsp_media_factory_set_launch (factory, "( filesrc
location=/mnt/share/test/4K-60Hz-H264.mov ! qtdemux ! h264parse ! tee name=t !
queue ! rtph264pay name=pay0 t. ! queue ! vaapiparse_h264 ! vaapidecode !
vaapisink sync=false )");
  //gst_rtsp_media_factory_set_launch (factory, "gst-launch-1.0 udpsrc
port=6000 caps=\"application/x-rtp, media=video, clock-rate=90000,
encoding-name=H264\" ! rtph264depay ! rtph264pay name=pay0 pt=96");

  gst_rtsp_media_factory_set_shared (GST_RTSP_MEDIA_FACTORY (factory), TRUE);
  gst_rtsp_media_factory_set_media_gtype (GST_RTSP_MEDIA_FACTORY (factory),
      TEST_TYPE_RTSP_MEDIA);

  /* make a new address pool */
  pool = gst_rtsp_address_pool_new ();
  gst_rtsp_address_pool_add_range (pool,
      "224.1.1.1", "224.1.1.10", 5000, 5010, 16);
  gst_rtsp_media_factory_set_address_pool (factory, pool);
  /* only allow multicast */
  //gst_rtsp_media_factory_set_protocols (factory,
  //    GST_RTSP_LOWER_TRANS_UDP_MCAST);
  g_object_unref (pool);

  /* 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://127.0.0.1:8554/test\n");
  g_main_loop_run (loop);

  return 0;
}

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list