mirror of
https://github.com/Monibuca/plugin-hdl.git
synced 2025-10-06 01:07:04 +08:00
读取flv文件需要跳过flv头
This commit is contained in:
3
pull.go
3
pull.go
@@ -75,10 +75,11 @@ func PullStream(streamPath, url string) error {
|
|||||||
at := stream.NewAudioTrack(0)
|
at := stream.NewAudioTrack(0)
|
||||||
vt := stream.NewVideoTrack(0)
|
vt := stream.NewVideoTrack(0)
|
||||||
go func() {
|
go func() {
|
||||||
|
file.Seek(int64(len(codec.FLVHeader)), io.SeekStart)
|
||||||
lastTs := pull(at, vt, file, 0)
|
lastTs := pull(at, vt, file, 0)
|
||||||
if config.Reconnect {
|
if config.Reconnect {
|
||||||
for stream.Err() == nil {
|
for stream.Err() == nil {
|
||||||
file.Seek(0, io.SeekStart)
|
file.Seek(int64(len(codec.FLVHeader)), io.SeekStart)
|
||||||
lastTs = pull(at, vt, file, lastTs)
|
lastTs = pull(at, vt, file, lastTs)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user