{"id":13908410,"url":"https://github.com/ebu/test-engine-live-tools","last_synced_at":"2025-04-13T02:33:01.445Z","repository":{"id":14024211,"uuid":"16726175","full_name":"ebu/test-engine-live-tools","owner":"ebu","description":"Small tools and scripts for the EBU test engine platform.","archived":false,"fork":false,"pushed_at":"2015-03-30T08:28:50.000Z","size":461,"stargazers_count":18,"open_issues_count":6,"forks_count":16,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-26T20:55:41.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ebu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-11T09:41:37.000Z","updated_at":"2022-11-17T10:02:32.000Z","dependencies_parsed_at":"2022-07-15T14:48:30.673Z","dependency_job_id":null,"html_url":"https://github.com/ebu/test-engine-live-tools","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebu%2Ftest-engine-live-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebu%2Ftest-engine-live-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebu%2Ftest-engine-live-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebu%2Ftest-engine-live-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebu","download_url":"https://codeload.github.com/ebu/test-engine-live-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657830,"owners_count":21140842,"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":"2024-08-06T23:02:42.742Z","updated_at":"2025-04-13T02:33:01.197Z","avatar_url":"https://github.com/ebu.png","language":"JavaScript","funding_links":[],"categories":["HarmonyOS","Media Analysis, Quality Metrics \u0026 AI Tools"],"sub_categories":["Windows Manager","Quality Analysis \u0026 Metrics"],"readme":"# test-engine-live-tools\n\nSmall tools and scripts for the EBU test engine platform. These allow for DASH-ing and encoding a live stream.\n\n# Installation\n\nThe easiest way to install is to use the `npm` package. This will give you the latest released version and install all\ndependencies (except ffmpeg and MP4Box, you need to provide these yourself):\n\n    # npm install test-engine-live-tools\n\nIf you wish to use a different version from the Git repository you have to clone the code and install the dependencies using npm.\nAlso, be sure to provide your own MP4Box and ffmpeg binaries, they are not included.\n\n    # git clone https://github.com/ebu/test-engine-live-tools.git\n    # cd test-engine-live-tools\n    # npm install\n\n# Usage\n\nIn general, the tool operates by looping an MPEG-2 Transport Stream and providing that to ffmpeg using the segment muxer.\nThe generated segments are picked up and packaged/fragmented using MP4Box. After all segments for the desired representations\nare available they are DASH-ed by MP4Box using the `--dash-ctx` option. This generates the MPD for the live stream and keeps\nit updated.\n\nA command-line utility is included which allows you to easily stream from the command-line. Usage:\n\n    # bin/live-stream [-c config_file] input_file\n\nThe `config_file` is optional and allows you to create custom settings for your live stream without having to change anything\nin the sources. The `input_file` is mandatory and it is required that this is currently muxed as a MPEG-2 Transport Stream for\neasy looping of the source material. The contents of the file can be either MPEG-2 video/audio or H264/AAC, or most likely\nanything else that ffmpeg can extract from a MPEG-2 TS container.\n\n## Using different sources\n\nInstead of using a looped MPEG-2 TS file directly, it is also possible to read from other input sources. By specifying an input\nsource using a URL with a protocol, this will be directly passed to ffmpeg to read from that source. This way you can\nfor example ingest video using UDP transport. Example usage:\n\n    # bin/live-stream udp://192.168.0.10:1234\n\nIn theory any transport protocol supported by your version of ffmpeg is allowed.\n\n# Configuration\n\nThe default configuration generates one video representation and one audio representation. See `lib/config.js` for details.\nAll parameter configuration is listed as an array of arguments which NodeJS understands. Custom configuration can be created\nby creating a valid JSON file containing an object that overrides values of the default configuration. The complete default configuration is:\n\n```javascript\n{\n  segmentDir: '/tmp/dash_segment_input_dir',\n  outputDir: '/tmp/dash_output_dir',\n  mp4box: 'MP4Box',\n  ffmpeg: 'ffmpeg',\n  encoding: {\n    commandPrefix: [ '-re', '-i', '-', '-threads', '0', '-y' ],\n    representations: {\n      audio: [\n        '-map', '0:1', '-vn', '-acodec', 'aac', '-strict', '-2', '-ar', '48000', '-ac', '2',\n        '-f', 'segment', '-segment_time', '4', '-segment_format', 'mpegts'\n      ],\n      video: [\n        '-map', '0:0', '-vcodec', 'libx264', '-vprofile', 'baseline', '-preset', 'veryfast',\n        '-s', '640x360', '-vb', '512k', '-bufsize', '1024k', '-maxrate', '512k',\n        '-level', '31', '-keyint_min', '25', '-g', '25', '-sc_threshold', '0', '-an',\n        '-bsf', 'h264_mp4toannexb', '-flags', '-global_header',\n        '-f', 'segment', '-segment_time', '4', '-segment_format', 'mpegts'\n      ]\n    }\n  },\n  packaging: {\n    mp4box_opts: [\n      '-dash-ctx', '/tmp/dash_output_dir/dash-live.txt', '-dash', '4000', '-rap', '-ast-offset', '12',\n      '-no-frags-default', '-bs-switching', 'no', '-min-buffer', '4000', '-url-template', '-time-shift',\n      '1800', '-mpd-title', 'MPEG-DASH live stream', '-mpd-info-url', 'http://ebu.io/', '-segment-name',\n      'live_$RepresentationID$_', '-out', '/tmp/dash_output_dir/live', '-dynamic', '-subsegs-per-sidx', '-1'\n    ]\n  }\n}\n```\n\nYou can use this as a basis for your own configuration. Both the ffmpeg command and MP4Box commands are generated\nusing this configuration. You can add extra representations by overriding the `encoding` object.\n\nPlease not that some options are required to be able to create a valid live stream. For example: it is required that\nwe read from stdin using ffmpeg, so `-i -` is required. Also it is preferred to read realtime, so `-re` is also needed.\n\nThe full ffmpeg command is generated by concatenating `encoding.commandPrefix` with the configurations in\n`encoding.represenations`. Output files will be automatically added and you should not specify those yourself.\n\nMore example configuration will be added add a later stage.\n\n# Caveats / pitfalls\n\nLive streaming using MPEG-DASH is not always easy. To make sure that you are compatible with most DASH clients take extra\ncare to make sure you're always generating closed GOPs, fixed segment durations and constant bit rates and that timing\nover segments is continuous and identical across representations. The default configuration should do just that, but be\nsure to keep this in mind.\n\n# Requirements\n\n* NodeJS 0.10.x / npm\n* ffmpeg binary compiled to taste (recommended: 2.3 or higher)\n* MP4Box binary compiled to taste (recommended: r5400 or newer)\n\n# License\n\nAvailable under the BSD 3-clause license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febu%2Ftest-engine-live-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febu%2Ftest-engine-live-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febu%2Ftest-engine-live-tools/lists"}