Skip to content

Commit

Permalink
chore: fix build commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Jun 11, 2024
1 parent c501924 commit 5bd704d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 32 deletions.
60 changes: 31 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
CasparCG Media-Scanner
===============
# CasparCG Media-Scanner

This project facilitates CasparCG Server since version 2.2.0. It abstracts the collection of metadata and generation of thumbnails into a separate process.

Usage
-----
## Usage

This project is designed to be used via the AMCP protocol in CasparCG server. However, there are some endpoints for additional data which can only be access directly over http.

Expand All @@ -14,6 +12,7 @@ The scanner needs a copy of `ffmpeg` to be able to scan any media files. On wind
You can override these locations in the scanner configuration.

### Configuration

There are various options that can be changed for the scanner. These can all be set by environment variables or as arguments.
Some features are disabled by default and should be enabled in this way.

Expand All @@ -24,23 +23,26 @@ The full set of available options and their default values can be found at [conf
By default the scanner expects there to be a casparcg.config file next to the executable to specify the paths to media. To disable use of this file `scanner.exe --caspar null`

### AMCP Endpoints

These endpoints are exposed by the AMCP protocol in CasparCG Server. This means that they have some AMCP syntax wrappings, which will likely need to be stripped off if using in an external client

* `/tls` - Lists available template files
* `/cls` - Lists available media files
* `/fls` - Lists available font files
* `/cinf/<name>` - Gets information on specified media file
* `/thumbnail/generate` - Backwards compatibility, has no effect
* `/thumbnail/generate/<name>` - Backwards compatibility, has no effect
* `/thumbnail` - Lists the available thumbnails
* `/thumbnail/<name>` - Gets the thumbnail for a media file
* `/templates` - Detailed list of templates in JSON format.
* `/media` - Lists available media files in json form with an enhanced set of metadata
* `/media/info/<name>` - Gets the json enhanced metadata for the specified media file
* `/media/thumbnail/<name>` - Gets the thumbnail for a media file
- `/tls` - Lists available template files
- `/cls` - Lists available media files
- `/fls` - Lists available font files
- `/cinf/<name>` - Gets information on specified media file
- `/thumbnail/generate` - Backwards compatibility, has no effect
- `/thumbnail/generate/<name>` - Backwards compatibility, has no effect
- `/thumbnail` - Lists the available thumbnails
- `/thumbnail/<name>` - Gets the thumbnail for a media file
- `/templates` - Detailed list of templates in JSON format.
- `/media` - Lists available media files in json form with an enhanced set of metadata
- `/media/info/<name>` - Gets the json enhanced metadata for the specified media file
- `/media/thumbnail/<name>` - Gets the thumbnail for a media file

### Changes

A stream of changes can be accessed with the following. [Full docs](https://pouchdb.com/api.html#changes)

```
const PouchDB = require('pouchdb-node')
const db = new PouchDB('http://localhost:8000/db/_media')
Expand All @@ -67,22 +69,23 @@ We also use Leveldown which uses native modules so if you're on Windows you need
`npm install --global --production windows-build-tools`

After this:
* Clone the repository
* [Required] Obtain the [_FFmpeg_ and _FFprobe_](https://ffmpeg.org/download.html) executables and place them in the root folder (or add them to your PATH).
* FFmpeg 6.1 is currently recommended, newer versions have not been tested and may have issues
* A full list of known working versions can be found at https://github.com/CasparCG/media-scanner/blob/master/src/__tests__/ffmpegReleases.json
* [Optional] Copy a `casparcg.config` file into the root folder
* Run `yarn install`
* Run `yarn dev` to start the development server

- Clone the repository
- [Required] Obtain the [_FFmpeg_ and _FFprobe_](https://ffmpeg.org/download.html) executables and place them in the root folder (or add them to your PATH).
- FFmpeg 6.1 is currently recommended, newer versions have not been tested and may have issues
- A full list of known working versions can be found at https://github.com/CasparCG/media-scanner/blob/master/src/__tests__/ffmpegReleases.json
- [Optional] Copy a `casparcg.config` file into the root folder
- Run `yarn install`
- Run `yarn dev` to start the development server

## Building executable

Be aware that because of the native extensions, you can only build for the target you are currently on.
Be aware that because of the native extensions, you may only be able to build for the target you are currently on.

* On Windows
* `yarn build-win32`
* On Linux
* `yarn build-linux`
- On Windows
- `yarn build-win32-x64`
- On Linux
- `yarn build-linux-x64` or `yarn build-linux-arm64` depending on cpu architecture

The built files will be placed in `./dist`, make sure you copy all files into the main CasparCG directory.

Expand All @@ -93,7 +96,6 @@ higher, see [LICENSE](LICENSE) for details.

More information is available at http://casparcg.com/


# Documentation

The most up-to-date documentation is always available at
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"dev": "nodemon ./src",
"build": "run build:ts && node tools/build.mjs",
"build:ts": "rimraf dist && tsc -b tsconfig.build.json",
"build-linux-arm64": "node tools/build.mjs linux arm64",
"build-linux-x64": "node tools/build.mjs linux x64",
"build-win32-x64": "node tools/build.mjs win32 x64",
"build-linux-arm64": "run build linux arm64",
"build-linux-x64": "run build linux x64",
"build-win32-x64": "run build win32 x64",
"lint:raw": "run eslint --ext .ts --ext .js --ext .tsx --ext .jsx --ext .mts --ext .mjs --ignore-pattern dist",
"lint": "yarn lint:raw .",
"lint-fix": "yarn lint --fix",
Expand Down

0 comments on commit 5bd704d

Please sign in to comment.