vdk playbakc skip fram
This commit is contained in:
parent
993c1c01a2
commit
92f0b8a1e1
@ -2,7 +2,6 @@ package rtspv2
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
|
||||||
"math"
|
"math"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -338,25 +337,27 @@ func (client *RTSPClient) appendPlaybackVideoPacket(retmap []*av.Packet, nal []b
|
|||||||
|
|
||||||
if prePkt[i].IsKeyFrame {
|
if prePkt[i].IsKeyFrame {
|
||||||
if prePkt[i].RealTs == client.preRealVideoMs/1000 {
|
if prePkt[i].RealTs == client.preRealVideoMs/1000 {
|
||||||
client.iterateDruation += prePkt[i].Duration
|
prePkt[i].RealTimestamp = client.preKeyRealVideoTs*1000 + client.iterateDruation.Milliseconds()
|
||||||
} else {
|
} else {
|
||||||
client.iterateDruation = 0
|
|
||||||
client.preKeyRealVideoTs = prePkt[i].RealTs
|
client.preKeyRealVideoTs = prePkt[i].RealTs
|
||||||
|
prePkt[i].RealTimestamp = client.preKeyRealVideoTs * 1000
|
||||||
|
client.iterateDruation = 0
|
||||||
}
|
}
|
||||||
|
client.iterateDruation += prePkt[i].Duration
|
||||||
} else {
|
} else {
|
||||||
|
prePkt[i].RealTimestamp = client.preKeyRealVideoTs*1000 + client.iterateDruation.Milliseconds()
|
||||||
client.iterateDruation += prePkt[i].Duration
|
client.iterateDruation += prePkt[i].Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
prePkt[i].RealTimestamp = client.preKeyRealVideoTs*1000 + client.iterateDruation.Milliseconds()
|
|
||||||
client.preRealVideoMs = prePkt[i].RealTimestamp
|
client.preRealVideoMs = prePkt[i].RealTimestamp
|
||||||
fmt.Println("playback duration",
|
// fmt.Println("playback duration",
|
||||||
prePkt[i].IsKeyFrame,
|
// prePkt[i].IsKeyFrame,
|
||||||
prePkt[i].Time.Milliseconds(),
|
// prePkt[i].Time.Milliseconds(),
|
||||||
curPkt.Time.Milliseconds(),
|
// curPkt.Time.Milliseconds(),
|
||||||
prePkt[i].RealTs,
|
// prePkt[i].RealTs,
|
||||||
prePkt[i].RealTimestamp,
|
// prePkt[i].RealTimestamp,
|
||||||
prePkt[i].Duration,
|
// prePkt[i].Duration,
|
||||||
client.iterateDruation)
|
// client.iterateDruation)
|
||||||
}
|
}
|
||||||
return prePkt
|
return prePkt
|
||||||
}
|
}
|
||||||
@ -389,7 +390,7 @@ func (client *RTSPClient) appendLiveViewVideoPacket(retmap []*av.Packet, nal []b
|
|||||||
}
|
}
|
||||||
client.PreDuration = prePkt[i].Duration
|
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
|
return prePkt
|
||||||
|
Loading…
Reference in New Issue
Block a user