Skip to content

Commit a5e4f1c

Browse files
Steveactions-user
authored andcommitted
docs: Add summary of Jetson HLS fix
Adds a markdown file (`JETSON_HLS_FIX_SUMMARY.md`) documenting the technical details of the HLS recording fix implemented for Jetson Nano systems. The document explains: - The problem encountered with HLS recording on Jetson Nano using GStreamer 1.23.0. - The root cause related to GStreamer segment events, race conditions, and hardware differences. - The implemented solution steps (explicit mux control, segment event injection, delayed element start). - Testing steps and expected results. - Key code changes and architecture notes related to the fix. [auto-enhanced]
1 parent 95bb9b2 commit a5e4f1c

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

JETSON_HLS_FIX_SUMMARY.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Jetson Nano HLS Recording Fix Summary
2+
3+
## Problem
4+
On Jetson Nano 2GB running GStreamer 1.23.0 (development version), HLS recording was showing "Got data flow before segment event" warnings from mpegtsmux. This didn't occur on x86/WSL systems.
5+
6+
## Root Cause
7+
1. **GStreamer 1.23.0** has stricter segment event checking
8+
2. **Jetson Nano 2GB** slower processing exposes race conditions
9+
3. Dynamic pad linking from webrtcbin causes segment events to arrive after data
10+
11+
## Solution Implemented
12+
13+
### 1. Explicit mpegtsmux Control
14+
- Create our own mpegtsmux element (except for splitmuxsink which manages its own)
15+
- Configure with proper HLS alignment settings
16+
- Direct control over element state transitions
17+
18+
### 2. Segment Event Injection
19+
- Add pad probes on video/audio queues before mux
20+
- Inject segment events before first buffer reaches mux
21+
- Ensures proper event ordering
22+
23+
### 3. Delayed Element Start
24+
- 100ms delay after pad connections before starting mux/sink
25+
- Allows segment events to propagate on slower systems
26+
- Prevents race condition
27+
28+
### 4. Dual Mode Support
29+
- **splitmuxsink**: Uses internal mux, connects directly
30+
- **manual mode**: Uses explicit mux for future m3u8 support
31+
32+
## Testing
33+
Run on Jetson Nano:
34+
```bash
35+
python3 publish.py --record-room --hls --room TestRoom --webserver 8087
36+
```
37+
38+
Expected results:
39+
- No segment event warnings
40+
- HLS files created successfully
41+
- Clean state transitions logged
42+
43+
## Key Code Changes
44+
1. `setup_hls_muxer()`: Creates explicit mpegtsmux or uses internal
45+
2. Video/audio pad connections: Route through mux with segment injection
46+
3. `check_hls_streams_ready()`: Delayed start with proper state management
47+
48+
## Architecture Notes
49+
- GStreamer dev versions (1.23.x) have stricter checks than stable
50+
- ARM scheduling differences expose latent timing bugs
51+
- Explicit pipeline control prevents race conditions

0 commit comments

Comments
 (0)