{"id":28513573,"url":"https://github.com/livepeer/stream-tester","last_synced_at":"2025-07-04T07:31:35.817Z","repository":{"id":36495284,"uuid":"188443025","full_name":"livepeer/stream-tester","owner":"livepeer","description":"Stream tester is a tool to measure performance and stability of Livepeer transcoding network","archived":false,"fork":false,"pushed_at":"2024-06-25T12:59:08.000Z","size":1537,"stargazers_count":24,"open_issues_count":60,"forks_count":11,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-06-30T02:49:05.773Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/livepeer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-24T15:10:56.000Z","updated_at":"2025-05-01T21:38:21.000Z","dependencies_parsed_at":"2023-10-20T01:13:37.878Z","dependency_job_id":"7c99d843-9a33-4286-a455-2a0d5dd5f93c","html_url":"https://github.com/livepeer/stream-tester","commit_stats":null,"previous_names":[],"tags_count":168,"template":false,"template_full_name":null,"purl":"pkg:github/livepeer/stream-tester","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livepeer%2Fstream-tester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livepeer%2Fstream-tester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livepeer%2Fstream-tester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livepeer%2Fstream-tester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livepeer","download_url":"https://codeload.github.com/livepeer/stream-tester/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livepeer%2Fstream-tester/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263467757,"owners_count":23471123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-09T01:07:25.979Z","updated_at":"2025-07-04T07:31:35.797Z","avatar_url":"https://github.com/livepeer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stream tester\n\n[![Docker Image CI][1]][2]\n\nStream tester is a tool to test Livepeer network performance and\nstability. It sends RTMP streams into broadcaster nodes and download\nback transcoded data and calculates success rate. It can be used as\nstandalone command line tool or as part of [test harness][3]. As part\nof test harness, it works in server mode, inside docker image, and is\ncontrolled through REST interface.\n\nAlso it can be used to pull arbitrary .m3u8 stream and save it to disk.\n\nWhen running from command line, Stream tester has two different modes.\nFirst one is for (load) testing Livepeer Broadcaster and second one\nwas developed for running long test against Livepeer Wowza plugin, but\ncan be used with any transcoder that takes RTMP input and output HLS.\n\n## Binaries\n\nAutomatically built binaries can be found on\n[releases](https://github.com/livepeer/stream-tester/releases) page.\n\n## Video test files\n\n- [official_test_source_2s_keys_24pfs.mp4](https://test-harness-gcp.livepeer.fish/official_test_source_2s_keys_24pfs.mp4)\n\n- [official_test_source_2s_keys_24pfs_3min.mp4](https://test-harness-gcp.livepeer.fish/official_test_source_2s_keys_24pfs_3min.mp4)\n\n- [bbb_sunflower_1080p_30fps_normal_t02.mp4](https://test-harness-gcp.livepeer.fish/bbb_sunflower_1080p_30fps_normal_t02.mp4)\n\n- [bbb_sunflower_1080p_30fps_normal_1min.mp4](https://test-harness-gcp.livepeer.fish/bbb_sunflower_1080p_30fps_normal_1min.mp4)\n\n## Command line\n\nIf name of the file to stream is not specified, then default one -\n`official_test_source_2s_keys_24pfs.mp4` is used. It should be placed\nin the same directory as Stream Tester. Can be downloaded from\n[here](https://test-harness-gcp.livepeer.fish/official_test_source_2s_keys_24pfs.mp4).\n\nAll options can be put into config file and used like\n\n```sh\n./streamtester -config local.cfg\n```\n\nConfig file example: [local.cfg](local.cfg)\n\n### Load testing mode\n\nStreams file to its end, or for the time specified. Can stream\narbitrary number of streams simultaneously and repeat streaming any\nnumber of times. Counts number of segments streamed and number of\nsegments that was readed back. Reports success rate (readed segments /\nsegments should have been readed). Calculate transcode latency (should\nbe enabled from command line).\n\nUsage:\n\n```sh\n./streamtester -host localhost -rtmp 1935 -media 8935 -profiles 2 -repeat 1 -sim 1 -file file_to_stream.mp4\n```\n\nParams:\n\n-   `-host` Host name of broadcaster to stream to\n-   `-media-host` Host name to read transcoded stream from. If not specified, `-host` will be used\n-   `-rtmp` Port number to stream RTMP stream to\n-   `-media` Port number to download media from\n-   `-profiles` How many transcoding profiles broadcaster configured with\n-   `-sim` How many simultaneous streams stream into broadcaster\n-   `-repeat` How many times to repeat streaming\n-   `-latency` Measure transcoding latency\n-   `-time` Time to stream streams (40s, 4m, 24h45m). Not compatible with repeat option\n-   `-http-ingest` Use HTTP push instead of RTMP\n-   `-file` Name of the file to stream\n\n### Infinite stream testing mode\n\nIn this mode Stream Tester streams video to RTMP ingest point and read\nHLS stream back. Streaming is stopped only on error, so it will be\ninfinite if transcoding is done ideally.\n\nErrors can be reported to Discord.\n\nChecks downloaded segments for validity by parsing them using `joy4`\nlib. Can save segments with errors to Google Storage.\n\nChecks for gaps in HLS stream (PTS of the first frame of the segment\nshould be PTS of first frame of previous segment plus length of\nprevious segment).\n\nChecks for time drift between transcoded streams (At each given time,\nPTSs of first segments in different media streams shouldn't differ for\nmore than four seconds. (Apple's HLS validator tool report error if\ndifference is more than two seconds)).\n\nStops streaming if there is no new segments in HLS stream for a 30 seconds.\n\nUsage:\n\n```sh\n./streamtester -ignore-time-drift \\\n  -ignore-gaps -wowza -wait-for-target 150s \\\n  -media-url http://site.com:1935/something.m3u8 \\\n  -rtmp-url rtmp://site.com:1935/something \\\n  -profiles 3 \\\n  -file file_to_stream.mp4\n```\n\nParams:\n\n-   `-wowza` Should be specified if streaming to Wowza. Removes Wowza's session cookies from manifest names\n-   `-rtmp-url` URL to stream RTMP stream to\n-   `-media-url` URL of main .m3u8 manifest to pull transcoded stream back from\n-   `-profiles` How many transcoded (not including source) profiles should be in resulting (.m3u8) stream\n-   `ignore-no-codec-error` Do not stop streaming if segment without codec's info downloaded\n-   `ignore-gaps` Do not stop streaming if gaps found\n-   `ignore-time-drift` Do not stop streaming if time drift detected\n-   `wait-for-target` Timeout for trying to connect to RTMP ingest host. Should be specified in seconds or minutes (10s, 4m)\n-   `discord-url` URL of Discord's webhook to send messages to Discord channel\n-   `discord-users` Id's of users to notify in case of failure\n-   `discord-user-name` User name to use when sending messages to Discord\n-   `gsbucket` Google Storage bucket (to store segments that was not successfully parsed)\n-   `gskey` Google Storage private key (in json format (actual key, not file name))\n-   `-file` Name of the file to stream\n\n### Infinite HLS pull testing mode\n\nIn this mode Stream Tester pulls arbitrary HLS stream and runs same\nchecks as in previous mode. To use it specify `-media-url` without\nspecifying `-rtmp-url`.\n\n### Saving arbitrary stream to file\n\nRunning\n\n```sh\n./streamtester -save -infinite-pull http://site.com:1935/live/main_playlist.m3u8\n```\n\nwill save pull `main_playlist.m3u8` stream and save all the segments along with (`VOD`) manifests to current directory.\n\n## Server mode\n\nRun\n```\n./streamtester -server -serverAddr localhost:7934\n```\n\nThis command block until interrupted.\n\nIt provide these REST endpoints:\n\n---\n\nGET `/stats?latencies\u0026base_manifest_id=basemanifestid`\n\nif optional parameter `latencies` present, `/stats` will return raw latencies values\nif optional parameter `base_manifest_id` present, then stats will be filtered by that base manifest id\n\nreturns object:\n\n```json\n{\n    \"rtmp_active_streams\": 1,\n    \"rtmp_streams\": 1,\n    \"media_streams\": 1,\n    \"sent_segments\": 3,\n    \"downloaded_segments\": 7,\n    \"should_have_downloaded_segments\": 9,\n    \"failed_to_download_segments\": 0,\n    \"bytes_downloaded\": 2721864,\n    \"success_rate\": 77.77777777777779,\n    \"connection_lost\": 0,\n    \"start_time\": \"2020-01-07T21:59:51.008881+02:00\",\n    \"finished\": false,\n    \"raw_source_latencies\": [79210696, 87020114],\n    \"raw_transcoded_latencies\": [298718923, 324982522]\n}\n```\n\nWhere\n\n-   `rtmp_active_streams` - number of streams is being currently streamed\n-   `rtm_pstreams` - total number of RTMP streams (active plus finished)\n-   `rtm_pstreams` - total number of media streams (downloading back segments)\n-   `sent_segments` - total number of segments sent to broadcaster\n-   `downloaded_segments` - total number of segments downloaded back\n-   `should_have_downloaded_segments` - number of segments should be downloaded back for 100% success rate. It equals `sent_segments` \\* (`numberOfTranscodingProfiles` + 1)\n-   `failed_to_download_segments` - number of segments failed to download with some error\n-   `bytes_downloaded` - number of bytes downloaded\n-   `success_rate` - success rate, percent\n-   `connection_lost` - number of times streamer lost connection to broadcaster. Streamer does not attempt to reconnect, so statistics will only have data till connection was lost\n-   `finished` - indicates that all streaming tasks are finished\n\n---\n\nPOST `/start_streams`\n\nAccepts object:\n\n```json\n{\n    \"host\": \"localhost\",\n    \"media_host\": \"\",\n    \"file_name\": \"official_test_source_2s_keys_24pfs.mp4\",\n    \"rtmp\": 1935,\n    \"media\": 8935,\n    \"repeat\": 1,\n    \"simultaneous\": 1,\n    \"profiles_num\": 2,\n    \"do_not_clear_stats\": false,\n    \"measure_latency\": true,\n    \"http_ingest\": false\n}\n```\n\n`file_name` - should exists in local filesystem of streamer.\n`do_not_clear_stats` - if true, on new call to `/start_streams` do not clear old stats, but instead append to it\n\nReturns\n\n```json\n{\n    \"success\": true,\n    \"base_manifest_id\": \"manifest_id_here\"\n}\n```\n\nCan return 404 if request contains wrong parameters.\n\n---\n\nGET `/stop`\n\nStop currently running streams.\n\nDoesn't return any data, only status 200\n\n[1]: https://github.com/livepeer/stream-tester/actions/workflows/docker.yaml/badge.svg\n[2]: https://github.com/livepeer/stream-tester/actions/workflows/docker.yaml\n[3]: https://github.com/livepeer/test-harness\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivepeer%2Fstream-tester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivepeer%2Fstream-tester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivepeer%2Fstream-tester/lists"}