Skip to content

Commit

Permalink
docs: update README with better info
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbee committed Aug 9, 2023
1 parent c0b5e92 commit 161467e
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 35 deletions.
139 changes: 107 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
[DASH-IF live source simulator][1].

As the original simulator ([livesim1][1]), the output is a wall-clock (UTC) synchronized
infinite linear stream of segments. The synchronization is done modulo asset length,
infinite linear stream of segments. This achieved by looping input VoD DASH assets,
and changing time stamps so that an infinite "live" stream is available.
The synchronization is done modulo asset length,
for example: a 1-hour asset restarts every hour on full hours, and a 30s asset
restarts every 30s on full and half minutes. If there is a clock in the video, it is
restarts every 30s on full and half minutes. If there is a clock in the video, and
the length is full minutes or similar, it is
therefore easy to directly see how long the system delay is from publishing to
screen presentation. The very short example assets bundled with the code are only
8s long, which means that they restart every time the UTC time is a multiple of 8s,
Expand All @@ -21,32 +24,23 @@ To provide full UTC time stamps and the possibility to test subtitles,
livesim2 has a new feature for generating subtitles for any number of languages.
This is done by a URL parameter like `/timesubsstpp_en,sv` which will result in
two subtitle tracks with with language codes "en" and "sv", respectively.
There is a corresponding setting for wvtt subtitles using `/timesubswvtt_en,sv`.

The new software is written in Go instead of Python and designed to handle
content in a more flexible and versatile way.

It is intended to be very easy to install and deploy locally
The new `livesim2` software is written in Go instead of Python and designed to handle
content in a more flexible and versatile way. It is intended to be very easy to install and deploy locally
since it is compiled into a single binary that serves the content via a built-in
performant HTTP/2 server.

There is also a tool called `dashfetcher` that can be used to download
DASH VoD assets that can serve as sources for the live
linear outputs.

The sources are looped so that an infinite "live" stream is available.
performant HTTP/2 server. There is also a very simple way of setting up HTTPS
using Let´s Encrypt.

Similarly to [livesim1][1], the output is highly configurable by adding parameters inside the URLs.
These parameters are included not only in the MPD requests, but in
all segment requests allowing the server to be stateless, and
be able to generate streams with a huge number of
parameter variations. Currently, not all
all parameters of [livesim1][1] are implemented, but there are also new
parameters like the generated subtitles mentioned above.
parameter variations. Currently, not all parameters of [livesim1][1] are implemented,
but there are also new parameters like the generated subtitles mentioned above.
The [URL wiki page][urlparams] lists what is available.

## Components

There are two main components, the server `livesim2` and the VoD fetcher
There are two main components in this repo, the server `livesim2` and the VoD fetcher
`dashfetcher`.

### dashfetcher tool
Expand Down Expand Up @@ -90,11 +84,13 @@ Major values to configure are:

* the HTTP port being used (default: 8888)
* the top directory `vodroot` for searching for VoD assets to be used
* `certpath` and `keypath` is the HTTPS is used
* the HTTPS `domains` if Let's Encrypt automatic certificates are used
- `certpath` and `keypath` if HTTPS is used with manually downloaded certificates
- the HTTP/HTTPS `port` if `domains` is not being used (default: 8888)

Once the server is started, it will scan the file tree starting from
`vodroot` and gather metadata about all DASH VoD assets it finds.
Currently, only VoD assets using SegmentTimeline with `$Time$` and
Currently, only source VoD assets using SegmentTimeline with `$Time$` and
SegmentTemplate with `$Number$` are supported.

Once the server has started, it is possible to find out information about the server and
Expand Down Expand Up @@ -129,7 +125,7 @@ The following restrictions apply to the VoD manifest to be used with livesim2
### Test parameters

