improve examples

This commit is contained in:
aler9
2023-01-07 11:46:00 +01:00
parent bf12e12afd
commit 441a90a519
26 changed files with 85 additions and 85 deletions

View File

@@ -37,16 +37,16 @@ func main() {
log.Println("stream connected")
// create a media that contains a H265 format
medias := media.Medias{&media.Media{
medi := &media.Media{
Type: media.TypeVideo,
Formats: []format.Format{&format.H265{
PayloadTyp: 96,
}},
}}
}
// connect to the server and start recording the media
c := gortsplib.Client{}
err = c.StartRecording("rtsp://localhost:8554/mystream", medias)
err = c.StartRecording("rtsp://localhost:8554/mystream", media.Medias{medi})
if err != nil {
panic(err)
}
@@ -61,7 +61,7 @@ func main() {
}
// route RTP packet to the server
err = c.WritePacketRTP(medias[0], &pkt)
err = c.WritePacketRTP(medi, &pkt)
if err != nil {
panic(err)
}