add client-play-format-h264-mpeg4audio-save-to-disk example (#230) (#582)

This commit is contained in:
Alessandro Ros
2024-06-21 23:01:46 +02:00
committed by GitHub
parent 13d994d77a
commit 3ee5fbdcf7
11 changed files with 299 additions and 19 deletions

View File

@@ -13,7 +13,7 @@ import (
// This example shows how to
// 1. connect to a RTSP server
// 2. check if there's a H265 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{}
@@ -57,10 +57,11 @@ func main() {
sps: forma.SPS,
pps: forma.PPS,
}
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)