nx_ts_probe.nx
buildroot/runtime/nx_ts_probe.nx
about
nx_ts_probe.nx -- Rung 1 of the sovereign MPEG-TS -> fMP4 remuxer. Parses an MPEG-TS file (188-byte
packets), reads PAT -> PMT -> elementary-stream table, identifies the video PID + codec, reassembles the
video PES into an Annex-B elementary stream, and scans it for NAL units (SPS=7 / PPS=8 / IDR=5). Reports
what it finds so we can confirm H.264 before building the MP4 muxer. NishiLang only, no ffmpeg.
Usage: nx_ts_probe <file.ts> (default = first recording in the vid index). license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 7 | const K_MAGIC_2048: i64 = 2048 |
| 9 | const TSREAD: i64 = 8388608 // probe the first 8 MB (PAT/PMT + plenty of video to find SPS/PPS/IDR) |
| 10 | const ESCAP: i64 = 8388608 |
functions
| 12 | func tp_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 13 | func tp_n(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1}; sys_write(1,b,k); return 0 } |
| 14 | func tp_hex(v: i64) -> i64 { let h: *u8="0123456789abcdef" as *u8; let b: *u8=sys_mmap(4); b[0]=h[(v>>4)&0xf]; b[1]=h[v&0xf]; sys_write(1,b,2); return 0 } |
| 15 | func tp_rate(idx: i64) -> i64 |
| 31 | func main(argc: i64, argv: *i64) -> i64 |