Asset enrichment
Last updated
Last updated
The Job is responsible for managing image and video media files that are associated with uploaded or created content. Whenever an asset or media file is uploaded as part of the content, a corresponding event is generated and inserted into Kafka, which then triggers the 'asset-enrichment' job.
For image media files, the Job performs image enrichment by resizing the images to achieve an optimal DPI (dots per inch). Additionally, three different image variants are generated, each with low, medium, and high resolutions. These variants are then stored in the cloud, making them readily available for different use cases and devices.
Regarding video media files, the Job handles video enrichment, which includes fetching video metadata and generating a thumbnail for the video. Furthermore, it triggers the 'video-stream-generator' job, which is responsible for creating a streamable source for the video. This streamable source allows users to efficiently stream and access the video content.
Overall, the Job plays a crucial role in enhancing the content by enriching the associated image and video media files. The image enrichment process ensures optimal resizing and the availability of multiple resolution variants, while the video enrichment process provides valuable features such as video metadata, thumbnails, and streamable sources, contributing to an improved user experience and content accessibility.
During the deployment process, the configuration for all knowledge-platform-jobs is sourced from the sunbird-learning-platform repository. On the other hand, for local setups, the configuration is taken from the respective job folders within the knowledge-platform-jobs repository.
Kafka Topic:
Job configuration variables:
Sample Kafka event:
Dependency: Jobs: 'video-stream-generator' . External Software: imagemagick
Variable | Purpose |
---|---|
content.stream.enabled
Used to enable or disable video stream generation for the uploaded video asset.
Default value: false
content.strem.mimeType
Used to identify streamable mimeTypes.
Default value: ["video/mp4"]
content.youtube.applicationName
Used as credential for youtube client creation in YouTubeUtil.scala file. Default value: "fetch-youtube-license"
content.youtube.regexPattern
Used to extract youtube media Id by identifying youtube url pattern using regex.
Default value: ["\?vi?=([^&])", "watch\?.v=([^&])", "(?:embed|vi?)/([^/?])", "^([A-Za-z0-9\-\_]*)"]
content.upload.context.driven
Default value: true
content.max.iteration.count
Used to indicate number of times the event is to be attempted for publishing till it is processed successfully.
Default value: 2
thumbnail.max.sample
Default value: 5
thumbnail.max.size.pixel
Default value: 150