Repository: bluenviron/gortsplib
Pull request #222 (2023-04-01 11:17:57)

merge format and formatdecenc into formats


Patch:
diff --git a/client.go b/client.go
index a2e5772c..30a54430 100644
--- a/client.go
+++ b/client.go
@@ -24,7 +24,7 @@ import (
 	"github.com/bluenviron/gortsplib/v3/pkg/base"
 	"github.com/bluenviron/gortsplib/v3/pkg/bytecounter"
 	"github.com/bluenviron/gortsplib/v3/pkg/conn"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/headers"
 	"github.com/bluenviron/gortsplib/v3/pkg/liberrors"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
@@ -1642,7 +1642,7 @@ func (c *Client) Seek(ra *headers.Range) (*base.Response, error) {
 }
 
 // OnPacketRTPAny sets the callback that is called when a RTP packet is read from any setupped media.
-func (c *Client) OnPacketRTPAny(cb func(*media.Media, format.Format, *rtp.Packet)) {
+func (c *Client) OnPacketRTPAny(cb func(*media.Media, formats.Format, *rtp.Packet)) {
 	for _, cm := range c.medias {
 		cmedia := cm.media
 		for _, forma := range cm.media.Formats {
@@ -1664,7 +1664,7 @@ func (c *Client) OnPacketRTCPAny(cb func(*media.Media, rtcp.Packet)) {
 }
 
 // OnPacketRTP sets the callback that is called when a RTP packet is read.
-func (c *Client) OnPacketRTP(medi *media.Media, forma format.Format, cb func(*rtp.Packet)) {
+func (c *Client) OnPacketRTP(medi *media.Media, forma formats.Format, cb func(*rtp.Packet)) {
 	cm := c.medias[medi]
 	ct := cm.formats[forma.PayloadType()]
 	ct.onPacketRTP = cb
diff --git a/client_format.go b/client_format.go
index eb60ef5b..35e45fc9 100644
--- a/client_format.go
+++ b/client_format.go
@@ -6,7 +6,7 @@ import (
 	"github.com/pion/rtcp"
 	"github.com/pion/rtp"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/rtcpreceiver"
 	"github.com/bluenviron/gortsplib/v3/pkg/rtcpsender"
 	"github.com/bluenviron/gortsplib/v3/pkg/rtpreorderer"
@@ -15,14 +15,14 @@ import (
 type clientFormat struct {
 	c               *Client
 	cm              *clientMedia
-	format          format.Format
+	format          formats.Format
 	udpReorderer    *rtpreorderer.Reorderer    // play
 	udpRTCPReceiver *rtcpreceiver.RTCPReceiver // play
 	rtcpSender      *rtcpsender.RTCPSender     // record
 	onPacketRTP     func(*rtp.Packet)
 }
 
-func newClientFormat(cm *clientMedia, forma format.Format) *clientFormat {
+func newClientFormat(cm *clientMedia, forma formats.Format) *clientFormat {
 	return &clientFormat{
 		c:           cm.c,
 		cm:          cm,
diff --git a/examples/client-publish-format-g711/main.go b/examples/client-publish-format-g711/main.go
index 4a477a87..93faae4d 100644
--- a/examples/client-publish-format-g711/main.go
+++ b/examples/client-publish-format-g711/main.go
@@ -5,7 +5,7 @@ import (
 	"net"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -38,7 +38,7 @@ func main() {
 	// create a media that contains a G711 format
 	medi := &media.Media{
 		Type:    media.TypeAudio,
-		Formats: []format.Format{&format.G711{}},
+		Formats: []formats.Format{&formats.G711{}},
 	}
 
 	c := gortsplib.Client{}
diff --git a/examples/client-publish-format-g722/main.go b/examples/client-publish-format-g722/main.go
index 40f020fe..e25e0782 100644
--- a/examples/client-publish-format-g722/main.go
+++ b/examples/client-publish-format-g722/main.go
@@ -5,7 +5,7 @@ import (
 	"net"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -38,7 +38,7 @@ func main() {
 	// create a media that contains a G722 format
 	medi := &media.Media{
 		Type:    media.TypeAudio,
-		Formats: []format.Format{&format.G722{}},
+		Formats: []formats.Format{&formats.G722{}},
 	}
 
 	c := gortsplib.Client{}
diff --git a/examples/client-publish-format-h264/main.go b/examples/client-publish-format-h264/main.go
index 6c92dac2..739c28b4 100644
--- a/examples/client-publish-format-h264/main.go
+++ b/examples/client-publish-format-h264/main.go
@@ -5,7 +5,7 @@ import (
 	"net"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -39,7 +39,7 @@ func main() {
 	// create a media that contains a H264 format
 	medi := &media.Media{
 		Type: media.TypeVideo,
-		Formats: []format.Format{&format.H264{
+		Formats: []formats.Format{&formats.H264{
 			PayloadTyp:        96,
 			PacketizationMode: 1,
 		}},
diff --git a/examples/client-publish-format-h265/main.go b/examples/client-publish-format-h265/main.go
index d57cc79e..546f3439 100644
--- a/examples/client-publish-format-h265/main.go
+++ b/examples/client-publish-format-h265/main.go
@@ -5,7 +5,7 @@ import (
 	"net"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -39,7 +39,7 @@ func main() {
 	// create a media that contains a H265 format
 	medi := &media.Media{
 		Type: media.TypeVideo,
-		Formats: []format.Format{&format.H265{
+		Formats: []formats.Format{&formats.H265{
 			PayloadTyp: 96,
 		}},
 	}
diff --git a/examples/client-publish-format-lpcm/main.go b/examples/client-publish-format-lpcm/main.go
index 2143c122..c1f1245e 100644
--- a/examples/client-publish-format-lpcm/main.go
+++ b/examples/client-publish-format-lpcm/main.go
@@ -5,7 +5,7 @@ import (
 	"net"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -38,7 +38,7 @@ func main() {
 	// create a media that contains a LPCM format
 	medi := &media.Media{
 		Type: media.TypeAudio,
-		Formats: []format.Format{&format.LPCM{
+		Formats: []formats.Format{&formats.LPCM{
 			PayloadTyp:   96,
 			BitDepth:     16,
 			SampleRate:   44100,
diff --git a/examples/client-publish-format-mjpeg/main.go b/examples/client-publish-format-mjpeg/main.go
index 7c21b826..73ad3c44 100644
--- a/examples/client-publish-format-mjpeg/main.go
+++ b/examples/client-publish-format-mjpeg/main.go
@@ -5,7 +5,7 @@ import (
 	"net"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -38,7 +38,7 @@ func main() {
 	// create a media that contains a M-JPEG format
 	medi := &media.Media{
 		Type:    media.TypeVideo,
-		Formats: []format.Format{&format.MJPEG{}},
+		Formats: []formats.Format{&formats.MJPEG{}},
 	}
 
 	// connect to the server and start recording the media
diff --git a/examples/client-publish-format-mpeg4audio/main.go b/examples/client-publish-format-mpeg4audio/main.go
index bf5073e3..3b622766 100644
--- a/examples/client-publish-format-mpeg4audio/main.go
+++ b/examples/client-publish-format-mpeg4audio/main.go
@@ -6,7 +6,7 @@ import (
 
 	"github.com/bluenviron/gortsplib/v3"
 	"github.com/bluenviron/gortsplib/v3/pkg/codecs/mpeg4audio"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -39,7 +39,7 @@ func main() {
 	// create a media that contains a MPEG4-audio format
 	medi := &media.Media{
 		Type: media.TypeAudio,
-		Formats: []format.Format{&format.MPEG4Audio{
+		Formats: []formats.Format{&formats.MPEG4Audio{
 			PayloadTyp: 96,
 			Config: &mpeg4audio.Config{
 				Type:         mpeg4audio.ObjectTypeAACLC,
diff --git a/examples/client-publish-format-opus/main.go b/examples/client-publish-format-opus/main.go
index 3da30083..a1d0c139 100644
--- a/examples/client-publish-format-opus/main.go
+++ b/examples/client-publish-format-opus/main.go
@@ -5,7 +5,7 @@ import (
 	"net"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -38,7 +38,7 @@ func main() {
 	// create a media that contains a Opus format
 	medi := &media.Media{
 		Type: media.TypeAudio,
-		Formats: []format.Format{&format.Opus{
+		Formats: []formats.Format{&formats.Opus{
 			PayloadTyp: 96,
 			IsStereo:   false,
 		}},
diff --git a/examples/client-publish-format-vp8/main.go b/examples/client-publish-format-vp8/main.go
index 93b5f5e6..e20a73c0 100644
--- a/examples/client-publish-format-vp8/main.go
+++ b/examples/client-publish-format-vp8/main.go
@@ -5,7 +5,7 @@ import (
 	"net"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -39,7 +39,7 @@ func main() {
 	// create a media that contains a VP8 format
 	medi := &media.Media{
 		Type: media.TypeVideo,
-		Formats: []format.Format{&format.VP8{
+		Formats: []formats.Format{&formats.VP8{
 			PayloadTyp: 96,
 		}},
 	}
diff --git a/examples/client-publish-format-vp9/main.go b/examples/client-publish-format-vp9/main.go
index 1a84f3c6..f064930a 100644
--- a/examples/client-publish-format-vp9/main.go
+++ b/examples/client-publish-format-vp9/main.go
@@ -5,7 +5,7 @@ import (
 	"net"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -39,7 +39,7 @@ func main() {
 	// create a media that contains a VP9 format
 	medi := &media.Media{
 		Type: media.TypeVideo,
-		Formats: []format.Format{&format.VP9{
+		Formats: []formats.Format{&formats.VP9{
 			PayloadTyp: 96,
 		}},
 	}
diff --git a/examples/client-publish-options/main.go b/examples/client-publish-options/main.go
index 0933af6c..f5e2636a 100644
--- a/examples/client-publish-options/main.go
+++ b/examples/client-publish-options/main.go
@@ -6,7 +6,7 @@ import (
 	"time"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -40,7 +40,7 @@ func main() {
 	// create a media that contains a H264 media
 	medi := &media.Media{
 		Type: media.TypeVideo,
-		Formats: []format.Format{&format.H264{
+		Formats: []formats.Format{&formats.H264{
 			PayloadTyp:        96,
 			PacketizationMode: 1,
 		}},
diff --git a/examples/client-publish-pause/main.go b/examples/client-publish-pause/main.go
index ed78951a..d8ca5481 100644
--- a/examples/client-publish-pause/main.go
+++ b/examples/client-publish-pause/main.go
@@ -6,7 +6,7 @@ import (
 	"time"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/pion/rtp"
 )
@@ -41,7 +41,7 @@ func main() {
 	// create a media that contains a H264 format
 	medi := &media.Media{
 		Type: media.TypeVideo,
-		Formats: []format.Format{&format.H264{
+		Formats: []formats.Format{&formats.H264{
 			PayloadTyp:        96,
 			PacketizationMode: 1,
 		}},
diff --git a/examples/client-read-format-g711/main.go b/examples/client-read-format-g711/main.go
index fea8a4cf..430e2834 100644
--- a/examples/client-read-format-g711/main.go
+++ b/examples/client-read-format-g711/main.go
@@ -4,7 +4,7 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -37,7 +37,7 @@ func main() {
 	}
 
 	// find the G711 media and format
-	var forma *format.G711
+	var forma *formats.G711
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-format-g722/main.go b/examples/client-read-format-g722/main.go
index ecb875fa..2b26385c 100644
--- a/examples/client-read-format-g722/main.go
+++ b/examples/client-read-format-g722/main.go
@@ -4,7 +4,7 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -37,7 +37,7 @@ func main() {
 	}
 
 	// find the G722 media and format
-	var forma *format.G722
+	var forma *formats.G722
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-format-h264-convert-to-jpeg/main.go b/examples/client-read-format-h264-convert-to-jpeg/main.go
index 350c729f..09cb83ee 100644
--- a/examples/client-read-format-h264-convert-to-jpeg/main.go
+++ b/examples/client-read-format-h264-convert-to-jpeg/main.go
@@ -9,8 +9,8 @@ import (
 	"time"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtph264"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtph264"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -64,7 +64,7 @@ func main() {
 	}
 
 	// find the H264 media and format
-	var forma *format.H264
+	var forma *formats.H264
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-format-h264-save-to-disk/main.go b/examples/client-read-format-h264-save-to-disk/main.go
index 9e0eec00..35279afe 100644
--- a/examples/client-read-format-h264-save-to-disk/main.go
+++ b/examples/client-read-format-h264-save-to-disk/main.go
@@ -4,8 +4,8 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtph264"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtph264"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -38,7 +38,7 @@ func main() {
 	}
 
 	// find the H264 media and format
-	var forma *format.H264
+	var forma *formats.H264
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-format-h264/main.go b/examples/client-read-format-h264/main.go
index fc3e9bc4..bd3f68a2 100644
--- a/examples/client-read-format-h264/main.go
+++ b/examples/client-read-format-h264/main.go
@@ -4,8 +4,8 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtph264"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtph264"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -41,7 +41,7 @@ func main() {
 	}
 
 	// find the H264 media and format
-	var forma *format.H264
+	var forma *formats.H264
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-format-h265/main.go b/examples/client-read-format-h265/main.go
index bbd7de94..16334323 100644
--- a/examples/client-read-format-h265/main.go
+++ b/examples/client-read-format-h265/main.go
@@ -4,8 +4,8 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtph265"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtph265"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -38,7 +38,7 @@ func main() {
 	}
 
 	// find the H265 media and format
-	var forma *format.H265
+	var forma *formats.H265
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-format-lpcm/main.go b/examples/client-read-format-lpcm/main.go
index 3635556d..094e32d0 100644
--- a/examples/client-read-format-lpcm/main.go
+++ b/examples/client-read-format-lpcm/main.go
@@ -4,7 +4,7 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -37,7 +37,7 @@ func main() {
 	}
 
 	// find the LPCM media and format
-	var forma *format.LPCM
+	var forma *formats.LPCM
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-format-mjpeg/main.go b/examples/client-read-format-mjpeg/main.go
index ec97712b..af421b19 100644
--- a/examples/client-read-format-mjpeg/main.go
+++ b/examples/client-read-format-mjpeg/main.go
@@ -6,8 +6,8 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpmjpeg"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpmjpeg"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -41,7 +41,7 @@ func main() {
 	}
 
 	// find the M-JPEG media and format
-	var forma *format.MJPEG
+	var forma *formats.MJPEG
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-format-mpeg4audio/main.go b/examples/client-read-format-mpeg4audio/main.go
index ce0ad8d2..600e1cad 100644
--- a/examples/client-read-format-mpeg4audio/main.go
+++ b/examples/client-read-format-mpeg4audio/main.go
@@ -4,7 +4,7 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -37,7 +37,7 @@ func main() {
 	}
 
 	// find the MPEG4-audio media and format
-	var forma *format.MPEG4Audio
+	var forma *formats.MPEG4Audio
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-format-opus/main.go b/examples/client-read-format-opus/main.go
index 015638bc..01656540 100644
--- a/examples/client-read-format-opus/main.go
+++ b/examples/client-read-format-opus/main.go
@@ -4,7 +4,7 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -37,7 +37,7 @@ func main() {
 	}
 
 	// find the Opus media and format
-	var forma *format.Opus
+	var forma *formats.Opus
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-format-vp8/main.go b/examples/client-read-format-vp8/main.go
index 5316954f..c5ad323a 100644
--- a/examples/client-read-format-vp8/main.go
+++ b/examples/client-read-format-vp8/main.go
@@ -4,8 +4,8 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpvp8"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpvp8"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -38,7 +38,7 @@ func main() {
 	}
 
 	// find the VP8 media and format
-	var forma *format.VP8
+	var forma *formats.VP8
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-format-vp9/main.go b/examples/client-read-format-vp9/main.go
index 5fa60e1e..05d71a5e 100644
--- a/examples/client-read-format-vp9/main.go
+++ b/examples/client-read-format-vp9/main.go
@@ -4,8 +4,8 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpvp9"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpvp9"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
 )
@@ -38,7 +38,7 @@ func main() {
 	}
 
 	// find the VP9 media and format
-	var forma *format.VP9
+	var forma *formats.VP9
 	medi := medias.FindFormat(&forma)
 	if medi == nil {
 		panic("media not found")
diff --git a/examples/client-read-options/main.go b/examples/client-read-options/main.go
index 08964d55..9b3a6690 100644
--- a/examples/client-read-options/main.go
+++ b/examples/client-read-options/main.go
@@ -5,7 +5,7 @@ import (
 	"time"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtcp"
@@ -53,7 +53,7 @@ func main() {
 	}
 
 	// called when a RTP packet arrives
-	c.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+	c.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 		log.Printf("RTP packet from media %v\n", medi)
 	})
 
diff --git a/examples/client-read-pause/main.go b/examples/client-read-pause/main.go
index 98a46fb2..ba6cdd32 100644
--- a/examples/client-read-pause/main.go
+++ b/examples/client-read-pause/main.go
@@ -5,7 +5,7 @@ import (
 	"time"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtcp"
@@ -47,7 +47,7 @@ func main() {
 	}
 
 	// called when a RTP packet arrives
-	c.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+	c.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 		log.Printf("RTP packet from media %v\n", medi)
 	})
 
diff --git a/examples/client-read-republish/main.go b/examples/client-read-republish/main.go
index 2b64937d..55707432 100644
--- a/examples/client-read-republish/main.go
+++ b/examples/client-read-republish/main.go
@@ -4,7 +4,7 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
@@ -54,7 +54,7 @@ func main() {
 	defer publisher.Close()
 
 	// read RTP packets from the reader and route them to the publisher
-	reader.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+	reader.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 		publisher.WritePacketRTP(medi, pkt)
 	})
 
diff --git a/examples/client-read/main.go b/examples/client-read/main.go
index 42f1e7bc..172bd914 100644
--- a/examples/client-read/main.go
+++ b/examples/client-read/main.go
@@ -4,7 +4,7 @@ import (
 	"log"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtcp"
@@ -44,7 +44,7 @@ func main() {
 	}
 
 	// called when a RTP packet arrives
-	c.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+	c.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 		log.Printf("RTP packet from media %v\n", medi)
 	})
 
diff --git a/examples/proxy/client.go b/examples/proxy/client.go
index c337f375..8a177277 100644
--- a/examples/proxy/client.go
+++ b/examples/proxy/client.go
@@ -6,7 +6,7 @@ import (
 	"time"
 
 	"github.com/bluenviron/gortsplib/v3"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 	"github.com/pion/rtp"
@@ -93,7 +93,7 @@ func (c *client) read() error {
 	}()
 
 	// called when a RTP packet arrives
-	rc.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+	rc.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 		// route incoming packets to the server stream
 		stream.WritePacketRTP(medi, pkt)
 	})
diff --git a/examples/server-h264-save-to-disk/main.go b/examples/server-h264-save-to-disk/main.go
index 82104520..2684a568 100644
--- a/examples/server-h264-save-to-disk/main.go
+++ b/examples/server-h264-save-to-disk/main.go
@@ -9,8 +9,8 @@ import (
 
 	"github.com/bluenviron/gortsplib/v3"
 	"github.com/bluenviron/gortsplib/v3/pkg/base"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtph264"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtph264"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 )
 
@@ -23,7 +23,7 @@ type serverHandler struct {
 	mutex       sync.Mutex
 	publisher   *gortsplib.ServerSession
 	media       *media.Media
-	format      *format.H264
+	format      *formats.H264
 	rtpDec      *rtph264.Decoder
 	mpegtsMuxer *mpegtsMuxer
 }
@@ -67,7 +67,7 @@ func (sh *serverHandler) OnAnnounce(ctx *gortsplib.ServerHandlerOnAnnounceCtx) (
 	}
 
 	// find the H264 media and format
-	var forma *format.H264
+	var forma *formats.H264
 	medi := ctx.Medias.FindFormat(&forma)
 	if medi == nil {
 		return &base.Response{
diff --git a/examples/server-tls/main.go b/examples/server-tls/main.go
index d37b8cb2..d5387f89 100644
--- a/examples/server-tls/main.go
+++ b/examples/server-tls/main.go
@@ -9,7 +9,7 @@ import (
 
 	"github.com/bluenviron/gortsplib/v3"
 	"github.com/bluenviron/gortsplib/v3/pkg/base"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 )
 
@@ -126,7 +126,7 @@ func (sh *serverHandler) OnRecord(ctx *gortsplib.ServerHandlerOnRecordCtx) (*bas
 	log.Printf("record request")
 
 	// called when receiving a RTP packet
-	ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+	ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 		// route the RTP packet to all readers
 		sh.stream.WritePacketRTP(medi, pkt)
 	})
diff --git a/examples/server/main.go b/examples/server/main.go
index 54007829..a17ed392 100644
--- a/examples/server/main.go
+++ b/examples/server/main.go
@@ -8,7 +8,7 @@ import (
 
 	"github.com/bluenviron/gortsplib/v3"
 	"github.com/bluenviron/gortsplib/v3/pkg/base"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 )
 
@@ -125,7 +125,7 @@ func (sh *serverHandler) OnRecord(ctx *gortsplib.ServerHandlerOnRecordCtx) (*bas
 	log.Printf("record request")
 
 	// called when receiving a RTP packet
-	ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+	ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 		// route the RTP packet to all readers
 		sh.stream.WritePacketRTP(medi, pkt)
 	})
diff --git a/pkg/formatdecenc/formatdecenc.go b/pkg/formatdecenc/formatdecenc.go
deleted file mode 100644
index 8cb1250a..00000000
--- a/pkg/formatdecenc/formatdecenc.go
+++ /dev/null
@@ -1,2 +0,0 @@
-// Package formatdecenc contains decoders and encoders to decode and encode RTP packets.
-package formatdecenc
diff --git a/pkg/format/format.go b/pkg/formats/format.go
similarity index 97%
rename from pkg/format/format.go
rename to pkg/formats/format.go
index be59453c..d20a40bb 100644
--- a/pkg/format/format.go
+++ b/pkg/formats/format.go
@@ -1,5 +1,5 @@
-// Package format contains format definitions.
-package format
+// Package formats contains RTP format definitions, decoders and encoders.
+package formats
 
 import (
 	"strconv"
diff --git a/pkg/format/g711.go b/pkg/formats/g711.go
similarity index 94%
rename from pkg/format/g711.go
rename to pkg/formats/g711.go
index 828d25ec..1fd907a7 100644
--- a/pkg/format/g711.go
+++ b/pkg/formats/g711.go
@@ -1,9 +1,9 @@
-package format
+package formats
 
 import (
 	"github.com/pion/rtp"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpsimpleaudio"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpsimpleaudio"
 )
 
 // G711 is a format that uses the G711 codec, encoded with mu-law or A-law.
diff --git a/pkg/format/g722.go b/pkg/formats/g722.go
similarity index 93%
rename from pkg/format/g722.go
rename to pkg/formats/g722.go
index 45373098..195f4d06 100644
--- a/pkg/format/g722.go
+++ b/pkg/formats/g722.go
@@ -1,9 +1,9 @@
-package format
+package formats
 
 import (
 	"github.com/pion/rtp"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpsimpleaudio"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpsimpleaudio"
 )
 
 // G722 is a format that uses the G722 codec.
diff --git a/pkg/format/generic.go b/pkg/formats/generic.go
similarity index 99%
rename from pkg/format/generic.go
rename to pkg/formats/generic.go
index 2b0be3cd..6e74ce23 100644
--- a/pkg/format/generic.go
+++ b/pkg/formats/generic.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"fmt"
diff --git a/pkg/format/h264.go b/pkg/formats/h264.go
similarity index 98%
rename from pkg/format/h264.go
rename to pkg/formats/h264.go
index 80bfba9b..2e0e550a 100644
--- a/pkg/format/h264.go
+++ b/pkg/formats/h264.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"encoding/base64"
@@ -11,7 +11,7 @@ import (
 	"github.com/pion/rtp"
 
 	"github.com/bluenviron/gortsplib/v3/pkg/codecs/h264"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtph264"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtph264"
 )
 
 // check whether a RTP/H264 packet contains a IDR, without decoding the packet.
diff --git a/pkg/format/h265.go b/pkg/formats/h265.go
similarity index 97%
rename from pkg/format/h265.go
rename to pkg/formats/h265.go
index 261251e8..ad73239c 100644
--- a/pkg/format/h265.go
+++ b/pkg/formats/h265.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"encoding/base64"
@@ -8,7 +8,7 @@ import (
 
 	"github.com/pion/rtp"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtph265"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtph265"
 )
 
 // H265 is a format that uses the H265 codec.
diff --git a/pkg/format/lpcm.go b/pkg/formats/lpcm.go
similarity index 96%
rename from pkg/format/lpcm.go
rename to pkg/formats/lpcm.go
index de7bdfec..670580d0 100644
--- a/pkg/format/lpcm.go
+++ b/pkg/formats/lpcm.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"strconv"
@@ -6,7 +6,7 @@ import (
 
 	"github.com/pion/rtp"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtplpcm"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtplpcm"
 )
 
 // LPCM is a format that uses the uncompressed, Linear PCM codec.
diff --git a/pkg/format/mjpeg.go b/pkg/formats/mjpeg.go
similarity index 93%
rename from pkg/format/mjpeg.go
rename to pkg/formats/mjpeg.go
index 0ea6a0fb..16d07546 100644
--- a/pkg/format/mjpeg.go
+++ b/pkg/formats/mjpeg.go
@@ -1,9 +1,9 @@
-package format
+package formats
 
 import (
 	"github.com/pion/rtp"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpmjpeg"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpmjpeg"
 )
 
 // MJPEG is a format that uses the Motion-JPEG codec.
diff --git a/pkg/format/mpeg2_audio.go b/pkg/formats/mpeg2_audio.go
similarity index 97%
rename from pkg/format/mpeg2_audio.go
rename to pkg/formats/mpeg2_audio.go
index 755f5f31..85cff24a 100644
--- a/pkg/format/mpeg2_audio.go
+++ b/pkg/formats/mpeg2_audio.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"github.com/pion/rtp"
diff --git a/pkg/format/mpeg2_video.go b/pkg/formats/mpeg2_video.go
similarity index 97%
rename from pkg/format/mpeg2_video.go
rename to pkg/formats/mpeg2_video.go
index d0b6e1dd..18bb8bbe 100644
--- a/pkg/format/mpeg2_video.go
+++ b/pkg/formats/mpeg2_video.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"github.com/pion/rtp"
diff --git a/pkg/format/mpeg4_audio.go b/pkg/formats/mpeg4_audio.go
similarity index 97%
rename from pkg/format/mpeg4_audio.go
rename to pkg/formats/mpeg4_audio.go
index 1260e614..7da4f8d5 100644
--- a/pkg/format/mpeg4_audio.go
+++ b/pkg/formats/mpeg4_audio.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"encoding/hex"
@@ -8,7 +8,7 @@ import (
 	"github.com/pion/rtp"
 
 	"github.com/bluenviron/gortsplib/v3/pkg/codecs/mpeg4audio"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpmpeg4audio"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpmpeg4audio"
 )
 
 // MPEG4Audio is a format that uses a MPEG-4 audio codec.
diff --git a/pkg/format/opus.go b/pkg/formats/opus.go
similarity index 96%
rename from pkg/format/opus.go
rename to pkg/formats/opus.go
index bb24b94e..22431db0 100644
--- a/pkg/format/opus.go
+++ b/pkg/formats/opus.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"fmt"
@@ -7,7 +7,7 @@ import (
 
 	"github.com/pion/rtp"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpsimpleaudio"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpsimpleaudio"
 )
 
 // Opus is a format that uses the Opus codec.
diff --git a/pkg/formatdecenc/rtph264/decoder.go b/pkg/formats/rtph264/decoder.go
similarity index 100%
rename from pkg/formatdecenc/rtph264/decoder.go
rename to pkg/formats/rtph264/decoder.go
diff --git a/pkg/formatdecenc/rtph264/decoder_test.go b/pkg/formats/rtph264/decoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtph264/decoder_test.go
rename to pkg/formats/rtph264/decoder_test.go
diff --git a/pkg/formatdecenc/rtph264/encoder.go b/pkg/formats/rtph264/encoder.go
similarity index 100%
rename from pkg/formatdecenc/rtph264/encoder.go
rename to pkg/formats/rtph264/encoder.go
diff --git a/pkg/formatdecenc/rtph264/encoder_test.go b/pkg/formats/rtph264/encoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtph264/encoder_test.go
rename to pkg/formats/rtph264/encoder_test.go
diff --git a/pkg/formatdecenc/rtph264/rtph264.go b/pkg/formats/rtph264/rtph264.go
similarity index 100%
rename from pkg/formatdecenc/rtph264/rtph264.go
rename to pkg/formats/rtph264/rtph264.go
diff --git a/pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/048b606517c23baffac96520675af386f92f471f22f098caec184d581dd6292e b/pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/048b606517c23baffac96520675af386f92f471f22f098caec184d581dd6292e
similarity index 100%
rename from pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/048b606517c23baffac96520675af386f92f471f22f098caec184d581dd6292e
rename to pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/048b606517c23baffac96520675af386f92f471f22f098caec184d581dd6292e
diff --git a/pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/17ec193e17dd91d1b2a621884383564489d9f873db1b015a693c79fb7c1c1a46 b/pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/17ec193e17dd91d1b2a621884383564489d9f873db1b015a693c79fb7c1c1a46
similarity index 100%
rename from pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/17ec193e17dd91d1b2a621884383564489d9f873db1b015a693c79fb7c1c1a46
rename to pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/17ec193e17dd91d1b2a621884383564489d9f873db1b015a693c79fb7c1c1a46
diff --git a/pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/55cc57e8de6f7821309a6444040480f3aa0128b6b6cd96325b7997ff47d5d29d b/pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/55cc57e8de6f7821309a6444040480f3aa0128b6b6cd96325b7997ff47d5d29d
similarity index 100%
rename from pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/55cc57e8de6f7821309a6444040480f3aa0128b6b6cd96325b7997ff47d5d29d
rename to pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/55cc57e8de6f7821309a6444040480f3aa0128b6b6cd96325b7997ff47d5d29d
diff --git a/pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/c30437d5edf1393c2957896ca6c4e4d0467a50451fd1feb1cae249fdcbf25a5a b/pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/c30437d5edf1393c2957896ca6c4e4d0467a50451fd1feb1cae249fdcbf25a5a
similarity index 100%
rename from pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/c30437d5edf1393c2957896ca6c4e4d0467a50451fd1feb1cae249fdcbf25a5a
rename to pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/c30437d5edf1393c2957896ca6c4e4d0467a50451fd1feb1cae249fdcbf25a5a
diff --git a/pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/c89423ac94e1743f63fb142431eed08c3b74e51a4e7b8ed44a1ba826ca6129d9 b/pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/c89423ac94e1743f63fb142431eed08c3b74e51a4e7b8ed44a1ba826ca6129d9
similarity index 100%
rename from pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/c89423ac94e1743f63fb142431eed08c3b74e51a4e7b8ed44a1ba826ca6129d9
rename to pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/c89423ac94e1743f63fb142431eed08c3b74e51a4e7b8ed44a1ba826ca6129d9
diff --git a/pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/caf81e9797b19c76c1fc4dbf537d4d81f389524539f402d13aa01f93a65ac7e9 b/pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/caf81e9797b19c76c1fc4dbf537d4d81f389524539f402d13aa01f93a65ac7e9
similarity index 100%
rename from pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/caf81e9797b19c76c1fc4dbf537d4d81f389524539f402d13aa01f93a65ac7e9
rename to pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/caf81e9797b19c76c1fc4dbf537d4d81f389524539f402d13aa01f93a65ac7e9
diff --git a/pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/f428976a5b2917c009d1f28d7a96e81095be8631f062798130aa7e6835b67b01 b/pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/f428976a5b2917c009d1f28d7a96e81095be8631f062798130aa7e6835b67b01
similarity index 100%
rename from pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/f428976a5b2917c009d1f28d7a96e81095be8631f062798130aa7e6835b67b01
rename to pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/f428976a5b2917c009d1f28d7a96e81095be8631f062798130aa7e6835b67b01
diff --git a/pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/fe107a097efccd5098d6b0147ef4b39f0e467f0257dbf8f8b2f256c235640a6e b/pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/fe107a097efccd5098d6b0147ef4b39f0e467f0257dbf8f8b2f256c235640a6e
similarity index 100%
rename from pkg/formatdecenc/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/fe107a097efccd5098d6b0147ef4b39f0e467f0257dbf8f8b2f256c235640a6e
rename to pkg/formats/rtph264/testdata/fuzz/FuzzDecoderUnmarshal/fe107a097efccd5098d6b0147ef4b39f0e467f0257dbf8f8b2f256c235640a6e
diff --git a/pkg/formatdecenc/rtph265/decoder.go b/pkg/formats/rtph265/decoder.go
similarity index 100%
rename from pkg/formatdecenc/rtph265/decoder.go
rename to pkg/formats/rtph265/decoder.go
diff --git a/pkg/formatdecenc/rtph265/decoder_test.go b/pkg/formats/rtph265/decoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtph265/decoder_test.go
rename to pkg/formats/rtph265/decoder_test.go
diff --git a/pkg/formatdecenc/rtph265/encoder.go b/pkg/formats/rtph265/encoder.go
similarity index 100%
rename from pkg/formatdecenc/rtph265/encoder.go
rename to pkg/formats/rtph265/encoder.go
diff --git a/pkg/formatdecenc/rtph265/encoder_test.go b/pkg/formats/rtph265/encoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtph265/encoder_test.go
rename to pkg/formats/rtph265/encoder_test.go
diff --git a/pkg/formatdecenc/rtph265/rtph265.go b/pkg/formats/rtph265/rtph265.go
similarity index 100%
rename from pkg/formatdecenc/rtph265/rtph265.go
rename to pkg/formats/rtph265/rtph265.go
diff --git a/pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/353ba911ad2dc1916f0bb9eb5e553575e27c9a6662e86d265f55bd57d1746962 b/pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/353ba911ad2dc1916f0bb9eb5e553575e27c9a6662e86d265f55bd57d1746962
similarity index 100%
rename from pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/353ba911ad2dc1916f0bb9eb5e553575e27c9a6662e86d265f55bd57d1746962
rename to pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/353ba911ad2dc1916f0bb9eb5e553575e27c9a6662e86d265f55bd57d1746962
diff --git a/pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/6e0463cbdc2d559f2823538d2efee4a8b811c3ea02d2bd8e0f306d81382d5698 b/pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/6e0463cbdc2d559f2823538d2efee4a8b811c3ea02d2bd8e0f306d81382d5698
similarity index 100%
rename from pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/6e0463cbdc2d559f2823538d2efee4a8b811c3ea02d2bd8e0f306d81382d5698
rename to pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/6e0463cbdc2d559f2823538d2efee4a8b811c3ea02d2bd8e0f306d81382d5698
diff --git a/pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/95aa14d7ab02ec8b5c470dcc780587540caba1589c6a7ce702ff84edca9b3133 b/pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/95aa14d7ab02ec8b5c470dcc780587540caba1589c6a7ce702ff84edca9b3133
similarity index 100%
rename from pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/95aa14d7ab02ec8b5c470dcc780587540caba1589c6a7ce702ff84edca9b3133
rename to pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/95aa14d7ab02ec8b5c470dcc780587540caba1589c6a7ce702ff84edca9b3133
diff --git a/pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/c4389a565e8280502fc611cde347896b5d167806b2e49e22db23bed73deef75b b/pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/c4389a565e8280502fc611cde347896b5d167806b2e49e22db23bed73deef75b
similarity index 100%
rename from pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/c4389a565e8280502fc611cde347896b5d167806b2e49e22db23bed73deef75b
rename to pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/c4389a565e8280502fc611cde347896b5d167806b2e49e22db23bed73deef75b
diff --git a/pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/caf81e9797b19c76c1fc4dbf537d4d81f389524539f402d13aa01f93a65ac7e9 b/pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/caf81e9797b19c76c1fc4dbf537d4d81f389524539f402d13aa01f93a65ac7e9
similarity index 100%
rename from pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/caf81e9797b19c76c1fc4dbf537d4d81f389524539f402d13aa01f93a65ac7e9
rename to pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/caf81e9797b19c76c1fc4dbf537d4d81f389524539f402d13aa01f93a65ac7e9
diff --git a/pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/cb84a08ac93f5772ee3ba0f0bcfde81c9cd71a403c69f893cebc8378c60af625 b/pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/cb84a08ac93f5772ee3ba0f0bcfde81c9cd71a403c69f893cebc8378c60af625
similarity index 100%
rename from pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/cb84a08ac93f5772ee3ba0f0bcfde81c9cd71a403c69f893cebc8378c60af625
rename to pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/cb84a08ac93f5772ee3ba0f0bcfde81c9cd71a403c69f893cebc8378c60af625
diff --git a/pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/e45ead12fae619dd0807aaf83341d58eca4d50fab6eefbe78953581a1a4df198 b/pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/e45ead12fae619dd0807aaf83341d58eca4d50fab6eefbe78953581a1a4df198
similarity index 100%
rename from pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/e45ead12fae619dd0807aaf83341d58eca4d50fab6eefbe78953581a1a4df198
rename to pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/e45ead12fae619dd0807aaf83341d58eca4d50fab6eefbe78953581a1a4df198
diff --git a/pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/eb4593a9592045ab0cf0b17a3f9f2754d6898ee465ec32d9e08392bcbab0a81a b/pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/eb4593a9592045ab0cf0b17a3f9f2754d6898ee465ec32d9e08392bcbab0a81a
similarity index 100%
rename from pkg/formatdecenc/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/eb4593a9592045ab0cf0b17a3f9f2754d6898ee465ec32d9e08392bcbab0a81a
rename to pkg/formats/rtph265/testdata/fuzz/FuzzDecoderUnmarshal/eb4593a9592045ab0cf0b17a3f9f2754d6898ee465ec32d9e08392bcbab0a81a
diff --git a/pkg/formatdecenc/rtplpcm/decoder.go b/pkg/formats/rtplpcm/decoder.go
similarity index 100%
rename from pkg/formatdecenc/rtplpcm/decoder.go
rename to pkg/formats/rtplpcm/decoder.go
diff --git a/pkg/formatdecenc/rtplpcm/decoder_test.go b/pkg/formats/rtplpcm/decoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtplpcm/decoder_test.go
rename to pkg/formats/rtplpcm/decoder_test.go
diff --git a/pkg/formatdecenc/rtplpcm/encoder.go b/pkg/formats/rtplpcm/encoder.go
similarity index 100%
rename from pkg/formatdecenc/rtplpcm/encoder.go
rename to pkg/formats/rtplpcm/encoder.go
diff --git a/pkg/formatdecenc/rtplpcm/encoder_test.go b/pkg/formats/rtplpcm/encoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtplpcm/encoder_test.go
rename to pkg/formats/rtplpcm/encoder_test.go
diff --git a/pkg/formatdecenc/rtplpcm/rtplpcm.go b/pkg/formats/rtplpcm/rtplpcm.go
similarity index 100%
rename from pkg/formatdecenc/rtplpcm/rtplpcm.go
rename to pkg/formats/rtplpcm/rtplpcm.go
diff --git a/pkg/formatdecenc/rtplpcm/testdata/fuzz/FuzzDecoderUnmarshal/582528ddfad69eb57775199a43e0f9fd5c94bba343ce7bb6724d4ebafe311ed4 b/pkg/formats/rtplpcm/testdata/fuzz/FuzzDecoderUnmarshal/582528ddfad69eb57775199a43e0f9fd5c94bba343ce7bb6724d4ebafe311ed4
similarity index 100%
rename from pkg/formatdecenc/rtplpcm/testdata/fuzz/FuzzDecoderUnmarshal/582528ddfad69eb57775199a43e0f9fd5c94bba343ce7bb6724d4ebafe311ed4
rename to pkg/formats/rtplpcm/testdata/fuzz/FuzzDecoderUnmarshal/582528ddfad69eb57775199a43e0f9fd5c94bba343ce7bb6724d4ebafe311ed4
diff --git a/pkg/formatdecenc/rtpmjpeg/decoder.go b/pkg/formats/rtpmjpeg/decoder.go
similarity index 98%
rename from pkg/formatdecenc/rtpmjpeg/decoder.go
rename to pkg/formats/rtpmjpeg/decoder.go
index 1ab57438..1876ee66 100644
--- a/pkg/formatdecenc/rtpmjpeg/decoder.go
+++ b/pkg/formats/rtpmjpeg/decoder.go
@@ -8,7 +8,7 @@ import (
 	"github.com/pion/rtp"
 
 	"github.com/bluenviron/gortsplib/v3/pkg/codecs/jpeg"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpmjpeg/headers"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpmjpeg/headers"
 	"github.com/bluenviron/gortsplib/v3/pkg/rtptime"
 )
 
diff --git a/pkg/formatdecenc/rtpmjpeg/decoder_test.go b/pkg/formats/rtpmjpeg/decoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/decoder_test.go
rename to pkg/formats/rtpmjpeg/decoder_test.go
diff --git a/pkg/formatdecenc/rtpmjpeg/encoder.go b/pkg/formats/rtpmjpeg/encoder.go
similarity index 98%
rename from pkg/formatdecenc/rtpmjpeg/encoder.go
rename to pkg/formats/rtpmjpeg/encoder.go
index c8bda07c..2c7572d0 100644
--- a/pkg/formatdecenc/rtpmjpeg/encoder.go
+++ b/pkg/formats/rtpmjpeg/encoder.go
@@ -9,7 +9,7 @@ import (
 	"github.com/pion/rtp"
 
 	"github.com/bluenviron/gortsplib/v3/pkg/codecs/jpeg"
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpmjpeg/headers"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpmjpeg/headers"
 	"github.com/bluenviron/gortsplib/v3/pkg/rtptime"
 )
 
diff --git a/pkg/formatdecenc/rtpmjpeg/encoder_test.go b/pkg/formats/rtpmjpeg/encoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/encoder_test.go
rename to pkg/formats/rtpmjpeg/encoder_test.go
diff --git a/pkg/formatdecenc/rtpmjpeg/headers/headers.go b/pkg/formats/rtpmjpeg/headers/headers.go
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/headers/headers.go
rename to pkg/formats/rtpmjpeg/headers/headers.go
diff --git a/pkg/formatdecenc/rtpmjpeg/headers/jpeg.go b/pkg/formats/rtpmjpeg/headers/jpeg.go
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/headers/jpeg.go
rename to pkg/formats/rtpmjpeg/headers/jpeg.go
diff --git a/pkg/formatdecenc/rtpmjpeg/headers/jpeg_test.go b/pkg/formats/rtpmjpeg/headers/jpeg_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/headers/jpeg_test.go
rename to pkg/formats/rtpmjpeg/headers/jpeg_test.go
diff --git a/pkg/formatdecenc/rtpmjpeg/headers/quantization_table.go b/pkg/formats/rtpmjpeg/headers/quantization_table.go
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/headers/quantization_table.go
rename to pkg/formats/rtpmjpeg/headers/quantization_table.go
diff --git a/pkg/formatdecenc/rtpmjpeg/headers/quantization_table_test.go b/pkg/formats/rtpmjpeg/headers/quantization_table_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/headers/quantization_table_test.go
rename to pkg/formats/rtpmjpeg/headers/quantization_table_test.go
diff --git a/pkg/formatdecenc/rtpmjpeg/headers/restart_marker.go b/pkg/formats/rtpmjpeg/headers/restart_marker.go
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/headers/restart_marker.go
rename to pkg/formats/rtpmjpeg/headers/restart_marker.go
diff --git a/pkg/formatdecenc/rtpmjpeg/headers/restart_marker_test.go b/pkg/formats/rtpmjpeg/headers/restart_marker_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/headers/restart_marker_test.go
rename to pkg/formats/rtpmjpeg/headers/restart_marker_test.go
diff --git a/pkg/formatdecenc/rtpmjpeg/rtpmjpeg.go b/pkg/formats/rtpmjpeg/rtpmjpeg.go
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/rtpmjpeg.go
rename to pkg/formats/rtpmjpeg/rtpmjpeg.go
diff --git a/pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099 b/pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099
rename to pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099
diff --git a/pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/76a6865e7bb36d841a943abed143b3403b2d0ffaecdf3298988189c118ee10c1 b/pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/76a6865e7bb36d841a943abed143b3403b2d0ffaecdf3298988189c118ee10c1
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/76a6865e7bb36d841a943abed143b3403b2d0ffaecdf3298988189c118ee10c1
rename to pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/76a6865e7bb36d841a943abed143b3403b2d0ffaecdf3298988189c118ee10c1
diff --git a/pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/bbed53e53be4cad7bab7f568e12dda0590d7c11c0f890b3816ab6eff536ac9fc b/pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/bbed53e53be4cad7bab7f568e12dda0590d7c11c0f890b3816ab6eff536ac9fc
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/bbed53e53be4cad7bab7f568e12dda0590d7c11c0f890b3816ab6eff536ac9fc
rename to pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/bbed53e53be4cad7bab7f568e12dda0590d7c11c0f890b3816ab6eff536ac9fc
diff --git a/pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/be012bfe6e99e126df96e194dc125f8c57860dd62c4244dd7b4e7512cb22a205 b/pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/be012bfe6e99e126df96e194dc125f8c57860dd62c4244dd7b4e7512cb22a205
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/be012bfe6e99e126df96e194dc125f8c57860dd62c4244dd7b4e7512cb22a205
rename to pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/be012bfe6e99e126df96e194dc125f8c57860dd62c4244dd7b4e7512cb22a205
diff --git a/pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/c2ffebd2c319dea9e791ab793c970d84bc212c35134cc2dfb85aa7d862858a49 b/pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/c2ffebd2c319dea9e791ab793c970d84bc212c35134cc2dfb85aa7d862858a49
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/c2ffebd2c319dea9e791ab793c970d84bc212c35134cc2dfb85aa7d862858a49
rename to pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/c2ffebd2c319dea9e791ab793c970d84bc212c35134cc2dfb85aa7d862858a49
diff --git a/pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/fe09b7699690e38a634478835482b418adf4885a063409efe36d0d6120af5eb9 b/pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/fe09b7699690e38a634478835482b418adf4885a063409efe36d0d6120af5eb9
similarity index 100%
rename from pkg/formatdecenc/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/fe09b7699690e38a634478835482b418adf4885a063409efe36d0d6120af5eb9
rename to pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoderUnmarshal/fe09b7699690e38a634478835482b418adf4885a063409efe36d0d6120af5eb9
diff --git a/pkg/formatdecenc/rtpmpeg4audio/decoder.go b/pkg/formats/rtpmpeg4audio/decoder.go
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/decoder.go
rename to pkg/formats/rtpmpeg4audio/decoder.go
diff --git a/pkg/formatdecenc/rtpmpeg4audio/decoder_test.go b/pkg/formats/rtpmpeg4audio/decoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/decoder_test.go
rename to pkg/formats/rtpmpeg4audio/decoder_test.go
diff --git a/pkg/formatdecenc/rtpmpeg4audio/encoder.go b/pkg/formats/rtpmpeg4audio/encoder.go
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/encoder.go
rename to pkg/formats/rtpmpeg4audio/encoder.go
diff --git a/pkg/formatdecenc/rtpmpeg4audio/encoder_test.go b/pkg/formats/rtpmpeg4audio/encoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/encoder_test.go
rename to pkg/formats/rtpmpeg4audio/encoder_test.go
diff --git a/pkg/formatdecenc/rtpmpeg4audio/rtpmpeg4audio.go b/pkg/formats/rtpmpeg4audio/rtpmpeg4audio.go
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/rtpmpeg4audio.go
rename to pkg/formats/rtpmpeg4audio/rtpmpeg4audio.go
diff --git a/pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/17b3f3cab1067ee0ee8464bd3f7890cc1a42ed3f47f13ee83ffdc3ddec1879ef b/pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/17b3f3cab1067ee0ee8464bd3f7890cc1a42ed3f47f13ee83ffdc3ddec1879ef
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/17b3f3cab1067ee0ee8464bd3f7890cc1a42ed3f47f13ee83ffdc3ddec1879ef
rename to pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/17b3f3cab1067ee0ee8464bd3f7890cc1a42ed3f47f13ee83ffdc3ddec1879ef
diff --git a/pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/17f38ee4db10b1296a5bdbd03e35ab29e7e86c1008f89d4437529302df6ecb59 b/pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/17f38ee4db10b1296a5bdbd03e35ab29e7e86c1008f89d4437529302df6ecb59
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/17f38ee4db10b1296a5bdbd03e35ab29e7e86c1008f89d4437529302df6ecb59
rename to pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/17f38ee4db10b1296a5bdbd03e35ab29e7e86c1008f89d4437529302df6ecb59
diff --git a/pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/38d1a2c06720135e2d5accd1afc1f312bc4b6991cd97c1444c86690b4ed6df70 b/pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/38d1a2c06720135e2d5accd1afc1f312bc4b6991cd97c1444c86690b4ed6df70
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/38d1a2c06720135e2d5accd1afc1f312bc4b6991cd97c1444c86690b4ed6df70
rename to pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/38d1a2c06720135e2d5accd1afc1f312bc4b6991cd97c1444c86690b4ed6df70
diff --git a/pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/4c3e593e59c1f853f845a7e3c992d1837f63c5052d805c21db6734a64c3ee1e0 b/pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/4c3e593e59c1f853f845a7e3c992d1837f63c5052d805c21db6734a64c3ee1e0
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/4c3e593e59c1f853f845a7e3c992d1837f63c5052d805c21db6734a64c3ee1e0
rename to pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/4c3e593e59c1f853f845a7e3c992d1837f63c5052d805c21db6734a64c3ee1e0
diff --git a/pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099 b/pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099
rename to pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099
diff --git a/pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/7b9886f07cd0d1b52d80762d475eda9b446e4861160e9a79b294eeb75345ebc5 b/pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/7b9886f07cd0d1b52d80762d475eda9b446e4861160e9a79b294eeb75345ebc5
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/7b9886f07cd0d1b52d80762d475eda9b446e4861160e9a79b294eeb75345ebc5
rename to pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/7b9886f07cd0d1b52d80762d475eda9b446e4861160e9a79b294eeb75345ebc5
diff --git a/pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/82ab2d91fd10f5f409473e000b93d979dcea2547839dece510544e4f2243b80b b/pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/82ab2d91fd10f5f409473e000b93d979dcea2547839dece510544e4f2243b80b
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/82ab2d91fd10f5f409473e000b93d979dcea2547839dece510544e4f2243b80b
rename to pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/82ab2d91fd10f5f409473e000b93d979dcea2547839dece510544e4f2243b80b
diff --git a/pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/a253c894d4f7ea0c24ff61014f52a33011acd37d246b6e81527f5544c00140b6 b/pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/a253c894d4f7ea0c24ff61014f52a33011acd37d246b6e81527f5544c00140b6
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/a253c894d4f7ea0c24ff61014f52a33011acd37d246b6e81527f5544c00140b6
rename to pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/a253c894d4f7ea0c24ff61014f52a33011acd37d246b6e81527f5544c00140b6
diff --git a/pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/a2d4352b624b7e9e5fefbc9881be89bcf82806ed6644dbb3c0914215e484c015 b/pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/a2d4352b624b7e9e5fefbc9881be89bcf82806ed6644dbb3c0914215e484c015
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/a2d4352b624b7e9e5fefbc9881be89bcf82806ed6644dbb3c0914215e484c015
rename to pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/a2d4352b624b7e9e5fefbc9881be89bcf82806ed6644dbb3c0914215e484c015
diff --git a/pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/fc47c4c80ffd62dfd9c7adf40b38f9d9fe0bf9466af436b5c3487f2c4b9b90e4 b/pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/fc47c4c80ffd62dfd9c7adf40b38f9d9fe0bf9466af436b5c3487f2c4b9b90e4
similarity index 100%
rename from pkg/formatdecenc/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/fc47c4c80ffd62dfd9c7adf40b38f9d9fe0bf9466af436b5c3487f2c4b9b90e4
rename to pkg/formats/rtpmpeg4audio/testdata/fuzz/FuzzDecoderUnmarshal/fc47c4c80ffd62dfd9c7adf40b38f9d9fe0bf9466af436b5c3487f2c4b9b90e4
diff --git a/pkg/formatdecenc/rtpsimpleaudio/decoder.go b/pkg/formats/rtpsimpleaudio/decoder.go
similarity index 100%
rename from pkg/formatdecenc/rtpsimpleaudio/decoder.go
rename to pkg/formats/rtpsimpleaudio/decoder.go
diff --git a/pkg/formatdecenc/rtpsimpleaudio/decoder_test.go b/pkg/formats/rtpsimpleaudio/decoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpsimpleaudio/decoder_test.go
rename to pkg/formats/rtpsimpleaudio/decoder_test.go
diff --git a/pkg/formatdecenc/rtpsimpleaudio/encoder.go b/pkg/formats/rtpsimpleaudio/encoder.go
similarity index 100%
rename from pkg/formatdecenc/rtpsimpleaudio/encoder.go
rename to pkg/formats/rtpsimpleaudio/encoder.go
diff --git a/pkg/formatdecenc/rtpsimpleaudio/encoder_test.go b/pkg/formats/rtpsimpleaudio/encoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpsimpleaudio/encoder_test.go
rename to pkg/formats/rtpsimpleaudio/encoder_test.go
diff --git a/pkg/formatdecenc/rtpsimpleaudio/rtpsimpleaudio.go b/pkg/formats/rtpsimpleaudio/rtpsimpleaudio.go
similarity index 100%
rename from pkg/formatdecenc/rtpsimpleaudio/rtpsimpleaudio.go
rename to pkg/formats/rtpsimpleaudio/rtpsimpleaudio.go
diff --git a/pkg/formatdecenc/rtpvp8/decoder.go b/pkg/formats/rtpvp8/decoder.go
similarity index 100%
rename from pkg/formatdecenc/rtpvp8/decoder.go
rename to pkg/formats/rtpvp8/decoder.go
diff --git a/pkg/formatdecenc/rtpvp8/decoder_test.go b/pkg/formats/rtpvp8/decoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpvp8/decoder_test.go
rename to pkg/formats/rtpvp8/decoder_test.go
diff --git a/pkg/formatdecenc/rtpvp8/encoder.go b/pkg/formats/rtpvp8/encoder.go
similarity index 100%
rename from pkg/formatdecenc/rtpvp8/encoder.go
rename to pkg/formats/rtpvp8/encoder.go
diff --git a/pkg/formatdecenc/rtpvp8/encoder_test.go b/pkg/formats/rtpvp8/encoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpvp8/encoder_test.go
rename to pkg/formats/rtpvp8/encoder_test.go
diff --git a/pkg/formatdecenc/rtpvp8/rtpvp8.go b/pkg/formats/rtpvp8/rtpvp8.go
similarity index 100%
rename from pkg/formatdecenc/rtpvp8/rtpvp8.go
rename to pkg/formats/rtpvp8/rtpvp8.go
diff --git a/pkg/formatdecenc/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099 b/pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099
similarity index 100%
rename from pkg/formatdecenc/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099
rename to pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/52b2e47791e6e8c660670149d685c83d5fecefd94c322f710147669ef887e099
diff --git a/pkg/formatdecenc/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/7a1c68afba07c13a12f3686c52a228b2ca8d9794363a61529fcad02658ea03e3 b/pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/7a1c68afba07c13a12f3686c52a228b2ca8d9794363a61529fcad02658ea03e3
similarity index 100%
rename from pkg/formatdecenc/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/7a1c68afba07c13a12f3686c52a228b2ca8d9794363a61529fcad02658ea03e3
rename to pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/7a1c68afba07c13a12f3686c52a228b2ca8d9794363a61529fcad02658ea03e3
diff --git a/pkg/formatdecenc/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/c4c11fb7d7de62a02ee8e7d6962d074d82fa5fdd472096dc3ba35696d1649fa4 b/pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/c4c11fb7d7de62a02ee8e7d6962d074d82fa5fdd472096dc3ba35696d1649fa4
similarity index 100%
rename from pkg/formatdecenc/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/c4c11fb7d7de62a02ee8e7d6962d074d82fa5fdd472096dc3ba35696d1649fa4
rename to pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoderUnmarshal/c4c11fb7d7de62a02ee8e7d6962d074d82fa5fdd472096dc3ba35696d1649fa4
diff --git a/pkg/formatdecenc/rtpvp9/decoder.go b/pkg/formats/rtpvp9/decoder.go
similarity index 100%
rename from pkg/formatdecenc/rtpvp9/decoder.go
rename to pkg/formats/rtpvp9/decoder.go
diff --git a/pkg/formatdecenc/rtpvp9/decoder_test.go b/pkg/formats/rtpvp9/decoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpvp9/decoder_test.go
rename to pkg/formats/rtpvp9/decoder_test.go
diff --git a/pkg/formatdecenc/rtpvp9/encoder.go b/pkg/formats/rtpvp9/encoder.go
similarity index 100%
rename from pkg/formatdecenc/rtpvp9/encoder.go
rename to pkg/formats/rtpvp9/encoder.go
diff --git a/pkg/formatdecenc/rtpvp9/encoder_test.go b/pkg/formats/rtpvp9/encoder_test.go
similarity index 100%
rename from pkg/formatdecenc/rtpvp9/encoder_test.go
rename to pkg/formats/rtpvp9/encoder_test.go
diff --git a/pkg/formatdecenc/rtpvp9/rtpvp9.go b/pkg/formats/rtpvp9/rtpvp9.go
similarity index 100%
rename from pkg/formatdecenc/rtpvp9/rtpvp9.go
rename to pkg/formats/rtpvp9/rtpvp9.go
diff --git a/pkg/formatdecenc/rtpvp9/testdata/fuzz/FuzzDecoderUnmarshal/a562b457d1a04bb296308020307f2e271491c804e84959ad2d5fdaa2e32b6a0f b/pkg/formats/rtpvp9/testdata/fuzz/FuzzDecoderUnmarshal/a562b457d1a04bb296308020307f2e271491c804e84959ad2d5fdaa2e32b6a0f
similarity index 100%
rename from pkg/formatdecenc/rtpvp9/testdata/fuzz/FuzzDecoderUnmarshal/a562b457d1a04bb296308020307f2e271491c804e84959ad2d5fdaa2e32b6a0f
rename to pkg/formats/rtpvp9/testdata/fuzz/FuzzDecoderUnmarshal/a562b457d1a04bb296308020307f2e271491c804e84959ad2d5fdaa2e32b6a0f
diff --git a/pkg/formatdecenc/rtpvp9/testdata/fuzz/FuzzDecoderUnmarshal/ef9d289981397c05db640a6c59c3451a32320b9343d5fefb3e03f72b36377a6c b/pkg/formats/rtpvp9/testdata/fuzz/FuzzDecoderUnmarshal/ef9d289981397c05db640a6c59c3451a32320b9343d5fefb3e03f72b36377a6c
similarity index 100%
rename from pkg/formatdecenc/rtpvp9/testdata/fuzz/FuzzDecoderUnmarshal/ef9d289981397c05db640a6c59c3451a32320b9343d5fefb3e03f72b36377a6c
rename to pkg/formats/rtpvp9/testdata/fuzz/FuzzDecoderUnmarshal/ef9d289981397c05db640a6c59c3451a32320b9343d5fefb3e03f72b36377a6c
diff --git a/pkg/format/vorbis.go b/pkg/formats/vorbis.go
similarity index 99%
rename from pkg/format/vorbis.go
rename to pkg/formats/vorbis.go
index dbca38c8..86bbf056 100644
--- a/pkg/format/vorbis.go
+++ b/pkg/formats/vorbis.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"encoding/base64"
diff --git a/pkg/format/vp8.go b/pkg/formats/vp8.go
similarity index 95%
rename from pkg/format/vp8.go
rename to pkg/formats/vp8.go
index bef25c4a..49e47f64 100644
--- a/pkg/format/vp8.go
+++ b/pkg/formats/vp8.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"fmt"
@@ -6,7 +6,7 @@ import (
 
 	"github.com/pion/rtp"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpvp8"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpvp8"
 )
 
 // VP8 is a format that uses the VP8 codec.
diff --git a/pkg/format/vp9.go b/pkg/formats/vp9.go
similarity index 96%
rename from pkg/format/vp9.go
rename to pkg/formats/vp9.go
index cc72eeb9..cd3fc2f4 100644
--- a/pkg/format/vp9.go
+++ b/pkg/formats/vp9.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"fmt"
@@ -6,7 +6,7 @@ import (
 
 	"github.com/pion/rtp"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/formatdecenc/rtpvp9"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats/rtpvp9"
 )
 
 // VP9 is a format that uses the VP9 codec.
diff --git a/pkg/media/media.go b/pkg/media/media.go
index 135e93d8..f39e078f 100644
--- a/pkg/media/media.go
+++ b/pkg/media/media.go
@@ -10,7 +10,7 @@ import (
 
 	psdp "github.com/pion/sdp/v3"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 )
 
@@ -72,7 +72,7 @@ type Media struct {
 	Control string
 
 	// Formats contained into the media.
-	Formats []format.Format
+	Formats []formats.Format
 }
 
 func (m *Media) unmarshal(md *psdp.MediaDescription) error {
@@ -82,7 +82,7 @@ func (m *Media) unmarshal(md *psdp.MediaDescription) error {
 
 	m.Formats = nil
 	for _, payloadType := range md.MediaName.Formats {
-		format, err := format.Unmarshal(md, payloadType)
+		format, err := formats.Unmarshal(md, payloadType)
 		if err != nil {
 			return err
 		}
diff --git a/server_session.go b/server_session.go
index 52921a6b..284135a7 100644
--- a/server_session.go
+++ b/server_session.go
@@ -12,7 +12,7 @@ import (
 	"github.com/pion/rtp"
 
 	"github.com/bluenviron/gortsplib/v3/pkg/base"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/headers"
 	"github.com/bluenviron/gortsplib/v3/pkg/liberrors"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
@@ -1092,7 +1092,7 @@ func (ss *ServerSession) handleRequest(sc *ServerConn, req *base.Request) (*base
 }
 
 // OnPacketRTPAny sets the callback that is called when a RTP packet is read from any setupped media.
-func (ss *ServerSession) OnPacketRTPAny(cb func(*media.Media, format.Format, *rtp.Packet)) {
+func (ss *ServerSession) OnPacketRTPAny(cb func(*media.Media, formats.Format, *rtp.Packet)) {
 	for _, sm := range ss.setuppedMedias {
 		cmedia := sm.media
 		for _, forma := range sm.media.Formats {
@@ -1114,7 +1114,7 @@ func (ss *ServerSession) OnPacketRTCPAny(cb func(*media.Media, rtcp.Packet)) {
 }
 
 // OnPacketRTP sets the callback that is called when a RTP packet is read.
-func (ss *ServerSession) OnPacketRTP(medi *media.Media, forma format.Format, cb func(*rtp.Packet)) {
+func (ss *ServerSession) OnPacketRTP(medi *media.Media, forma formats.Format, cb func(*rtp.Packet)) {
 	sm := ss.setuppedMedias[medi]
 	st := sm.formats[forma.PayloadType()]
 	st.onPacketRTP = cb
diff --git a/server_session_format.go b/server_session_format.go
index b51cc793..f32f5c67 100644
--- a/server_session_format.go
+++ b/server_session_format.go
@@ -7,20 +7,20 @@ import (
 	"github.com/pion/rtcp"
 	"github.com/pion/rtp"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/rtcpreceiver"
 	"github.com/bluenviron/gortsplib/v3/pkg/rtpreorderer"
 )
 
 type serverSessionFormat struct {
 	sm              *serverSessionMedia
-	format          format.Format
+	format          formats.Format
 	udpReorderer    *rtpreorderer.Reorderer
 	udpRTCPReceiver *rtcpreceiver.RTCPReceiver
 	onPacketRTP     func(*rtp.Packet)
 }
 
-func newServerSessionFormat(sm *serverSessionMedia, forma format.Format) *serverSessionFormat {
+func newServerSessionFormat(sm *serverSessionMedia, forma formats.Format) *serverSessionFormat {
 	return &serverSessionFormat{
 		sm:          sm,
 		format:      forma,
diff --git a/server_stream_format.go b/server_stream_format.go
index d466eec0..92860810 100644
--- a/server_stream_format.go
+++ b/server_stream_format.go
@@ -1,11 +1,11 @@
 package gortsplib
 
 import (
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/rtcpsender"
 )
 
 type serverStreamFormat struct {
-	format     format.Format
+	format     formats.Format
 	rtcpSender *rtcpsender.RTCPSender
 }


Test patch:
diff --git a/client_play_test.go b/client_play_test.go
index 30077cc6..d6ee9b86 100644
--- a/client_play_test.go
+++ b/client_play_test.go
@@ -20,7 +20,7 @@ import (
 	"github.com/bluenviron/gortsplib/v3/pkg/base"
 	"github.com/bluenviron/gortsplib/v3/pkg/codecs/mpeg4audio"
 	"github.com/bluenviron/gortsplib/v3/pkg/conn"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/headers"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
@@ -35,7 +35,7 @@ func mustMarshalMedias(medias media.Medias) []byte {
 	return byts
 }
 
-func readAll(c *Client, ur string, cb func(*media.Media, format.Format, *rtp.Packet)) error {
+func readAll(c *Client, ur string, cb func(*media.Media, formats.Format, *rtp.Packet)) error {
 	u, err := url.Parse(ur)
 	if err != nil {
 		return err
@@ -76,7 +76,7 @@ func TestClientPlayFormats(t *testing.T) {
 
 	media2 := &media.Media{
 		Type: media.TypeAudio,
-		Formats: []format.Format{&format.MPEG4Audio{
+		Formats: []formats.Format{&formats.MPEG4Audio{
 			PayloadTyp: 96,
 			Config: &mpeg4audio.Config{
 				Type:         mpeg4audio.ObjectTypeAACLC,
@@ -91,7 +91,7 @@ func TestClientPlayFormats(t *testing.T) {
 
 	media3 := &media.Media{
 		Type: media.TypeAudio,
-		Formats: []format.Format{&format.MPEG4Audio{
+		Formats: []formats.Format{&formats.MPEG4Audio{
 			PayloadTyp: 96,
 			Config: &mpeg4audio.Config{
 				Type:         mpeg4audio.ObjectTypeAACLC,
@@ -268,7 +268,7 @@ func TestClientPlay(t *testing.T) {
 				require.Equal(t, base.Describe, req.Method)
 				require.Equal(t, mustParseURL(scheme+"://"+listenIP+":8554/test/stream?param=value"), req.URL)
 
-				forma := &format.Generic{
+				forma := &formats.Generic{
 					PayloadTyp: 96,
 					RTPMap:     "private/90000",
 				}
@@ -278,11 +278,11 @@ func TestClientPlay(t *testing.T) {
 				medias := media.Medias{
 					&media.Media{
 						Type:    "application",
-						Formats: []format.Format{forma},
+						Formats: []formats.Format{forma},
 					},
 					&media.Media{
 						Type:    "application",
-						Formats: []format.Format{forma},
+						Formats: []formats.Format{forma},
 					},
 				}
 				medias.SetControls()
@@ -491,7 +491,7 @@ func TestClientPlay(t *testing.T) {
 			err = c.SetupAll(medias, baseURL)
 			require.NoError(t, err)
 
-			c.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+			c.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 				require.Equal(t, &testRTPPacket, pkt)
 				err := c.WritePacketRTCP(medi, &testRTCPPacket)
 				require.NoError(t, err)
@@ -542,7 +542,7 @@ func TestClientPlayPartial(t *testing.T) {
 		require.Equal(t, base.Describe, req.Method)
 		require.Equal(t, mustParseURL("rtsp://"+listenIP+":8554/teststream"), req.URL)
 
-		forma := &format.Generic{
+		forma := &formats.Generic{
 			PayloadTyp: 96,
 			RTPMap:     "private/90000",
 		}
@@ -552,11 +552,11 @@ func TestClientPlayPartial(t *testing.T) {
 		medias := media.Medias{
 			&media.Media{
 				Type:    "application",
-				Formats: []format.Format{forma},
+				Formats: []formats.Format{forma},
 			},
 			&media.Media{
 				Type:    "application",
-				Formats: []format.Format{forma},
+				Formats: []formats.Format{forma},
 			},
 		}
 		medias.SetControls()
@@ -647,7 +647,7 @@ func TestClientPlayPartial(t *testing.T) {
 	_, err = c.Setup(medias[1], baseURL, 0, 0)
 	require.NoError(t, err)
 
-	c.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+	c.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 		require.Equal(t, medias[1], medi)
 		require.Equal(t, medias[1].Formats[0], forma)
 		require.Equal(t, &testRTPPacket, pkt)
@@ -931,7 +931,7 @@ func TestClientPlayAnyPort(t *testing.T) {
 
 			var med *media.Media
 			err = readAll(&c, "rtsp://localhost:8554/teststream",
-				func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+				func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 					require.Equal(t, &testRTPPacket, pkt)
 					med = medi
 					close(packetRecv)
@@ -1055,7 +1055,7 @@ func TestClientPlayAutomaticProtocol(t *testing.T) {
 			},
 		}
 		err = readAll(&c, "rtsp://localhost:8554/teststream",
-			func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+			func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 				close(packetRecv)
 			})
 		require.NoError(t, err)
@@ -1231,7 +1231,7 @@ func TestClientPlayAutomaticProtocol(t *testing.T) {
 			},
 		}
 		err = readAll(&c, "rtsp://localhost:8554/teststream",
-			func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+			func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 				close(packetRecv)
 			})
 		require.NoError(t, err)
@@ -1467,7 +1467,7 @@ func TestClientPlayAutomaticProtocol(t *testing.T) {
 		}
 
 		err = readAll(&c, "rtsp://myuser:mypass@localhost:8554/teststream",
-			func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+			func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 				close(packetRecv)
 			})
 		require.NoError(t, err)
@@ -1589,7 +1589,7 @@ func TestClientPlayDifferentInterleavedIDs(t *testing.T) {
 	}
 
 	err = readAll(&c, "rtsp://localhost:8554/teststream",
-		func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+		func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 			close(packetRecv)
 		})
 	require.NoError(t, err)
@@ -1776,7 +1776,7 @@ func TestClientPlayRedirect(t *testing.T) {
 				ru = "rtsp://testusr:testpwd@localhost:8554/path1"
 			}
 			err = readAll(&c, ru,
-				func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+				func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 					close(packetRecv)
 				})
 			require.NoError(t, err)
@@ -1976,7 +1976,7 @@ func TestClientPlayPause(t *testing.T) {
 			}
 
 			err = readAll(&c, "rtsp://localhost:8554/teststream",
-				func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+				func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 					if atomic.SwapInt32(&firstFrame, 1) == 0 {
 						close(packetRecv)
 					}
@@ -2440,7 +2440,7 @@ func TestClientPlayIgnoreTCPInvalidMedia(t *testing.T) {
 	}
 
 	err = readAll(&c, "rtsp://localhost:8554/teststream",
-		func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+		func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 			close(recv)
 		})
 	require.NoError(t, err)
@@ -2858,7 +2858,7 @@ func TestClientPlayDifferentSource(t *testing.T) {
 	}
 
 	err = readAll(&c, "rtsp://localhost:8554/test/stream?param=value",
-		func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+		func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 			require.Equal(t, &testRTPPacket, pkt)
 			close(packetRecv)
 		})
@@ -2920,7 +2920,7 @@ func TestClientPlayDecodeErrors(t *testing.T) {
 
 				medias := media.Medias{&media.Media{
 					Type: media.TypeApplication,
-					Formats: []format.Format{&format.Generic{
+					Formats: []formats.Format{&formats.Generic{
 						PayloadTyp: 97,
 						RTPMap:     "private/90000",
 					}},
diff --git a/client_record_test.go b/client_record_test.go
index 0fe1a89c..56f7d444 100644
--- a/client_record_test.go
+++ b/client_record_test.go
@@ -15,7 +15,7 @@ import (
 
 	"github.com/bluenviron/gortsplib/v3/pkg/base"
 	"github.com/bluenviron/gortsplib/v3/pkg/conn"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/headers"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/bluenviron/gortsplib/v3/pkg/sdp"
@@ -24,7 +24,7 @@ import (
 
 var testH264Media = &media.Media{
 	Type: media.TypeVideo,
-	Formats: []format.Format{&format.H264{
+	Formats: []formats.Format{&formats.H264{
 		PayloadTyp:        96,
 		SPS:               []byte{0x01, 0x02, 0x03, 0x04},
 		PPS:               []byte{0x01, 0x02, 0x03, 0x04},
diff --git a/internal/highleveltests/server_test.go b/internal/highleveltests/server_test.go
index 924ef49c..59d8573c 100644
--- a/internal/highleveltests/server_test.go
+++ b/internal/highleveltests/server_test.go
@@ -19,7 +19,7 @@ import (
 
 	"github.com/bluenviron/gortsplib/v3"
 	"github.com/bluenviron/gortsplib/v3/pkg/base"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 )
 
@@ -385,7 +385,7 @@ func TestServerRecordRead(t *testing.T) {
 							}, fmt.Errorf("invalid query (%s)", ctx.Query)
 						}
 
-						ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) {
+						ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) {
 							stream.WritePacketRTP(medi, pkt)
 						})
 
diff --git a/pkg/format/format_test.go b/pkg/formats/format_test.go
similarity index 99%
rename from pkg/format/format_test.go
rename to pkg/formats/format_test.go
index d836d9d1..359c60d9 100644
--- a/pkg/format/format_test.go
+++ b/pkg/formats/format_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/g711_test.go b/pkg/formats/g711_test.go
similarity index 98%
rename from pkg/format/g711_test.go
rename to pkg/formats/g711_test.go
index 136c1e5f..fa07c9e1 100644
--- a/pkg/format/g711_test.go
+++ b/pkg/formats/g711_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/g722_test.go b/pkg/formats/g722_test.go
similarity index 98%
rename from pkg/format/g722_test.go
rename to pkg/formats/g722_test.go
index 7e902a99..18b7b635 100644
--- a/pkg/format/g722_test.go
+++ b/pkg/formats/g722_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/generic_test.go b/pkg/formats/generic_test.go
similarity index 98%
rename from pkg/format/generic_test.go
rename to pkg/formats/generic_test.go
index 06a2cef5..07d0aeb9 100644
--- a/pkg/format/generic_test.go
+++ b/pkg/formats/generic_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/h264_test.go b/pkg/formats/h264_test.go
similarity index 99%
rename from pkg/format/h264_test.go
rename to pkg/formats/h264_test.go
index c225e9ef..46be4d51 100644
--- a/pkg/format/h264_test.go
+++ b/pkg/formats/h264_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/h265_test.go b/pkg/formats/h265_test.go
similarity index 99%
rename from pkg/format/h265_test.go
rename to pkg/formats/h265_test.go
index a4e77eae..02b4d8eb 100644
--- a/pkg/format/h265_test.go
+++ b/pkg/formats/h265_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/lpcm_test.go b/pkg/formats/lpcm_test.go
similarity index 98%
rename from pkg/format/lpcm_test.go
rename to pkg/formats/lpcm_test.go
index 2734ee63..dc31a636 100644
--- a/pkg/format/lpcm_test.go
+++ b/pkg/formats/lpcm_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"fmt"
diff --git a/pkg/format/mjpeg_test.go b/pkg/formats/mjpeg_test.go
similarity index 99%
rename from pkg/format/mjpeg_test.go
rename to pkg/formats/mjpeg_test.go
index b398af49..b0242f93 100644
--- a/pkg/format/mjpeg_test.go
+++ b/pkg/formats/mjpeg_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/mpeg2_audio_test.go b/pkg/formats/mpeg2_audio_test.go
similarity index 97%
rename from pkg/format/mpeg2_audio_test.go
rename to pkg/formats/mpeg2_audio_test.go
index fef3f808..cc6bccb5 100644
--- a/pkg/format/mpeg2_audio_test.go
+++ b/pkg/formats/mpeg2_audio_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/mpeg2_video_test.go b/pkg/formats/mpeg2_video_test.go
similarity index 97%
rename from pkg/format/mpeg2_video_test.go
rename to pkg/formats/mpeg2_video_test.go
index 9bba89da..3fa83833 100644
--- a/pkg/format/mpeg2_video_test.go
+++ b/pkg/formats/mpeg2_video_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/mpeg4_audio_test.go b/pkg/formats/mpeg4_audio_test.go
similarity index 99%
rename from pkg/format/mpeg4_audio_test.go
rename to pkg/formats/mpeg4_audio_test.go
index b935a279..68296e46 100644
--- a/pkg/format/mpeg4_audio_test.go
+++ b/pkg/formats/mpeg4_audio_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/opus_test.go b/pkg/formats/opus_test.go
similarity index 98%
rename from pkg/format/opus_test.go
rename to pkg/formats/opus_test.go
index 549a0461..556ed63e 100644
--- a/pkg/format/opus_test.go
+++ b/pkg/formats/opus_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/vorbis_test.go b/pkg/formats/vorbis_test.go
similarity index 98%
rename from pkg/format/vorbis_test.go
rename to pkg/formats/vorbis_test.go
index cdc16441..ed08aec0 100644
--- a/pkg/format/vorbis_test.go
+++ b/pkg/formats/vorbis_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/vp8_test.go b/pkg/formats/vp8_test.go
similarity index 98%
rename from pkg/format/vp8_test.go
rename to pkg/formats/vp8_test.go
index fb4fcd7e..ade49020 100644
--- a/pkg/format/vp8_test.go
+++ b/pkg/formats/vp8_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/format/vp9_test.go b/pkg/formats/vp9_test.go
similarity index 98%
rename from pkg/format/vp9_test.go
rename to pkg/formats/vp9_test.go
index 1e4d9e30..0b80bc90 100644
--- a/pkg/format/vp9_test.go
+++ b/pkg/formats/vp9_test.go
@@ -1,4 +1,4 @@
-package format
+package formats
 
 import (
 	"testing"
diff --git a/pkg/media/media_test.go b/pkg/media/media_test.go
index 50bd1d51..fea46a53 100644
--- a/pkg/media/media_test.go
+++ b/pkg/media/media_test.go
@@ -5,7 +5,7 @@ import (
 
 	"github.com/stretchr/testify/require"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/sdp"
 	"github.com/bluenviron/gortsplib/v3/pkg/url"
 )
@@ -147,7 +147,7 @@ func TestMediaURL(t *testing.T) {
 func TestMediaURLError(t *testing.T) {
 	media := &Media{
 		Type:    "video",
-		Formats: []format.Format{&format.H264{}},
+		Formats: []formats.Format{&formats.H264{}},
 	}
 	_, err := media.URL(nil)
 	require.EqualError(t, err, "Content-Base header not provided")
diff --git a/pkg/media/medias_test.go b/pkg/media/medias_test.go
index 6374f1b0..f5f421e0 100644
--- a/pkg/media/medias_test.go
+++ b/pkg/media/medias_test.go
@@ -5,7 +5,7 @@ import (
 
 	"github.com/stretchr/testify/require"
 
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/sdp"
 )
 
@@ -60,7 +60,7 @@ var casesMedias = []struct {
 			{
 				Type:    "video",
 				Control: "rtsp://10.0.100.50/profile5/media.smp/trackID=v",
-				Formats: []format.Format{&format.H264{
+				Formats: []formats.Format{&formats.H264{
 					PayloadTyp:        97,
 					PacketizationMode: 1,
 					SPS:               []byte{0x67, 0x64, 0x00, 0x28, 0xac, 0xb4, 0x03, 0xc0, 0x11, 0x3f, 0x2a},
@@ -71,13 +71,13 @@ var casesMedias = []struct {
 				Type:      "audio",
 				Direction: DirectionRecvonly,
 				Control:   "rtsp://10.0.100.50/profile5/media.smp/trackID=a",
-				Formats: []format.Format{&format.G711{
+				Formats: []formats.Format{&formats.G711{
 					MULaw: true,
 				}},
 			},
 			{
 				Type: "application",
-				Formats: []format.Format{&format.Generic{
+				Formats: []formats.Format{&formats.Generic{
 					PayloadTyp: 107,
 				}},
 			},
@@ -127,7 +127,7 @@ var casesMedias = []struct {
 			{
 				Type:    "video",
 				Control: "trackID=1",
-				Formats: []format.Format{&format.H264{
+				Formats: []formats.Format{&formats.H264{
 					PayloadTyp:        97,
 					PacketizationMode: 1,
 					SPS:               []byte{0x67, 0x64, 0x00, 0x28, 0xac, 0xb4, 0x03, 0xc0, 0x11, 0x3f, 0x2a},
@@ -138,13 +138,13 @@ var casesMedias = []struct {
 				Type:      "audio",
 				Direction: DirectionRecvonly,
 				Control:   "trackID=2",
-				Formats: []format.Format{&format.G711{
+				Formats: []formats.Format{&formats.G711{
 					MULaw: true,
 				}},
 			},
 			{
 				Type: "application",
-				Formats: []format.Format{&format.Generic{
+				Formats: []formats.Format{&formats.Generic{
 					PayloadTyp: 107,
 				}},
 			},
@@ -295,64 +295,64 @@ var casesMedias = []struct {
 			{
 				Type:      "audio",
 				Direction: DirectionSendonly,
-				Formats: []format.Format{
-					&format.Opus{
+				Formats: []formats.Format{
+					&formats.Opus{
 						PayloadTyp: 111,
 						IsStereo:   false,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 103,
 						RTPMap:     "ISAC/16000",
 						ClockRat:   16000,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 104,
 						RTPMap:     "ISAC/32000",
 						ClockRat:   32000,
 					},
-					&format.G722{},
-					&format.Generic{
+					&formats.G722{},
+					&formats.Generic{
 						PayloadTyp: 102,
 						RTPMap:     "ILBC/8000",
 						ClockRat:   8000,
 					},
-					&format.G711{
+					&formats.G711{
 						MULaw: true,
 					},
-					&format.G711{
+					&formats.G711{
 						MULaw: false,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 106,
 						RTPMap:     "CN/32000",
 						ClockRat:   32000,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 105,
 						RTPMap:     "CN/16000",
 						ClockRat:   16000,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 13,
 						RTPMap:     "CN/8000",
 						ClockRat:   8000,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 110,
 						RTPMap:     "telephone-event/48000",
 						ClockRat:   48000,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 112,
 						RTPMap:     "telephone-event/32000",
 						ClockRat:   32000,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 113,
 						RTPMap:     "telephone-event/16000",
 						ClockRat:   16000,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 126,
 						RTPMap:     "telephone-event/8000",
 						ClockRat:   8000,
@@ -362,11 +362,11 @@ var casesMedias = []struct {
 			{
 				Type:      "video",
 				Direction: DirectionSendonly,
-				Formats: []format.Format{
-					&format.VP8{
+				Formats: []formats.Format{
+					&formats.VP8{
 						PayloadTyp: 96,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 97,
 						RTPMap:     "rtx/90000",
 						FMTP: map[string]string{
@@ -374,10 +374,10 @@ var casesMedias = []struct {
 						},
 						ClockRat: 90000,
 					},
-					&format.VP9{
+					&formats.VP9{
 						PayloadTyp: 98,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 99,
 						RTPMap:     "rtx/90000",
 						FMTP: map[string]string{
@@ -385,11 +385,11 @@ var casesMedias = []struct {
 						},
 						ClockRat: 90000,
 					},
-					&format.H264{
+					&formats.H264{
 						PayloadTyp:        100,
 						PacketizationMode: 1,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 101,
 						RTPMap:     "rtx/90000",
 						FMTP: map[string]string{
@@ -397,12 +397,12 @@ var casesMedias = []struct {
 						},
 						ClockRat: 90000,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 127,
 						RTPMap:     "red/90000",
 						ClockRat:   90000,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 124,
 						RTPMap:     "rtx/90000",
 						FMTP: map[string]string{
@@ -410,7 +410,7 @@ var casesMedias = []struct {
 						},
 						ClockRat: 90000,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 125,
 						RTPMap:     "ulpfec/90000",
 						ClockRat:   90000,
@@ -445,8 +445,8 @@ var casesMedias = []struct {
 		Medias{
 			{
 				Type: "video",
-				Formats: []format.Format{
-					&format.H264{
+				Formats: []formats.Format{
+					&formats.H264{
 						PayloadTyp: 96,
 						SPS: []byte{
 							0x67, 0x4d, 0x00, 0x2a, 0x9d, 0xa8, 0x1e, 0x00,
@@ -455,7 +455,7 @@ var casesMedias = []struct {
 						PPS:               []byte{0x68, 0xee, 0x3c, 0x80},
 						PacketizationMode: 1,
 					},
-					&format.Generic{
+					&formats.Generic{
 						PayloadTyp: 98,
 						RTPMap:     "MetaData",
 					},
@@ -500,19 +500,19 @@ var casesMedias = []struct {
 				Type:      "video",
 				Direction: DirectionRecvonly,
 				Control:   "rtsp://192.168.0.1/video",
-				Formats:   []format.Format{&format.MJPEG{}},
+				Formats:   []formats.Format{&formats.MJPEG{}},
 			},
 			{
 				Type:      "audio",
 				Direction: DirectionRecvonly,
 				Control:   "rtsp://192.168.0.1/audio",
-				Formats:   []format.Format{&format.G711{MULaw: true}},
+				Formats:   []formats.Format{&formats.G711{MULaw: true}},
 			},
 			{
 				Type:      "audio",
 				Direction: DirectionSendonly,
 				Control:   "rtsp://192.168.0.1/audioback",
-				Formats:   []format.Format{&format.G711{MULaw: true}},
+				Formats:   []formats.Format{&formats.G711{MULaw: true}},
 			},
 		},
 	},
@@ -579,7 +579,7 @@ func TestMediasMarshal(t *testing.T) {
 }
 
 func TestMediasFindFormat(t *testing.T) {
-	tr := &format.Generic{
+	tr := &formats.Generic{
 		PayloadTyp: 97,
 		RTPMap:     "rtx/90000",
 		FMTP: map[string]string{
@@ -590,12 +590,12 @@ func TestMediasFindFormat(t *testing.T) {
 
 	md := &Media{
 		Type: TypeVideo,
-		Formats: []format.Format{
-			&format.VP8{
+		Formats: []formats.Format{
+			&formats.VP8{
 				PayloadTyp: 96,
 			},
 			tr,
-			&format.VP9{
+			&formats.VP9{
 				PayloadTyp: 98,
 			},
 		},
@@ -604,8 +604,8 @@ func TestMediasFindFormat(t *testing.T) {
 	ms := Medias{
 		{
 			Type: TypeAudio,
-			Formats: []format.Format{
-				&format.Opus{
+			Formats: []formats.Format{
+				&formats.Opus{
 					PayloadTyp: 111,
 					IsStereo:   true,
 				},
@@ -614,7 +614,7 @@ func TestMediasFindFormat(t *testing.T) {
 		md,
 	}
 
-	var forma *format.Generic
+	var forma *formats.Generic
 	me := ms.FindFormat(&forma)
 	require.Equal(t, md, me)
 	require.Equal(t, tr, forma)
diff --git a/server_play_test.go b/server_play_test.go
index 04adca09..f9f600ba 100644
--- a/server_play_test.go
+++ b/server_play_test.go
@@ -19,7 +19,7 @@ import (
 
 	"github.com/bluenviron/gortsplib/v3/pkg/base"
 	"github.com/bluenviron/gortsplib/v3/pkg/conn"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/headers"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/bluenviron/gortsplib/v3/pkg/sdp"
@@ -2130,7 +2130,7 @@ func TestServerPlayAdditionalInfos(t *testing.T) {
 		return &ri, ssrcs
 	}
 
-	forma := &format.Generic{
+	forma := &formats.Generic{
 		PayloadTyp: 96,
 		RTPMap:     "private/90000",
 	}
@@ -2140,11 +2140,11 @@ func TestServerPlayAdditionalInfos(t *testing.T) {
 	stream := NewServerStream(media.Medias{
 		&media.Media{
 			Type:    "application",
-			Formats: []format.Format{forma},
+			Formats: []formats.Format{forma},
 		},
 		&media.Media{
 			Type:    "application",
-			Formats: []format.Format{forma},
+			Formats: []formats.Format{forma},
 		},
 	})
 	defer stream.Close()
diff --git a/server_record_test.go b/server_record_test.go
index 117a01d0..07a90816 100644
--- a/server_record_test.go
+++ b/server_record_test.go
@@ -15,7 +15,7 @@ import (
 
 	"github.com/bluenviron/gortsplib/v3/pkg/base"
 	"github.com/bluenviron/gortsplib/v3/pkg/conn"
-	"github.com/bluenviron/gortsplib/v3/pkg/format"
+	"github.com/bluenviron/gortsplib/v3/pkg/formats"
 	"github.com/bluenviron/gortsplib/v3/pkg/headers"
 	"github.com/bluenviron/gortsplib/v3/pkg/media"
 	"github.com/bluenviron/gortsplib/v3/pkg/sdp"
@@ -440,7 +440,7 @@ func TestServerRecordErrorRecordPartialMedias(t *testing.T) {
 	defer nconn.Close()
 	conn := conn.NewConn(nconn)
 
-	forma := &format.Generic{
+	forma := &formats.Generic{
 		PayloadTyp: 96,
 		RTPMap:     "private/90000",
 	}
@@ -450,11 +450,11 @@ func TestServerRecordErrorRecordPartialMedias(t *testing.T) {
 	medias := media.Medias{
 		&media.Media{
 			Type:    "application",
-			Formats: []format.Format{forma},
+			Formats: []formats.Format{forma},
 		},
 		&media.Media{
 			Type:    "application",
-			Formats: []format.Format{forma},
+			Formats: []formats.Format{forma},
 		},
 	}
 	medias.SetControls()
@@ -613,7 +613,7 @@ func TestServerRecord(t *testing.T) {
 			medias := media.Medias{
 				&media.Media{
 					Type: media.TypeVideo,
-					Formats: []format.Format{&format.H264{
+					Formats: []formats.Format{&formats.H264{
 						PayloadTyp:        96,
 						SPS:               []byte{0x01, 0x02, 0x03, 0x04},
 						PPS:               []byte{0x01, 0x02, 0x03, 0x04},
@@ -622,7 +622,7 @@ func TestServerRecord(t *testing.T) {
 				},
 				&media.Media{
 					Type: media.TypeVideo,
-					Formats: []format.Format{&format.H264{
+					Formats: []formats.Format{&formats.H264{
 						PayloadTyp:        96,
 						SPS:               []byte{0x01, 0x02, 0x03, 0x04},
 						PPS:               []byte{0x01, 0x02, 0x03, 0x04},
@@ -1496,7 +1496,7 @@ func TestServerRecordDecodeErrors(t *testing.T) {
 
 			medias := media.Medias{&media.Media{
 				Type: media.TypeApplication,
-				Formats: []format.Format{&format.Generic{
+				Formats: []formats.Format{&formats.Generic{
 					PayloadTyp: 97,
 					RTPMap:     "private/90000",
 				}},