.. BrightCove module documentation file.
   
BrightCove Module
==========================================

   
Class Reference
------------------------------------------

.. automodule:: brightcove
   :members:

Configuration
------------------------------------------

The BrightCove module has a number of configuration options that will define
it's behavior. The BrightCove module will inherent the same configuration file
that `transmogrifier.py <cli/transmogrifier.py>`_ is provided at runtime; 
by default this file is located at ``/usr/local/etc/transmogrifier.conf``. 
This file can be usurped with a separate configuration file by 
providing ``transmogrifier.py`` with the ``--configFile=`` parameter. 

Options utilized by the BrightCove module are designated under the ``[BrightCove]`` 
config section, as seen in the transmogrifier.conf file shown below: ::

  [BrightCove]

  host=38.113.27.171
  username=demo
  password=mypassword
  publisherid=10001
  multiplebitrate=True


**host**
  Specify the server address for uploading your BrightCove content.

**username**
  Specify the username used for connecting to BrightCove servers.

**password**
  Specify the password used for connecting to BrightCove servers.
  
**publisherid**
  Specify your BrightCove publisher id.
  
**multiplebitrate**
  If multiple bit rate is set to ``True`` we will load only a single media
  file from the ``media`` suport directory. If set to ``False``, we will
  search for subdirectories in the media folder. These subdirectories should
  be named after the bitrate. For instance, a 1800kbps bitrate media file would
  be saved to a directory named 1800. A media output at 700kbps at half-rez 
  would be saved at the folder 700.5, quarter rez could be saved to 700.25.
  (this is a fairly old system, BrightCove handles single renditions much better
  now).
  
Example Usage
------------------------------------------
In the following example, we'll call the BrightCove with it's only action,
'upload'. In this example, we have ``multiplebitrate`` set to ``False``, and
we have setup FCS Copy responses to output 3 renditions of our file, a
1100kbps rendition at half rez, and 1500kbps and 3000kbps renditions at native
resolution. We have also configured and fired an XML response to output
an XML file, using the asset's title, 'myasset', to our support file at 
``/FCSSupport/BrightCove/xmlin/myasset.xml`` ::

  >>> transmogrifier.py -a upload -m BrightCove -t myasset
  DEBUG: Running older Codebase!
  DEBUG: Running for module: BrightCove validModules: BrightCove,YouTube,thePlatform
  BrightCove: Loading FCSXML from path: '/FCSSupport/BrightCove/xmlin/myasset.xml'
  BrightCove: Reporting to Final Cut Server: '/FCSSupport/fcsvr_xmlin/BrightCove_23456.xml'
  BrightCove: Multiple bitrate specified, searching sub directories
  BrightCove:    searching directory: /FCSSupport/BrightCove/media/1100
  BrightCove: readMediaFiles() adding file found at '/FCSSupport/BrightCove/media/1100/myasset.mov' with bitrate: '1100'
  BrightCove:    searching directory: /FCSSupport/BrightCove/media/1100.5
  BrightCove:    searching directory: /FCSSupport/BrightCove/media/1500
  BrightCove: readMediaFiles() adding file found at '/FCSSupport/BrightCove/media/1500/myasset.mov' with bitrate: '1500'
  BrightCove:    searching directory: /FCSSupport/BrightCove/media/3000
  BrightCove: readMediaFiles() adding file found at '/FCSSupport/BrightCove/media/3000/myasset.mov' with bitrate: '3000'

  BrightCove:    searching directory: /FCSSupport/BrightCove/media/stills
  BrightCove: upload() uplaoding file: 'myasset.mov' as '1100kbps_myasset.mov'
  BrightCove: upload() uplaoding file: 'myasset.mov' as '3000kbps_myasset.mov'
  BrightCove: upload() uplaoding file: 'myasset.mov' as '1500kbps_myasset.mov'
  BrightCove: upload() uplaoding file: 'manifest.xml'
  BrightCove: Successfully published assets to BrightCove.

This action will upload each of our renditions (in this particular case we provided
no stills for upload), had an asset named 'myasset.jpg' been present in the
stills folder, it would have been uploaded. 

After uploading our media files, we upload a BrightCove compliant XML file, 
``manifest.xml``
  
For more information about working with Transmogrifier modules, 
`click here <../../cli/transmogrifier.py.html#working-with-modules>`_