{"id":19592020,"url":"https://github.com/catalyst/moodle-local_smartmedia","last_synced_at":"2025-07-29T16:05:00.010Z","repository":{"id":35086419,"uuid":"183058881","full_name":"catalyst/moodle-local_smartmedia","owner":"catalyst","description":"Moodle LMS Smartmedia local plugin","archived":false,"fork":false,"pushed_at":"2023-08-31T00:32:06.000Z","size":2058,"stargazers_count":7,"open_issues_count":50,"forks_count":5,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-05T00:51:12.326Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catalyst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-23T16:54:44.000Z","updated_at":"2024-11-07T11:16:22.000Z","dependencies_parsed_at":"2024-11-11T08:44:37.065Z","dependency_job_id":null,"html_url":"https://github.com/catalyst/moodle-local_smartmedia","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-local_smartmedia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-local_smartmedia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-local_smartmedia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-local_smartmedia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catalyst","download_url":"https://codeload.github.com/catalyst/moodle-local_smartmedia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251154674,"owners_count":21544539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T08:32:35.823Z","updated_at":"2025-04-27T14:33:34.831Z","avatar_url":"https://github.com/catalyst.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/catalyst/moodle-local_smartmedia.svg?branch=master)](https://travis-ci.org/catalyst/moodle-local_smartmedia)\n\n# Smart Media #\n\nSmart media aims to enhance Moodle's processing and delivery of multimedia while simplifying the process of managing multimedia for teachers and students.\n\nThe smart media plugins in Moodle aim to solve the following two user stories:\n\n\u003e As a teacher I have a video that works on my local device and I want to make that video available to my students in a suitable format, by adding it to any rich text area in Moodle. Without the need for me to do any other operations on the video apart from uploading to Moodle.\n\n\u003e As a student I want to be able to view any video on my chosen device; added to a rich text area in Moodle by a teacher. Regardless of the environment I’m accessing the video or my bandwidth limitations.\n\nSmart media leverages cloud services provided through Amazon Web Services (AWS) in order to conduct video transcoding into required formats and provide additional analytics functionality for multimedia.\n\nThe following sections outline how to install the required smart media plugins in Moodle. For advanced setup and plugin usage once the plugins have been installed please see the [project wiki](https://github.com/catalyst/moodle-local_smartmedia/wiki).\n\n## Supported Moodle Versions\nThis plugin currently supports Moodle:\n\n* 3.9\n\n**Note:** The high version of Moodle required is due to internal Moodle API's that this plugin depends on where only introduced in Moodle 3.9. If you want to use smart media in earlier Moodle versions please contact [Catalyst IT](https://www.catalyst-au.net/) for commercial support.\n\n## Plugin Installation ##\nThere are several dependencies required and steps to complete in order to setup smart media in your Moodle instance.\n\n**Note:** These instructions assume knowledge of Git, Moodle plugin functionality and that you have access to the infrastructure that runs your Moodle instance.\n\n1. Install dependency plugin local_aws. See [local_aws](#local_aws)\n2. Clone the *local_smartmedia* plugin git repo into your Moodle codebase root `git clone git@github.com:catalyst/moodle-local_smartmedia.git local/smartmedia`\n3. Install dependency plugin filter_smartmedia. See [filter_smartmedia](#filter_smartmedia)\n4. Install dependency binary FFmpeg on your Moodle server. See [FFmpeg](#ffmpeg)\n5. Setup the AWS Stack. See [AWS Stack Setup](#aws-stack-setup)\n6. Update plugin settings. See [Plugin Settings](#plugin-settings)\n\n### local_aws\n\nThe local_aws plugin is a dependency for local_smartmedia, it provides the AWS PHP SDK that is required in order for Moodle to utilise AWS cloud services.\n\nYou can download this from the Moodle plugin library at \u003chttps://moodle.org/plugins/local_aws\u003e\n\nYou can install this by cloning the git repo into your Moodle codebase:\n```bash\ngit clone https://github.com/catalyst/moodle-local_aws local/aws\n```\n\nMore detailed information is available at \u003chttps://github.com/catalyst/moodle-local_aws\u003e in the README\n\n### filter_smartmedia\n\nThe filter_smartmedia plugin is a dependency for local_smartmedia, it provides rendering of converted smart media assets in the Moodle UI.\n\nYou can install this by cloning the git repo into your Moodle codebase:\n```bash\ngit clone https://github.com/catalyst/moodle-filter_smartmedia filter/smartmedia\n```\n\nMore detailed information is available at \u003chttps://github.com/catalyst/moodle-filter_smartmedia\u003e in the README\n\n### FFmpeg\n\nFFmpeg is an open source multimedia framework and provides the multimedia stream analyser `ffprobe`, facilitating the collection of metadata for multimedia.\n\nThis metadata is utilised to identify which files in your Moodle instance to convert and to present reports on what media is actually in your Moodle instance.\n\nFFmpeg is a requirement for running the local/smartmedia scheduled tasks.\n\nTo install FFmpeg, if your using a Debian based Linux distribution:\n```bash\nsudo apt-get update\nsudo apt install ffmpeg\n```\nFor Windows based or any other servers follow the instructions and link at \u003chttps://ffmpeg.org/download.html\u003e\n\nYou can get more info about FFmpeg at \u003chttps://ffmpeg.org/\u003e\n\n### AWS Stack Setup\nThe following steps will setup the Amazon Web Services (AWS) infrastructure. The AWS infrastructure is required to do the actual processing of multimedia files. While setting up the AWS infrastructure is largely automated by scripts included in this plugin, a working knowledge of AWS is highly recommended.\n\nFor more information on how the submitted files are processed in AWS please refer to the topic: [Conversion Architecture](#conversion-architecture)\n\n**Note:** Full support on setting up an AWS account and API access keys for AWS stack infrastructure provisioning is beyond the scope of this guide.\n\n**Note:** This plugin currently does not support multiple Moodle's sharing Smartmedia Infrastructure. The AWS stack setup must be performed on an environment by environment basis, with a unique stack per environment.\n\nTo setup the AWS conversion stack infrastructure:\n\n1. Create an AWS account, see: `https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/` for information on how to do this.\n2. Create an AWS API user with administrator access and generate a API Key ID and a API Secret Key, see: `https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html` for information on how to do this.\n3. Change to your Moodle instance application directory. e.g. `cd /var/www/moodle`\n4. Run the provisioning script below, replacing `\u003ckeyid\u003e` and `\u003csecretkey\u003e` With the AWS API Key ID and AWS API Secret Key that you obtained in step 2. \u003cbr/\u003e Replace `\u003cregion\u003e` with the AWS region you wish to set up your AWS stack, e.g. `ap-southeast-2`. \u003cbr/\u003e The command to execute is:\n\n```console\nsudo -u www-data php local/smartmedia/cli/provision.php \\\n--keyid=\u003ckeyid\u003e \\\n--secret=\u003csecretkey\u003e \\\n--region=\u003cregion\u003e \\\n```\n**Note:** the user may be different to www-data on your system.\n\nThe script will return output similar to, the following:\n\n```console\n    \n== Creating resource S3 Bucket ==\nCreated resource bucket, at location http://smr1565939869-resource.s3.amazonaws.com/\n\n== Uploading Lambda function archives to resource S3 bucket ==\nLambda archive uploaded sucessfully to: https://smr1565939869-resource.s3.ap-southeast-2.amazonaws.com/lambda_ai_trigger.zip\n\nLambda archive uploaded sucessfully to: https://smr1565939869-resource.s3.ap-southeast-2.amazonaws.com/lambda_rekognition_complete.zip\n\nLambda archive uploaded sucessfully to: https://smr1565939869-resource.s3.ap-southeast-2.amazonaws.com/lambda_resource_transcoder.zip\n\nLambda archive uploaded sucessfully to: https://smr1565939869-resource.s3.ap-southeast-2.amazonaws.com/lambda_transcoder_trigger.zip\n\nLambda archive uploaded sucessfully to: https://smr1565939869-resource.s3.ap-southeast-2.amazonaws.com/lambda_transcribe_complete.zip\n\n== Provisioning the Lambda function to provide a custom cloudformation resource provider ==\nStack status: CREATE_IN_PROGRESS\nStack status: CREATE_COMPLETE\nCloudformation custom resource stack created. Stack ID is: arn:aws:cloudformation:ap-southeast-2:693620471840:stack/smr1565939869/f5f297c0-bff5-11e9-86c0-0290a6e588aa\n\nLambda Resource ARN: arn:aws:lambda:ap-southeast-2:693620471840:function:smr1565939869_transcoder_resource\n== Provisioning the smart media stack resources ==\nStack status: CREATE_IN_PROGRESS\nStack status: CREATE_COMPLETE\nCloudformation stack created. Stack ID is: arn:aws:cloudformation:ap-southeast-2:693620471840:stack/smt1565939869/1a1e1570-bff6-11e9-b220-02a73bda2f36\n\nUpdating Lambda transcode funciton enivronment variables.\nEnvironment variables updated\n\nUpdating Lambda transcode funciton enivronment variables.\nEnvironment variables updated\n\n== Provisioning the smart media stack resources ==\nSmart media S3 user access key: AKIA2C8YAPAQEWV347IT\nSmart media S3 user secret key: uBdLPiBwHj+ANmYP+bpzNx5zCEqjpktjFON/NsAG\nInput bucket: smt1565939869-input\nOutput bucket: smt1565939869-output\n\n```\n\nRecord the ouput from the resources section of the script information.\n\n### Plugin Settings\n\nOnce the dependency plugins are installed, the local/smartmedia plugin is installed, ffmpeg is installed and the AWS stack has been setup; it is now time to configure Moodle.\n\nTo do this:\n\n1. Log into the Moodle UI as a site administrator\n2. Navigate to `Site Administration \u003e Plugins \u003e Local plugins \u003e Smart Media`.\n3. Set all required fields. All of these with the exception of the FFProbe path will be gained from the output of the AWS stack provision script.\n4. All other settings can be left as their defaults\n5. Click `save changes`.\n6. Navigate to `Site Administration \u003e Plugins \u003e Filters \u003e Manage Filters`.\n7. Enable the `Smart media` filter\n8. Move the `Smart media` filter to be higher in priority (before) the `Multimedia` fitler in the list of filters.\n\n## Testing Smartmedia Conversion\nThe following sections outline testing of the Smartmedia plugin from the CLI. Testing from the CLI is a good debugging technique, that verifies that the AWS architecture is setup correctly. It does not depend on Moodle or the configured plugin settings.\n\n### Conversion test script\nOnce the AWS architecture has been setup using the provisioning script, it can be tested from the command line.\n\nThe following test command runs a basic conversion in AWS and returns the result status. To run the script:\n\n1. Change to your Moodle instance application directory. e.g. `cd /var/www/moodle`\n2. Run the following command, replacing `\u003ckeyid\u003e` and `\u003csecretkey\u003e` With the AWS API Key ID and AWS API Secret Key that you obtained in the AWS Stack Setup. \u003cbr/\u003e Replace `\u003cregion\u003e` with the AWS region from the  AWS stack set, e.g. `ap-southeast-2`. \u003cbr/\u003e Replace `\u003cinputbucket\u003e` and `\u003coutputbucket\u003e` with the buckets from the setup. \u003cbr/\u003e Finally enter the path to the file wish to process.:\n\n```console\nsudo -u www-data php local/smartmedia/cli/test.php \\\n--keyid=\u003ckeyid\u003e \\\n--secret=\u003csecretkey\u003e \\\n--region=\u003cregion\u003e \\\n--input-bucket=\u003cinputbucket\u003e \\\n--output-bucket=\u003coutputbucket\u003e \\\n--file='/var/www/moodle/local/smartmedia/tests/fixtures/SampleVideo1mb.mp4'\n```\n\n**Note:** the user may be different to www-data on your system.\n\n## Additional Information\nThe following sections provide an overview of some additional topics for this plugin and it's associated AWS architecture.\n\nFor advanced setup and plugin usage once the plugins have been installed please see the [project wiki](https://github.com/catalyst/moodle-local_smartmedia/wiki).\n\n### Conversion Architecture\nThe below image shows the high level architecture the plugin provisioning process sets up in AWS.\n\n![Conversion Architecture](/pix/SmartMediaAWSArch.png?raw=true)\n\n## License ##\n\n2019 Catalyst IT Australia\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU General Public License as published by the Free Software\nFoundation, either version 3 of the License, or (at your option) any later\nversion.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE.  See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with\nthis program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n\nThis plugin was developed by Catalyst IT Australia:\n\nhttps://www.catalyst-au.net/\n\n\u003cimg alt=\"Catalyst IT\" src=\"https://raw.githubusercontent.com/catalyst/moodle-local_smartmedia/master/pix/catalyst-logo.svg?sanitize=true\" width=\"400\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalyst%2Fmoodle-local_smartmedia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatalyst%2Fmoodle-local_smartmedia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalyst%2Fmoodle-local_smartmedia/lists"}