rtph264: fully rewrite, decode NALU timestamp, add Process(), add tests

This commit is contained in:
aler9
2021-03-07 16:04:44 +01:00
parent f192b198d7
commit 54a4859473
8 changed files with 323 additions and 160 deletions

View File

@@ -28,9 +28,9 @@ func main() {
"gst-launch-1.0 filesrc location=video.mp4 ! qtdemux ! video/x-h264" +
" ! h264parse config-interval=1 ! rtph264pay ! udpsink host=127.0.0.1 port=9000")
// wait for RTP/H264 frames
decoder := rtph264.NewDecoderFromPacketConn(pc)
sps, pps, err := decoder.ReadSPSPPS()
// get SPS and PPS
decoder := rtph264.NewDecoder()
sps, pps, err := decoder.ReadSPSPPS(rtph264.PacketConnReader{pc})
if err != nil {
panic(err)
}