Skip to content

Commit 8f7ba52

Browse files
authored
fix video delay 4s (#1525)
1 parent e25997a commit 8f7ba52

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

samples/kvsWebRTCClientMasterGstreamerSample.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ GstFlowReturn on_new_sample(GstElement* sink, gpointer data, UINT64 trackid)
7575
pRtcRtpTransceiver = pSampleStreamingSession->pVideoRtcRtpTransceiver;
7676
frame.presentationTs = pSampleStreamingSession->videoTimestamp;
7777
frame.decodingTs = frame.presentationTs;
78-
pSampleStreamingSession->videoTimestamp += SAMPLE_VIDEO_FRAME_DURATION; // assume video fps is 30
78+
pSampleStreamingSession->videoTimestamp += SAMPLE_VIDEO_FRAME_DURATION; // assume video fps is 25
7979
}
8080
status = writeFrame(pRtcRtpTransceiver, &frame);
8181
if (status != STATUS_SRTP_NOT_READY_YET && status != STATUS_SUCCESS) {
@@ -146,13 +146,13 @@ PVOID sendGstreamerAudioVideo(PVOID args)
146146
case SAMPLE_STREAMING_VIDEO_ONLY:
147147
if (pSampleConfiguration->useTestSrc) {
148148
pipeline = gst_parse_launch(
149-
"videotestsrc is-live=TRUE ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=30/1 ! "
149+
"videotestsrc is-live=TRUE ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=25/1 ! "
150150
"x264enc bframes=0 speed-preset=veryfast bitrate=512 byte-stream=TRUE tune=zerolatency ! "
151151
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! appsink sync=TRUE emit-signals=TRUE name=appsink-video",
152152
&error);
153153
} else {
154154
pipeline = gst_parse_launch(
155-
"autovideosrc ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=[30/1,10000000/333333] ! "
155+
"autovideosrc ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=25/1 ! "
156156
"x264enc bframes=0 speed-preset=veryfast bitrate=512 byte-stream=TRUE tune=zerolatency ! "
157157
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! appsink sync=TRUE emit-signals=TRUE name=appsink-video",
158158
&error);
@@ -161,7 +161,7 @@ PVOID sendGstreamerAudioVideo(PVOID args)
161161

162162
case SAMPLE_STREAMING_AUDIO_VIDEO:
163163
if (pSampleConfiguration->useTestSrc) {
164-
pipeline = gst_parse_launch("videotestsrc is-live=TRUE ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=30/1 ! "
164+
pipeline = gst_parse_launch("videotestsrc is-live=TRUE ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=25/1 ! "
165165
"x264enc bframes=0 speed-preset=veryfast bitrate=512 byte-stream=TRUE tune=zerolatency ! "
166166
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! appsink sync=TRUE "
167167
"emit-signals=TRUE name=appsink-video audiotestsrc is-live=TRUE ! "
@@ -170,7 +170,7 @@ PVOID sendGstreamerAudioVideo(PVOID args)
170170
&error);
171171
} else {
172172
pipeline =
173-
gst_parse_launch("autovideosrc ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=[30/1,10000000/333333] ! "
173+
gst_parse_launch("autovideosrc ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=25/1 ! "
174174
"x264enc bframes=0 speed-preset=veryfast bitrate=512 byte-stream=TRUE tune=zerolatency ! "
175175
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! appsink sync=TRUE emit-signals=TRUE "
176176
"name=appsink-video autoaudiosrc ! "

0 commit comments

Comments
 (0)