mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
update docs
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
// This example shows how to
|
||||
// 1. connect to a RTSP server and read all tracks on a path
|
||||
// 2. check if there's a H264 track
|
||||
// 3. decode H264 into raw frames
|
||||
// 3. decode H264 into RGBA frames
|
||||
// 4. encode the frames into JPEG images and save them on disk
|
||||
|
||||
// This example requires the ffmpeg libraries, that can be installed in this way:
|
||||
@@ -101,14 +101,14 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
// decode H264 NALUs from the RTP packet
|
||||
// convert RTP packet to H264 NALUs
|
||||
nalus, _, err := rtpDec.Decode(pkt)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, nalu := range nalus {
|
||||
// decode raw frames from H264 NALUs
|
||||
// convert H264 NALUs to RGBA frames
|
||||
img, err := h264dec.decode(nalu)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
@@ -63,7 +63,7 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
// decode H264 NALUs from the RTP packet
|
||||
// convert RTP packet to H264 NALUs
|
||||
nalus, pts, err := rtpDec.DecodeUntilMarker(pkt)
|
||||
if err != nil {
|
||||
return
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
// This example shows how to
|
||||
// 1. connect to a RTSP server and read all tracks on a path
|
||||
// 2. check if there's an H264 track
|
||||
// 3. decode H264 into raw frames
|
||||
// 3. decode H264 into RGBA frames
|
||||
|
||||
// This example requires the ffmpeg libraries, that can be installed in this way:
|
||||
// apt install -y libavformat-dev libswscale-dev gcc pkg-config
|
||||
@@ -77,14 +77,14 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
// decode H264 NALUs from the RTP packet
|
||||
// convert RTP packet to H264 NALUs
|
||||
nalus, _, err := rtpDec.Decode(pkt)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, nalu := range nalus {
|
||||
// decode raw frames from H264 NALUs
|
||||
// convert H264 NALUs to RGBA frames
|
||||
img, err := h264dec.decode(nalu)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
Reference in New Issue
Block a user