mirror of https://github.com/q191201771/lal.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
622 B
Go
34 lines
622 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"github.com/q191201771/lal/pkg/httpflv"
|
|
"github.com/q191201771/nezha/pkg/log"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
url := parseFlag()
|
|
session := httpflv.NewPullSession(httpflv.PullSessionConfig{
|
|
ConnectTimeoutMS: 0,
|
|
ReadTimeoutMS: 0,
|
|
})
|
|
err := session.Pull(url, func(tag *httpflv.Tag) {
|
|
log.Infof("ReadFlvTagCB. %+v %t %t", tag.Header, tag.IsAVCKeySeqHeader(), tag.IsAVCKeyNalu())
|
|
})
|
|
if err != nil {
|
|
log.Error(err)
|
|
return
|
|
}
|
|
}
|
|
|
|
func parseFlag() string {
|
|
url := flag.String("i", "", "specify http-flv url")
|
|
flag.Parse()
|
|
if *url == "" {
|
|
flag.Usage()
|
|
os.Exit(1)
|
|
}
|
|
return *url
|
|
}
|