The query string parameter `?nowMS=...` can be used in any request
to set the wall-clock time `livesim2` uses as local time. The time is measured with respect to
to set the wall-clock time that `livesim2` uses as local time. The time is measured with respect to
the 1970 Epoch start, and makes it possible to test time-dependent requests in a deterministic way.

## Get Started
Expand Down Expand Up @@ -166,6 +162,29 @@ During development it may be easier to use the usual go commands:

or compile and run directly with `go run .`.

### HTTPS with automatic certificates

To enable HTTPS in an easy manner, make sure that you have DNS pointing to your machine,
and that ports 80 and 443 are forwarded. Then use the parameter
`--domains=your.domain.com,second.domain.com` to automatically fetch TLS certificates
from Let's Encrypt for your domains to this machine. The certificates are automatically
renewed before they expire.

#### HTTPS with manual certificates

The old-fashioned way of using manually acquired TLS certificates is also supported.
Use the two parameters `certpath` and `keypath` to point to the respective files,
and set the `port` to 443.`

## Content

There are multiple ways to get content to the livesim2 server.

1. Use the bundled test content (only 8s long)
2. Fetch content that was used with [livesim1][1] from
github at [livesim-content][livesim-content]
3. Use the `dashfetcher` tool to download a DASH asset

### Bundled test streams with the livesim2 server

A few very short (8s) test assets are bundled with the code.
Expand All @@ -188,22 +207,73 @@ http://localhost:8888/livesim2/testpic_8s/Manifest.mpd

The default pattern provides MPDs with SegmentTemplate using `$Number$`. To stream with
SegmentTimeline with `$Time$`, one should add the parameter `/segtimeline_1` between
`livesim2` and the start of the asset path. Other parameters are added in a similar way.
`livesim2` and the start of the asset path. For SegmentTimeline with `$Number$`, use
`/segtimelinenr_1` instead. Other parameters are added in a similar way.

Adding longer assets somewhere under the `vodroot` results in longer loops.
All sources are NTP synchronized (using the host machine clock) with a initial start
time given by availabilityStartTime and wrap every sequence duration after that.

### Running dashfetcher
### livesim-content at Github

In the repo [livesim-content][livesim-content], the content that was used for the
[livesim1 online][1-online] service is being gathered to make it easy to reproduce
the same use cases.

All content and features are not yet (2023-08-08) in place, but should be so before end
of October 2023.

To download and use that content, run

```sh
$ git clone https://github.com/Dash-Industry-Forum/livesim-content.git
```

and then set `--vodroot` to the `livesim-content` top directory or include that in
a bigger file tree.

### dashfetcher tool

The tool `dashfetcher` fetches DASH VoD assets via HTTP given an MPD URLs.
Currently it supports MPDs with SegmentTimeline with `$Time$` and
SegmentTemplate with `$Number$`. The assets must have no explicit `<BaseURL>` elements to
work properly. With the `-a/--auto` option, the path to the asset is preserved
as much as possible and adapted to the local path.

Files already downloaded will not be downloaded again, unless `-f/--force` is
used. As an example, to download a CTA-WAVE asset one can run

```sh
dashfetcher --auto https://dash.akamaized.net/WAVE/vectors/cfhd_sets/12.5_25_50/t3/2022-10-17/stream.mpd
```

which will result in a locally stored DASH VoD asset in the directory

```sh
./vod/WAVE/vectors/cfhd_sets/12.5_25_0t3/2022-10-17/
```

with an MPD called `stream.mpd` and the segments stored in subdirectories named after their relative
URLs. The download URL is added to a file `mpdlist.json` which is read by livesim2, to provide
information about the asset.

One can have multiple MPDs in the same asset directory and they may share some representations.
That is an easy way to have variants with different representation combinations.

#### Running dashfetcher

`dashfetcher` was created to facilitate download of DASH assets with lots of small segment files. One particular such source was the CTA-WAVE test content. However, that content is now also available as zip-files, so it is more efficient to download an unzip these files instead of making individual downloads of the segments.

For example, the asset above is also
available at `https://dash.akamaized.net/WAVE/vectors/cfhd_sets/12.5_25_50/t3/2022-10-17/t3.zip`.

