Skip to content

Commit

Permalink
viewer: try to fix display latency issues
Browse files Browse the repository at this point in the history
Sometimes, the framerate returned by the camera is not the actual
framerate of the received stream. An actual framerate greater than the
one given by the camera causes shoppy video.

Also, sometimes at start the display latency is too big (1 second or
more).

Setting the framerate in the appsrc caps to 0 Hz seems to fix this
issues.
  • Loading branch information
EmmanuelP committed Apr 20, 2017
1 parent 1b67490 commit 0f91198
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions viewer/arvviewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,12 +928,12 @@ start_video (ArvViewer *viewer)
gst_caps_set_simple (caps,
"width", G_TYPE_INT, width,
"height", G_TYPE_INT, height,
"framerate", GST_TYPE_FRACTION, (unsigned int ) (double) (0.5 + frame_rate), 1,
"framerate", GST_TYPE_FRACTION, 0, 1,
NULL);
gst_app_src_set_caps (GST_APP_SRC (viewer->appsrc), caps);
gst_caps_unref (caps);

g_object_set(G_OBJECT (viewer->appsrc), "format", GST_FORMAT_TIME, NULL);
g_object_set(G_OBJECT (viewer->appsrc), "format", GST_FORMAT_TIME, "is-live", TRUE, "do-timestamp", TRUE, NULL);

if (!has_gtkglsink && !has_gtksink) {
GstBus *bus;
Expand Down

0 comments on commit 0f91198

Please sign in to comment.