Vidispine

Installation

Pre-requisites

Install Pre-requisites on CentOS

Execute the following:

$ yum install -y git ruby ruby-devel rubygems
$ gem install bundler

Install Using Git

Execute the following:

$ git clone https://github.com/XPlatform-Consulting/vidispine.git
$ cd vidispine
$ bundle update

Or install it yourself using the specific_install gem:

$ gem install specific_install
$ gem specific_install https://github.com/XPlatform-Consulting/vidispine.git

Vidispine API Executable bin/vidispine

Usage

Usage:
    vidispine -h | --help

Options:
        --host-address HOSTADDRESS   The address of the server to communicate with.
                                      default: localhost
        --host-port HOSTPORT         The port to use when communicating with the server.
                                      default: 8080
        --username USERNAME          The account username to authenticate with.
        --password PASSWORD          The account password to authenticate with.
        --accept-header VALUE        The value for the Accept header sent in each request.
                                      default: application/json
        --content-type VALUE         The value for the Content-Type header sent in each request.
                                      default: application/json; charset=utf-8
        --method-name METHODNAME     The name of the method to call.
        --method-arguments JSON      The arguments to pass when calling the method.
        --storage-map JSON           A map of file paths to storage ids to use in utility methods.
        --metadata-map JSON          A map of field aliases to field names to use in utility methods.
        --pretty-print               Will format the output to be more human readable.
        --log-to FILENAME            Log file location.
                                      default: STDERR
        --log-level LEVEL            Logging level. Available Options: debug, info, warn, error, fatal
                                      default: error
        --[no-]options-file [FILENAME]
                                     Path to a file which contains default command line arguments.
                                      default: /Users/jw/.options/vidispine
    -h, --help                       Display this message.

Available API Methods

collection_create

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collection_create --method-arguments '{"collection_name":"SomeName"}'

collection_delete

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collection_delete --method-arguments '{"collection_id":"VX-1"}'

collection_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collection_get --method-arguments '{"collection_id":"VX-1"}'

collection_items_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collection_items_get --method-arguments '{"collection_id":"VX-1"}'

collection_metadata_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collection_metadata_get --method-arguments '{"collection_id":"VX-1"}'

collection_object_add

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collection_object_add --method-arguments '{"collection_id":"VX-1","object_id":"VX-2","type":'item"}'

collection_object_remove

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collection_object_remove --method-arguments '{"collection_id":"VX-1","object_id":"VX-2","type":"item"}'

collection_rename

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collection_rename --method-arguments '{"collection_id":"VX-1","name":"NewName"}'

collections_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collections_get

import_placeholder

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name import_placeholder --method-arguments '{"video":1}'

import_placeholder_item

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name import_placeholder_item --method-arguments '{"item_id":"VX-1","item_type":"video","uri":"file://srv/media1/test.mov"}'

import_using_uri

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name import_using_uri --method-arguments '{"uri":"file://srv/media1/test.mov"}'

item_collections_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_collections_get --method-arguments '{"item_id":"VX-1"}'

item_delete

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_delete --method-arguments '{"item_id":"VX-117"}'
vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_delete --method-arguments '{"item_id":"VX-117","keepShapeTagMedia":"lowres,webm,original","keepShapeTagStorage":"VX-2,VX-3"}'

item_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_get --method-arguments '{"item_id":"VX-1"}'

item_metadata_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_metadata_get --method-arguments '{"item_id":"VX-1"}'

item_metadata_set

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_metadata_set --method-arguments '{"item_id":"VX-1","metadata_document":{ }}'

item_shape_files_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_shape_files_get --method-arguments '{"item_id":"VX-1","shape_id":"VX-2"}'

item_shape_import

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_shape_import --method-arguments '{"item_id":"VX-1","uri":"file:///srv/media1/test.mov","tag":"original"}'

item_thumbnail

TODO: ADD EXAMPLE

item_transcode

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_transcode --method-arguments '{"item_id":"VX-116", "tag":"original"}'

item_uris_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_uris_get --method-arguments '{"item_id":"VX-1"}'
vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_uris_get --method-arguments '{"item_id":"VX-1","tag":"lowres"}'

items_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name items_get

TODO: ADD EXAMPLE

job_abort

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name job_abort --method-arguments '{"job_id":"VX-1"}'

job_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name job_get --method-arguments '{"job_id":"VX-1"}'

jobs_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name jobs_get

storage_delete

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name storage_delete --method-arguments '{"storage_id":"VX-1"}'

storage_file_create

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name storage_file_create --method-arguments '{"storage_id":"VX-1", "path":"filename.ext", "state":"closed"}'

