mirror of
				https://github.com/aler9/rtsp-simple-server
				synced 2025-10-31 02:56:29 +08:00 
			
		
		
		
	Decode streams once and only when needed (#1218)
* split data into specialized structs * move MPEG4-audio decoding into streamTrack * restore video/audio synchronization in HLS muxer and RTMP server * log decode errors * move H264 decoding and re-encoding here from gortsplib * add tests * update gortsplib
This commit is contained in:
		| @@ -59,12 +59,15 @@ func (s *rpiCameraSource) run(ctx context.Context) error { | ||||
| 			stream = res.stream | ||||
| 		} | ||||
|  | ||||
| 		stream.writeData(&data{ | ||||
| 		err := stream.writeData(&dataH264{ | ||||
| 			trackID:      0, | ||||
| 			ptsEqualsDTS: h264.IDRPresent(nalus), | ||||
| 			pts:          dts, | ||||
| 			h264NALUs:    nalus, | ||||
| 			nalus:        nalus, | ||||
| 		}) | ||||
| 		if err != nil { | ||||
| 			s.Log(logger.Warn, "%v", err) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	cam, err := rpicamera.New(s.params, onData) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Alessandro Ros
					Alessandro Ros