stream_peeker is commandline utility to quickly assess how a videostream arrives on a system. It doesn't decode and render video, by default doesn't do anything with the data it receives.
While that doesn't sound very useful, its original purpose was to just apply a (potentially large) load on the network and device(s), without putting a significant load on the receiver PC.
You can provide it some parameters to make it print basic frame information on the terminal output. This way one can really peek into the stream and use it for troubleshooting. The tool is made for Axis cameras, it knows the URL to use while you only specify the IP address. For other brands, the -u parameter allows specifying the full URL. But this has only seen limited testing, the RTSP receiver inside stream_peeker may not be able to deal with the "dialect" of other camera brands.
When you don't supply parameters at all, it prints an overview of the supported options, including some examples. See below.
Usage: stream_peeker [options] host [[options] host ...]
Connect to one or more Axis RTP streams and dump RTP/H.264 analysis information
until a key is pressed.
Examples:
- Don't dump anything, just put a load on the camera
stream_peeker 192.168.0.90
- Put a load on four cameras, three having similar addresses
stream_peeker 192.168.0.90 91 92 172.20.15.80
- Print timing information about entire videoframes as they are received
(this is the most usefull option)
stream_peeker -M 192.168.0.90
- Like above, but use UDP instead of TCP streaming (sometimes even more usefull)
stream_peeker -s udp -M 192.168.0.90
- Dump frames and packet loss
stream_peeker -s udp -a rtpseqalarm -M 192.168.0.90
- Dump RTP info to stdout of default stream from 192.168.0.90, 91 and 92:
stream_peeker -a dumprtp -F - 192.168.0.90 91 92
- Dump RTP info of 640x480 stream from two cameras, each to it's own file:
stream_peeker -a dumprtp -r 640x480 -F file1.txt 192.168.0.90 -F file2.txt 91
Options (default value):
-a analysers Comma-separated list of analysers (none).
Supported analysers:
dumprtp: Dump RTP header info
dumpnal: Dump NAL header info
rtpseqalarm: Print warning on missed RTP sequence numbers
bitrate: Print bitrate statistics every minute
-M Print videoframe info (none)
-s streaming udp, tcp (tcp)
-e encoding jpeg, h264 (h264)
-f fps Framerate (camera-default)
-r XxY Image resolution (camera-default)
-c compression Compression value to use 0..100 (camera-default)
-t Kbps Target bitrate (camera-default)
-m Kbps Max bitrate (camera-default)
-o bitrate_priority none, framerate, quality (camera-default)
-g gop GOP length (camera-default)
-n X Quit after X frames (run endless)
-F name Write to filename 'Name' (stdout)
-p path Write to path 'path' (current directory)
-U username (root)
-P password (pass)
-S recv_bufsize Socket receive buffer size (OS default)
-E seconds End after specified time (run endless)
-u url User-specified URL. Overrules e,f,r,c,t,m,o,g (none)
-T medianame Track. Use in conjuction with -u (first server supplied media)
-x port Alternative RTSP port (554)
Build: Apr 28 2020
It is important to be aware that commandline switches are applied to all IP addresses "to the right" and overwrite commandline switches to the left. For example, below will request two streams of resolution 640x480 because both IP addresses are to the right of this setting. The first one will be a TCP stream because that's the default streaming method, the second one will use UDP streaming because the streaming setting was redefined. Both streams will be printed on frame level (which makes a messy output)
stream_peeker -r 640x480 -M 192.168.0.90 -s udp 91
Known issues
- Handling events in Windows console not optimal: program quits after few keypresses outside window
Release notes
Version 1.0.4, oct 31, 2023
Fixed:
- Sourcecode and toolchain in sync with llv
- This includes a compatibility issue with Windows 11, relevant for TCP streaming
version 1.0.3, aug 5, 2020
Changed:
- Changed time column into stream duration in milliseconds
Fixed:
- Frames actually got decoded, this is now removed
- Corrected packet counters in summary line
version 1.0.2, july 6, 2020
Fixed:
- -n option working
- capture delta-time column shows correct value again
version 1.0.1, april 28, 2020
Changed:
- Updated C++ compiler
- Source code in sync with llv
- Small textual improvements
version 1.0.0, feb 2018
Initial release