Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix video delay 4s #1525

Merged
merged 1 commit into from
Aug 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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