Skip to content

fix video delay 4s #1497

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

Closed
wants to merge 1 commit into from
Closed

fix video delay 4s #1497

wants to merge 1 commit into from

Conversation

vc60er
Copy link
Contributor

@vc60er vc60er commented Jun 15, 2022

Issue #, if available:

#1105

Description of changes:

change gstreamer pipeline param framerate to 25/1.

Because the SAMPLE_VIDEO_FRAME_DURATION used for accumulate the videoTimestamp is calculated from assume video fps is 25, which definition can be find in Samples.h, so update the video framerate to 25/1.

The framerate of video

// kvsWebRTCClientMasterGstreamerSample.c
gst_parse_launch("autovideosrc ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=[30/1,10000000/333333] ! "

The definition of SAMPLE_VIDEO_FRAME_DURATION

# Samples.h
#define DEFAULT_FPS_VALUE                        25
#define SAMPLE_VIDEO_FRAME_DURATION (HUNDREDS_OF_NANOS_IN_A_SECOND / DEFAULT_FPS_VALUE)

The calculation method of videoTimestamp

// kvsWebRTCClientMasterGstreamerSample.c
GstFlowReturn on_new_sample(GstElement* sink, gpointer data, UINT64 trackid) {
            if (trackid == DEFAULT_AUDIO_TRACK_ID) {
            } else {
                pRtcRtpTransceiver = pSampleStreamingSession->pVideoRtcRtpTransceiver;
                frame.presentationTs = pSampleStreamingSession->videoTimestamp;
                frame.decodingTs = frame.presentationTs;
                pSampleStreamingSession->videoTimestamp += SAMPLE_VIDEO_FRAME_DURATION; // assume video fps is 25
            }
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

MushMal
MushMal previously approved these changes Jun 15, 2022
@disa6302
Copy link
Contributor

@vc60er ,

Can you direct the PR to develop branch instead?

@vc60er vc60er changed the base branch from master to develop July 27, 2022 02:51
@vc60er vc60er dismissed MushMal’s stale review July 27, 2022 02:51

The base branch was changed.

@vc60er
Copy link
Contributor Author

vc60er commented Jul 27, 2022

@vc60er ,

Can you direct the PR to develop branch instead?

@disa6302 done, I have create a new PR, and closed this.

#1525

@vc60er vc60er changed the base branch from develop to master July 27, 2022 03:11
@vc60er vc60er closed this Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants