Skip to content

Commit

Permalink
fix video delay 4s (#1525)
Browse files Browse the repository at this point in the history
  • Loading branch information
vc60er authored Aug 1, 2022
1 parent e25997a commit 8f7ba52
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions samples/kvsWebRTCClientMasterGstreamerSample.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ GstFlowReturn on_new_sample(GstElement* sink, gpointer data, UINT64 trackid)
pRtcRtpTransceiver = pSampleStreamingSession->pVideoRtcRtpTransceiver;
frame.presentationTs = pSampleStreamingSession->videoTimestamp;
frame.decodingTs = frame.presentationTs;
pSampleStreamingSession->videoTimestamp += SAMPLE_VIDEO_FRAME_DURATION; // assume video fps is 30
pSampleStreamingSession->videoTimestamp += SAMPLE_VIDEO_FRAME_DURATION; // assume video fps is 25
}
status = writeFrame(pRtcRtpTransceiver, &frame);
if (status != STATUS_SRTP_NOT_READY_YET && status != STATUS_SUCCESS) {
Expand Down Expand Up @@ -146,13 +146,13 @@ PVOID sendGstreamerAudioVideo(PVOID args)
case SAMPLE_STREAMING_VIDEO_ONLY:
if (pSampleConfiguration->useTestSrc) {
pipeline = gst_parse_launch(
"videotestsrc is-live=TRUE ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=30/1 ! "
"videotestsrc is-live=TRUE ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=25/1 ! "
"x264enc bframes=0 speed-preset=veryfast bitrate=512 byte-stream=TRUE tune=zerolatency ! "
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! appsink sync=TRUE emit-signals=TRUE name=appsink-video",
&error);
} else {
pipeline = gst_parse_launch(
"autovideosrc ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=[30/1,10000000/333333] ! "
"autovideosrc ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=25/1 ! "
"x264enc bframes=0 speed-preset=veryfast bitrate=512 byte-stream=TRUE tune=zerolatency ! "
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! appsink sync=TRUE emit-signals=TRUE name=appsink-video",
&error);
Expand All @@ -161,7 +161,7 @@ PVOID sendGstreamerAudioVideo(PVOID args)

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

0 comments on commit 8f7ba52

Please sign in to comment.