storage_file_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name storage_file_get --method-arguments '{"storage_id":"VX-1"}'

storage_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name storage_get --method-arguments '{"storage_id":"VX-1"}'

storage_method_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name storage_method_get --method-arguments '{"storage_id":"VX-1"}'

storages_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name storages_get

Utility Methods

collection_file_add_using_path

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collection_file_add_using_path --method-arguments '{"storage_path_map":{"/Volumes/storages/media1":"VX-1"},"relative_file_path_collection_name_position":0,"metadata_file_path_field_id":"portal_mf48881","file_path":"/Volumes/storages/media1/MyCollectionName/test12_original.mp4"}'

collection_get_by_name

Get First Match
vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collection_get_by_name --method-arguments '{"collection_name":"SomeName"}'

Get All Matches
vidispine --host-address 127.0.0.1 --host-port 8080 --method-name collection_get_by_name --method-arguments '[{"collection_name":"SomeName"},{"return_first_match":false}]'

item_add_using_file_path

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_add_using_file_path --method-arguments '{"storage_path_map":{"/Volumes/storages/media1":"VX-1"},"file_path":"someDirectory/someFile.mov"}'

item_add_using_file_path_metadata

Find/Create Item
vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_add_using_file_path_metadata --method-arguments '{"storage_path_map":{"/Volumes/storages/media1":"VX-1"},"metadata_file_path_field_id":"portal_mf48881","file_path":"/Volumes/storages/media1/MyCollectionName/test12_original.mp4"}'

Find/Create Item and Add Item to Collection
vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_add_using_file_path_metadata --method-arguments '{"storage_path_map":{"/Volumes/storages/media1":"VX-1"},"metadata_file_path_field_id":"portal_mf48881","file_path":"/Volumes/storages/media1/MyCollectionName/test12_original.mp4","add_item_to_collection":true,"file_path_collection_name_position":4}'

item_create_with_proxy_using_storage_file_paths

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_create_with_proxy_using_storage_file_paths --method-arguments '{"storage_id":"VX-1","original_file_path":"test_original.mp4","lowres_file_path":"test_lowres.mp4"}'

item_annotation_create

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_annotation_create --method-arguments '{"item_id":"VX-1","inpoint":"00:00:00:00","outpoint":"00:00:00:01","title":"SomeTitle"}'

item_annotation_get

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name item_annotation_get --method-arguments '{"item_id":"VX-1"}'

storage_file_create_extended

Uses Ruby Dir Glob Patterns for the dir argument

vidispine --host-address 127.0.0.1 --host-port 8080 --method-name storage_file_create_extended --method-arguments '{"storage_map":{"/srv/media1":"VX-1"}, "dir":"/srv/media1/SomeCollection", "state":"closed"}'

Vidispine API Utilities HTTP Server Executable bin/vidispine-utilities-http-server

Configuration

Create a Vidispine HTTP Server options files
vi /homefolderofuser/.options/vidispine-utilities-http-server

Usage

Usage:
    vidispine-utilities-http-server -h | --help
    vidispine-utilities-http-server [start stop restart status]

Options:
        --vidispine-http-host-address HOSTADDRESS
                                     The address of the server to communicate with.
                                      default: localhost
        --vidispine-http-host-port HOSTPORT
                                     The port to use when communicating with the server.
                                      default: 8080
        --vidispine-username USERNAME
                                     The account username to authenticate with.
                                      default: admin
        --vidispine-password PASSWORD
                                     The account password to authenticate with.
                                      default: password
        --storage-path-map MAP       A path=>storage-id mapping to match incoming file paths to storages.
        --relative-file-path-collection-name-position NUM
                                     The relative position from the storage base path in which to select the collection name.
                                      default: 0
        --metadata-file-path-field-id ID
                                     The Id of the metadata field where the file path is to be stored.
        --port PORT                  The port to bind to.
                                      default: 4567
        --log-to FILENAME            Log file location.
                                      default: STDERR
        --log-level LEVEL            Logging level. Available Options: info, fatal, error, warn, debug
                                      default: error
        --[no-]options-file [FILENAME]
                                     Path to a file which contains default command line arguments.
                                      default: /homefolderofuser/.options/vidispine-utilities-http-server
    -h, --help                       Display this message.

SOME EXAMPLE

vidispine-utilities-http-server --storage-path-map '{"/Volumes/storages/media1":"VX-1"}' --metadata-file-path-field-id 'portal_mf48881'

Contributing

  1. Fork it ( https://github.com/XPlatform-Consulting/vidispine.git )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request