From 993c1c01a262fc0a75c385173296b7c1b20b9945 Mon Sep 17 00:00:00 2001 From: Lidashuang Date: Fri, 12 Apr 2024 14:00:28 +0800 Subject: [PATCH 1/3] frpc --- format/rtspv2/demuxer.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/format/rtspv2/demuxer.go b/format/rtspv2/demuxer.go index 57731c5..1d5c7cd 100644 --- a/format/rtspv2/demuxer.go +++ b/format/rtspv2/demuxer.go @@ -2,6 +2,7 @@ package rtspv2 import ( "encoding/binary" + "fmt" "math" "time" @@ -348,7 +349,14 @@ func (client *RTSPClient) appendPlaybackVideoPacket(retmap []*av.Packet, nal []b prePkt[i].RealTimestamp = client.preKeyRealVideoTs*1000 + client.iterateDruation.Milliseconds() client.preRealVideoMs = prePkt[i].RealTimestamp - // fmt.Println("playback duration", prePkt[i].IsKeyFrame, prePkt[i].RealTs, client.preRealVideoMs, prePkt[i].Duration, client.iterateDruation) + fmt.Println("playback duration", + prePkt[i].IsKeyFrame, + prePkt[i].Time.Milliseconds(), + curPkt.Time.Milliseconds(), + prePkt[i].RealTs, + prePkt[i].RealTimestamp, + prePkt[i].Duration, + client.iterateDruation) } return prePkt } @@ -381,7 +389,7 @@ func (client *RTSPClient) appendLiveViewVideoPacket(retmap []*av.Packet, nal []b } client.PreDuration = prePkt[i].Duration } - // fmt.Println("liveview duration", prePkt[i].IsKeyFrame, prePkt[i].Time.Milliseconds(), prePkt[i].Duration) + fmt.Println("liveview duration", prePkt[i].IsKeyFrame, prePkt[i].Time.Milliseconds(), prePkt[i].Duration) } return prePkt From 92f0b8a1e172e62e51b62b5db712b668c11a451f Mon Sep 17 00:00:00 2001 From: Lidashuang Date: Fri, 12 Apr 2024 14:39:40 +0800 Subject: [PATCH 2/3] vdk playbakc skip fram --- format/rtspv2/demuxer.go | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/format/rtspv2/demuxer.go b/format/rtspv2/demuxer.go index 1d5c7cd..e59c453 100644 --- a/format/rtspv2/demuxer.go +++ b/format/rtspv2/demuxer.go @@ -2,7 +2,6 @@ package rtspv2 import ( "encoding/binary" - "fmt" "math" "time" @@ -338,25 +337,27 @@ func (client *RTSPClient) appendPlaybackVideoPacket(retmap []*av.Packet, nal []b if prePkt[i].IsKeyFrame { if prePkt[i].RealTs == client.preRealVideoMs/1000 { - client.iterateDruation += prePkt[i].Duration + prePkt[i].RealTimestamp = client.preKeyRealVideoTs*1000 + client.iterateDruation.Milliseconds() } else { - client.iterateDruation = 0 client.preKeyRealVideoTs = prePkt[i].RealTs + prePkt[i].RealTimestamp = client.preKeyRealVideoTs * 1000 + client.iterateDruation = 0 } + client.iterateDruation += prePkt[i].Duration } else { + prePkt[i].RealTimestamp = client.preKeyRealVideoTs*1000 + client.iterateDruation.Milliseconds() client.iterateDruation += prePkt[i].Duration } - prePkt[i].RealTimestamp = client.preKeyRealVideoTs*1000 + client.iterateDruation.Milliseconds() client.preRealVideoMs = prePkt[i].RealTimestamp - fmt.Println("playback duration", - prePkt[i].IsKeyFrame, - prePkt[i].Time.Milliseconds(), - curPkt.Time.Milliseconds(), - prePkt[i].RealTs, - prePkt[i].RealTimestamp, - prePkt[i].Duration, - client.iterateDruation) + // fmt.Println("playback duration", + // prePkt[i].IsKeyFrame, + // prePkt[i].Time.Milliseconds(), + // curPkt.Time.Milliseconds(), + // prePkt[i].RealTs, + // prePkt[i].RealTimestamp, + // prePkt[i].Duration, + // client.iterateDruation) } return prePkt } @@ -389,7 +390,7 @@ func (client *RTSPClient) appendLiveViewVideoPacket(retmap []*av.Packet, nal []b } client.PreDuration = prePkt[i].Duration } - fmt.Println("liveview duration", prePkt[i].IsKeyFrame, prePkt[i].Time.Milliseconds(), prePkt[i].Duration) + // fmt.Println("liveview duration", prePkt[i].IsKeyFrame, prePkt[i].Time.Milliseconds(), prePkt[i].Duration) } return prePkt From 665a4595d16db137742a7a01895966934f3616ae Mon Sep 17 00:00:00 2001 From: Lidashuang Date: Fri, 12 Apr 2024 14:42:18 +0800 Subject: [PATCH 3/3] vdk playbakc skip fram --- format/rtspv2/demuxer.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/format/rtspv2/demuxer.go b/format/rtspv2/demuxer.go index e59c453..05ea449 100644 --- a/format/rtspv2/demuxer.go +++ b/format/rtspv2/demuxer.go @@ -343,12 +343,10 @@ func (client *RTSPClient) appendPlaybackVideoPacket(retmap []*av.Packet, nal []b prePkt[i].RealTimestamp = client.preKeyRealVideoTs * 1000 client.iterateDruation = 0 } - client.iterateDruation += prePkt[i].Duration } else { prePkt[i].RealTimestamp = client.preKeyRealVideoTs*1000 + client.iterateDruation.Milliseconds() - client.iterateDruation += prePkt[i].Duration } - + client.iterateDruation += prePkt[i].Duration client.preRealVideoMs = prePkt[i].RealTimestamp // fmt.Println("playback duration", // prePkt[i].IsKeyFrame,