add client-read-h264 example

This commit is contained in:
aler9
2021-03-07 17:26:41 +01:00
parent 4419e8ac30
commit f5c2308431
6 changed files with 61 additions and 10 deletions

View File

@@ -9,8 +9,7 @@ import (
// This example shows how to
// 1. set additional client options
// 2. connect to a RTSP server
// 3. read all tracks on a path
// 2. connect to a RTSP server and read all tracks on a path
func main() {
// ClientConf allows to set additional client options
@@ -32,7 +31,7 @@ func main() {
// read track frames
err = <-conn.ReadFrames(func(trackID int, typ gortsplib.StreamType, buf []byte) {
fmt.Printf("frame from track %d, type %v: %v\n", trackID, typ, buf)
fmt.Printf("frame from track %d, type %v, size %d\n", trackID, typ, len(buf))
})
panic(err)
}