mirror of
https://github.com/aler9/gortsplib
synced 2025-10-06 07:37:07 +08:00
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
// This example shows how to
|
||||
// 1. connect to a RTSP server
|
||||
// 2. check if there's a Opus format
|
||||
// 3. save the content of the format into a file in MPEG-TS format
|
||||
// 3. save the content of the format in a file in MPEG-TS format
|
||||
|
||||
func main() {
|
||||
c := gortsplib.Client{}
|
||||
@@ -55,19 +55,15 @@ func main() {
|
||||
fileName: "mystream.ts",
|
||||
track: &mpegts.Track{
|
||||
Codec: &mpegts.CodecOpus{
|
||||
ChannelCount: func() int {
|
||||
if forma.IsStereo {
|
||||
return 2
|
||||
}
|
||||
return 1
|
||||
}(),
|
||||
ChannelCount: forma.ChannelCount,
|
||||
},
|
||||
},
|
||||
}
|
||||
mpegtsMuxer.initialize()
|
||||
err = mpegtsMuxer.initialize()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer mpegtsMuxer.close()
|
||||
|
||||
// setup a single media
|
||||
_, err = c.Setup(desc.BaseURL, medi, 0, 0)
|
||||
|
Reference in New Issue
Block a user