Reducir la API responde con el filtrado disperso
Si el API es demasiada información, puede limitar los datos que desea obtener mediante el filtrado disperso. Para el filtrado disperso tiene dos campos que le ayudarán con esto:
- "include=", describirá qué categorías de la JSON deben incluirse. Puede especificar varias rutas separadas por comas.
- "field[]=," describirá qué valores deben incluirse de esa categoría específica. Puede tener múltiples definiciones de campo para especificar diferentes valores para cada categoría.
Ejemplo: Desea saber si un determinado Destino de salida de grabación de archivos está grabando actualmente o no. En este caso nos interesa el valor "live-state" de la categoría "attributes" en la categoría raíz "data". Esto significa que tenemos que especificar la ruta de la categoría de inclusión como "datos.atributos". La categoría "atributos" contiene múltiples valores pero sólo queremos ver el "live-state" en las respuestas por eso lo acotamos mediante el "fields[attributes]=live-state"
Esto compone el siguiente comando curl: (¡Por favor, asegúrese de sustituir las y por sus propios valores!)
curl "http://192.168.0.107:8989/api/v1/documents//output-destinations/?include=data.attributes&fields[attributes]=live-state"
Las respuestas tendrán este aspecto:
{"data":{"attributes":{"live-state":"preview"}}}
Documentos
El tipo "documentos" corresponde al objeto documento que mimoLive escribe en disco como archivos ".tvshow".
{
// Unique Identifier of the document
"id": String,
// Always "documents" (see the JSON-API documentation for more information on this field)
"type": "documents",
// See the JSON:API specification for more information on this field
"relationships": {
// The layer contained in the document
"layers": Relationship,
// The sources used by the document
"sources": Relationship,
// The output destinations used by this document
"output-destinations": Relationship
},
// The link to the resource itself (see the JSON:API specification for more information on this field)
"links": Object,
// This is probably the data you are after
"attributes": {
// The name of the document
"name": String,
// Metatdata of the document
"metadata": {
// Comments as entered in the show metadata panel in mimoLive
"comments": String,
// The height of the document in pixels
"height": Integer,
// The width of the document in pixels
"width": Integer,
// The author of the document as entered in the show metadata panel in mimoLive
"author": String,
// The title of the show as entered in the show metadata panel in mimoLive
"title": String,
// The proposed show length (timer) as entered in the show metadata panel inmimoLive (in seconds)
"duration": Integer,
// The framerate of the document in frames per second
"framerate": Float,
// The generic show name as entered in the show metadata panel in mimoLive
"show": String,
// The audio samplerate of the document in hz
"samplerate": Integer
},
// The live state of the document/show (see LiveState for possible values and their meaning)
"live-state": LiveState,
// If the show is currently live, the current length of the show in seconds
"duration": Integer,
// If the show is currently live, timestamp when the show went live (can be used together with "metadata.duration" and "duration" to compute a countdown)
"show-start": Integer
}
}
Capas
El tipo "capas" representa las capas que se utilizan en el proceso de renderizado para generar la salida de vídeo de mimoLive.
{
// Unique identifier of the layer
"id": String,
// Always "layers" (see the JSON-API documentation for more information on this field)
"type": "layers",
// See the JSON:API specification for more information on this field
"relationships": {
// The document this layer is part of
"document": Relationship,
// All the layer variants for this layer
"variants": Relationship,
// The variant that is currently live (null otherwise)
"live-variant": Relationship,
// The variant that is active/selected for that layer
"active-variant": Relationship
},
// The link to the resource itself (see the JSON:API specification for more information on this field)
"links": Object,
// Attributes of the layer (this is probably the data you are after)
"attributes": {
// The composition identifier for the layer, this can be used to differentiate the various layer types
"composition-id": String,
// The live state of the layer (see LiveState for possible values and their meaning)
"live-state": LiveState,
// The name of the layer as displayed in the mimoLive layer stack
"name": String,
// The user-controlled volume of the layer, as seen in the layer stack
// where 0.0 means silence and 1.0 is full volume.
// If the layer has no volume control, the value is null.
"volume": Float | null,
// The inputs used for the layer (composition). The keys come directly from the underlying QuartzComposition. Check out the custom layer protocol for more information on the key names and their meaning. The layer reports the "input-values" from either "live-variant" or the "active-variant" if the layer is not live.
"input-values": Object,
// Description object for each of the keys returned in "input-values"
"input-descriptions": {
(String): {
// Whether the input is currently hidden in the mimoLive user interface
"hidden": Bool,
// The type of the input ("string", "number", "index", "bool", "color", "image", "structure")
"type": String,
// If applicable: The minimum value the input accepts
"value-min": Float,
// If applicable: The maximum value the input accepts
"value-max": Float,
// For dropdowns a list of names for the individual values
"value-list": Array,
// By which ammount a value should be increased or decreased
"value-step": Float,
// String that declares in which unit the value is (eg. "°C")
"value-unit": String,
// Label that is shown next to the input
"label": String,
// The index of the input (for sorting)
"index": Integer
}
},
// Outputs from the last render cycle that were returned from QuartzComposer, including the original keys
"output-values": Object,
// The index of the layer in the layer stack (zero relates to the top of the stack)
"index": Integer
}
}
*El atributo "volumen" se ha añadido en mimoLive 5.2.
Variantes
El tipo "variantes" modela una instancia de la configuración de una capa. La mayoría de las capas sólo tendrán una variante, pero para algunas capas (por ejemplo, Lower Thirds), es habitual tener múltiples variantes con diferentes contenidos de texto.
Las variantes comparten mucha información con el tipo "capas". De hecho, una capa actúa principalmente como un proxy de su variante activa en ese momento.
{
// Unique identifier of the variant
"id": String,
// Always "variants" (see the JSON-API documentation for more information on this field)
"type": "variants",
// See the JSON:API specification for more information on this field
"relationships": {
// The layer this variant belongs to
"layer": Relationship
},
// The link to the resource itself (see the JSON:API specification for more information on this field)
"links": Object,
// Attributes of the variant (this is probably the data you are after)
"attributes": {
// The live state of the variant (see LiveState for possible values and their meaning). If the layer is not live, the value will always be "off".
"live-state": LiveState,
// The name of the variant as displayed in the mimoLive layer stack
"name": String,
// The inputs used for the variant (composition). The keys come directly from the underlying QuartzComposition. Check out the custom layer protocol for more information on the key names and their meaning. The layer reports the "input-values" from either "live-variant" or the "active-variant" if the layer is not live.
"input-values": Object,
// Description object for each of the keys returned in "input-values"
"input-descriptions": {
(String): {
// Whether the input is currently hidden in the mimoLive user interface
"hidden": Bool,
// The type of the input ("string", "number", "index", "bool", "color", "image", "structure")
"type": String,
// If applicable: The minimum value the input accepts
"value-min": Float,
// If applicable: The maximum value the input accepts
"value-max": Float,
// For dropdowns a list of names for the individual values
"value-list": Array,
// By which ammount a value should be increased or decreased
"value-step": Float,
// String that declares in which unit the value is (eg. "°C")
"value-unit": String,
// Label that is shown next to the input
"label": String,
// The index of the input (for sorting)
"index": Integer
}
},
// Outputs from the last render cycle that were returned from QuartzComposer, including the original keys
"output-values": Object
}
}
Fuentes
El tipo "fuentes" modela las fuentes que se utilizan en capas, filtros y otras fuentes, proporcionando entradas de audio y vídeo a mimoLive.
{
// Unique identifier of the source
"id": String,
// Always "sources" (see the JSON-API documentation for more information
// on this field).
"type": "sources",
// See the JSON:API specification for more information on this field
"relationships": {
// The document this source is part of
"document": Relationship,
// The filters that process this source's video
"filters": Relationship
},
// The link to the resource itself (see the JSON:API specification for
// more information on this field).
"links": Object,
// Attributes of the variant (this is probably the data you are after)
"attributes": {
// The tally state of the source (see tally-state for possible values
// and their meaning)
"tally-state": TallyState,
// The name of the source as displayed in mimoLive
"name": String,
// Whether the source supplies video
"video": Bool,
// [optionally] If the associated video hardware is currently connected
// (Available since 5.5)
"video-device-connected": Bool,
// Whether the source supplies audio
"audio": Bool,
// [optionally] If the associated audio hardware is currently connected
// (Available since 5.5)
"audio-device-connected": Bool,
// Summary text of the source as displayed in mimoLive
"summary": String,
// The identifier of the composition if the source is based on a QuartzComposition
"composition-id": String,
// The gain that is applied to audio comming from this source, as
// controlled in the source settings view where 0.0 means silence,
// 1.0 is the default and 2.0 means doubled volume.
// Null if a source has no audio.
"gain": Float | null,
// The inputs used for the underlying composition (if it is a composition
// source). Check out the custom layer protocol for more information on
// the key names and their meaning.
"input-values": Object,
// Description object for each of the keys returned in "input-values"
"input-descriptions": {
(String): {
// Whether the input is currently hidden in the mimoLive window
"hidden": Bool,
// The type of the input ("string", "number", "index", "bool",
// "color", "image", "structure")
"type": String,
// If applicable: The minimum value the input accepts
"value-min": Float,
// If applicable: The maximum value the input accepts
"value-max": Float,
// For dropdowns a list of names for the individual values
"value-list": Array,
// By which ammount a value should be increased or decreased
"value-step": Float,
// String that declares in which unit the value is (eg. "°C")
"value-unit": String,
// Label that is shown next to the input
"label": String,
// The index of the input (for sorting)
"index": Integer
}
},
// Outputs from the last render cycle that were returned from
// QuartzComposer, including the original keys
"output-values": Object
}
}
*El atributo "gain" se ha añadido en mimoLive 5.2.
Filtros
El tipo "filtros" representa los filtros que se pueden asignar a las fuentes de vídeo para procesar el vídeo antes de utilizarlo en las capas.
{
// Unique identifier of the filter
"id": String,
// Always "filters" (see the JSON-API documentation for more information on this field)
"type": "filters",
// See the JSON:API specification for more information on this field.
"relationships": {
// The source that this filter belongs to
"source": Relationship
},
// The link to the resource itself (see the JSON:API specification for more information on this field)
"links": Object,
// Attributes of the variant (this is probably the data you are after)
"attributes": {
// The name of the filter as displayed in mimoLive
"name": String,
// The identifier of the filter's QuartzComposition
"composition-id": String,
// The inputs used for the underlying composition (if it is a composition source). Check out the custom layer protocol for more information on the key names and their meaning.
"input-values": Object,
// Description object for each of the keys returned in "input-values"
"input-descriptions": {
(String): {
// Whether the input is currently hidden in the mimoLive user interface
"hidden": Bool,
// The type of the input ("string", "number", "index", "bool", "color", "image", "structure")
"type": String,
// If applicable: The minimum value the input accepts
"value-min": Float,
// If applicable: The maximum value the input accepts
"value-max": Float,
// For dropdowns a list of names for the individual values
"value-list": Array,
// By which ammount a value should be increased or decreased
"value-step": Float,
// String that declares in which unit the value is (eg. "°C")
"value-unit": String,
// Label that is shown next to the input
"label": String,
// The index of the input (for sorting)
"index": Integer
}
},
// Outputs from the last render cycle that were returned from QuartzComposer, including the original keys
"output-values": Object
}
}
Destinos de salida
Disponible desde: mimoLive 4.2
El tipo "output-destinations" modela los diferentes destinos de salida que puede tener un espectáculo mimoLive, incluyendo grabación, streaming y más.
{
// Unique identifier of the output destination
"id": String,
// Always "output-destinations" (see the JSON-API documentation for more information on this field)
"type": "output-destinations",
// See the JSON:API specification for more information on this field
"relationships": {
// The document that this output destination belongs to
"document": Relationship
},
// The link to the resource itself (see the JSON:API specification for more information on this field)
"links": Object,
// Attributes of the variant (this is probably the data you are after)
"attributes": {
// The name of the output destination as displayed in mimoLive
"title": String,
/*
The concrete type of output destination:
- "File Recording"
- "Audio Aux"
- "Live Streaming"
- "Virtual Camera"
- "Fullscreen"
- "Blackmagic Design"
- "NDI®" (including the "®")
*/
"type": String,
// A summary containing the most important settings
"summary": String,
// Whether the output destination is properly configured
"ready-to-go-live": Bool,
// Whether the output destination is set to start when the mimoLive show starts
"starts-with-show": Bool,
// Whether the output destination is set to stop when the mimoLive show ends
"stops-with-show": Bool,
// Individual settings depending on the "type" of output destination (see below for reference)
"settings": Object,
// The current live state of the output destination (see below for how to interpret the values)
"live-state": LiveState
}
}
Ajustes individuales
Los diferentes tipos de destinos de salida tienen diferentes ajustes.
A continuación se muestran los diferentes tipos de objeto "ajustes". Para los tipos de destinos de salida que no aparezcan en la lista, el diccionario estará vacío.
{
// Path to the folder that will contain the recording. Can be set to "null" to reset to initial value ("~/Movies').
"location": String,
// Filename that will be given to the recording. See below for placeholder values. Can be set to "null" to reset to initial value ("%document %year-%month-%day %hour-%minute-%second.%extension").
"filename": String
}
{
// Available since: mimoLive 5.5:
// Ofuscated URL of the streaming endpoint.
"rtmpurl": String,
// Ofuscated steaming key.
"streamingkey": String,
// Public broadcast URL.
"publicurl": String
}
A pesar de que los valores "rtmpurl" y "streamingkey" están ofuscados, puede establecerlos mediante una petición PATCH.
Valores para el atributo "filename" de File Recording
Marcador de posición | Explicación |
---|---|
1TP3Documento | nombre del documento, incluida la extensión .tvshow (en función de la configuración del sistema del usuario) |
1TP8Cómo | nombre del espectáculo |
%extensión | mov, sin el prefijo . |
1TP4Año | Año de 4 dígitos, por ejemplo 2018 |
1TP4Mes | 2 dígitos del mes, por ejemplo 01 para enero |
y | Día de 2 cifras, por ejemplo 31 |
1TP4Hora | 2 dígitos de la hora (reloj de 24 horas), por ejemplo 15 |
%minuto | 2 dígitos minutos, por ejemplo 45 |
1TP2Segundo | 2 dígitos segundos, por ejemplo 50 |
Conjuntos de capas
Disponible desde: mimoLive 4.8
El tipo "conjuntos de capas" modela los conjuntos de capas que el usuario puede crear y gestionar en mimoLive.
{
// Unique identifier of the layer set
"id": String,
// Always "layer-sets" (see the JSON-API documentation for more information on this field)
"type": "layer-sets",
// See the JSON:API specification for more information on this field
"relationships": {
// The document that this layer set belongs to
"document": Relationship
},
// The link to the resource itself (see the JSON:API specification for more information on this field)
"links": Object,
"attributes": {
// The name of the layer set as displayed in mimoLive
"name": String,
// Wheter the layer stack currently matches the configuration represented by the layer set
"active": Bool
}
}
Estado vivo
El tipo "LiveState" representa el estado en el que puede encontrarse un documento, capa o variante. Los valores posibles son:
Valor | Explicación |
---|---|
fuera de | Capa: La capa está desactivada y no se renderizará. |
Documento: El programa no está en marcha. | |
Destino de salida: El destino de salida no puede activarse porque no está configurado correctamente. | |
en directo | Capa: La capa está viva y será renderizada, en una variante esto significa que la capa está viva y la variante está viva. |
Documento: El programa está en marcha. | |
Destino de salida: El destino de salida está activo y transmitiendo/grabando datos. | |
previsualizar | Capa: La capa se muestra en la columna de vista previa y es posible que se active en breve. |
Destino de salida: El destino de salida está listo para entrar en funcionamiento y a la espera de órdenes. | |
cierre | Capa: La capa está actualmente activa pero está en proceso de apagarse (por ejemplo, una transición saliente). |
inicio | Destino de salida: El destino de salida está en proceso de inicio (por ejemplo, conectándose a un servicio externo). |
TallyState
Un "TallyState" representa el estado en el que puede encontrarse una fuente. El grado de actividad está ordenado y sólo se informará del uso más alto. Los valores posibles (de menor a mayor) son:
Valor | Explicación |
---|---|
fuera de | La fuente no está actualmente en uso por mimoLive |
en uso | La fuente se está utilizando actualmente en algún lugar dentro de mimoLive |
efecto | La fuente se utiliza actualmente para ser renderizado en una vista previa de filtro |
previsualizar | La fuente se utiliza actualmente dentro de la salida de vista previa |
programa | La fuente se utiliza actualmente dentro de la salida del programa |