The `dashfetcher` binary can be found in as `out/dashfetcher` after `make build`.

```sh
> dashfetcher --help
```

will provide a long help text that explains how to use it and will also provide an example URL
to CTA-WAVE content.
will provide a long help text that explains how to use it and will also provide an example URL to CTA-WAVE content.

## Running tests

Expand All @@ -223,7 +293,7 @@ on any Go compiler target platform such as Windows, MacOS, and Linux.
Since the result is a single binary it is easy to start it anywhere.

On Linux, `livesim2` can be run as a `systemd` service.
More information can be found in the `./deployment` directory.
More information can be found in the [deployment/README.md](deployment/README.md) file.

To get information about the available assets and other information
access the server's root URL.
Expand All @@ -242,9 +312,9 @@ The URL parameters are now listed on this project's Wiki page

## Project and plan for new features/enhancement

On the [livesim2 project page](https://github.com/orgs/Dash-Industry-Forum/projects/7)
the status of issues and proposed new ideas are listed. Draft ideas can
be changed into [livesim2 issues](https://github.com/Dash-Industry-Forum/livesim2/issues).
The sponsored transition from livesim to livesim2 is covered on a [wiki page][l2-status].
On the [livesim2 project page][l2-project] the status of issues and proposed new ideas are listed.
Draft ideas are changed into [livesim2 issues][l2-issues] if prioritized.

## Sponsoring

Expand All @@ -255,5 +325,10 @@ This project is in need of sponsoring for further development. See the

See [LICENSE.md](LICENSE.md).

[1]: (https://github.com/Dash-Industry-Forum/dash-live-source-simulator)
[urlparams]: (https://github.com/Dash-Industry-Forum/livesim2/wiki/URL-Parameters)
[1]: https://github.com/Dash-Industry-Forum/dash-live-source-simulator
[1-online]: https://livesim.dashif.org
[urlparams]: https://github.com/Dash-Industry-Forum/livesim2/wiki/URL-Parameters
[livesim-content]: https://github.com/Dash-Industry-Forum/livesim-content
[l2-project]: https://github.com/orgs/Dash-Industry-Forum/projects/7
[l2-issues]: https://github.com/Dash-Industry-Forum/livesim2/issues
[l2-status]: https://github.com/Dash-Industry-Forum/livesim2/wiki/Sponsored-transition-from-livesim1-to-livesim2
8 changes: 5 additions & 3 deletions SPONSORING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Sponsoring and Specific Feature Requests

Most of this project this far (March 2023) has been developed by
Most of this project this far has been developed by
[Eyevinn Technology][Eyevinn].

If you want to sponsor further development of this projec or have a need
DASH-IF has sponsored Eyevinn Technology to develop livesim2 and migrate livesim to livesim2 during Aug-Oct 2023.

If you want to sponsor further development of this project or have a need
for specific features to be developedm you can contact
[Eyevinn] directly, or convince your organisation
to sponsor [Eyevinn] or other development organisation to implement the
improvements or new issues you desire.

[Eyevinn]: https://eyevinn.se
[Eyevinn]: https://www.eyevinntechnology.se
6 changes: 6 additions & 0 deletions deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ Make sure that the binary and vod assets are available at the paths used in the
The binary can also be started and log in more console-friendly formats.
See the help text provided with `livesim2 -h` to see the options.

For Linode, there is a nice `stackscript` for a full machine setup available at
[https://cloud.linode.com/stackscripts/1189972](https://cloud.linode.com/stackscripts/1189972).

Deploying with HTTPS and TLS certificates from Let's Encrypt is also possible. Use the
`domains` parameter.

## Cross compilation

Cross-compilation can be done like (Linux on Mac example)
Expand Down

0 comments on commit 161467e

Please sign in to comment.