STREAM_TYPE(1)

✨ stream-type β€” guess the type of a stream file, bestie ✨

okay so real talk, this is the stream-type page from the General Commands Manual πŸ’– she's a little detective who looks at a mystery stream file and is like "hmm. i know what you are." πŸ•΅οΈβ€β™€οΈβœ¨


πŸŽ€ NAME πŸŽ€

stream-type β€” guess the type of a stream file πŸ’…


🌸 SYNOPSIS 🌸

stream-type [-err stdout] [-err stderr] [-verbose | -v] [-quiet | -q]
            in_file

πŸ’œ DESCRIPTION πŸ’œ

So the whole vibe is: she tries to figure out whether your input stream is a Transport Stream, a Program Stream, or an Elementary Stream β€” and if it's that last one, whether it's H.262 or H.264 (aka MPEG-2 or MPEG-4/AVC respectively, iykyk). πŸ”₯

ngl the mechanisms she uses are fairly crude 😭 like she's not doing forensic science, she's doing vibes-based guesswork. Here's what she's assuming:

  • data is byte aligned 🧚
  • for TS, the first byte in the file will be the start of a NAL unit, and PAT/PMT packets will be findable πŸ‘‘
  • for PS, the first packet starts immediately at the start of the file, and is a pack header πŸŽ€
  • if the first 1000 packets could be H.262 or H.264, then the data is assumed to be H.264 β€” because the program doesn't try to determine sensible sequences of H.262/H.264 packets, so this is a reasonable way of guessing πŸ€·β€β™€οΈ
⚠️ bestie listen β€” it is quite possible that data which is not relevant will be misidentified. she's guessing!! don't come for her πŸ’€

πŸ“ Files πŸ“

  • in_file β€” is the file to analyse πŸ¦‹

πŸ’… Switches πŸ’…

  • -err stdout β€” write error messages to standard output (this is the default btw ✨)
  • -err stderr β€” write error messages to standard error (the Unix traditional way, old school iconic πŸ‘‘)
  • -v, -verbose β€” output more detailed information about how it is making its decision πŸ” (she's telling you her whole thought process, main character energy)
  • -q, -quiet β€” only output error messages 🀫

🌈 RETURN VALUES 🌈

the exit value is literally her whole answer, so here's the decoder ring:

  • 10 β€” if it detects Transport Stream
  • 11 β€” if it detects Program Stream
  • 12 β€” if it detects Elementary Stream containing H.262 (MPEG-2)
  • 14 β€” if it detects Elementary Stream containing H.264 (MPEG-4/AVC)
  • 5 β€” if it looks like it might be PES
  • 9 β€” if it really cannot decide 😭
  • 0 β€” if some error occurred πŸ’€

πŸ’– SEE ALSO πŸ’–


okay that's the whole page bestie, go forth and identify those streams 🫢✨ this was the Debian edition, dated October 28, 2015 β€” mwah, slay, periodt πŸ’…πŸŽ€