Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
Found this content helpful? Log in or sign up to leave a like!
Is there a way to work out the total file size of a course including any videos that have been added through Studio?
This doesn't need to include any files uploaded by students.
I can get the 'files uploaded to course' size but this doesn't include any videos. When I'm in Studio for the course, I can't see any options to do with file size.
All I can think of is counting videos in the Course Studio and working out a rough size per video and multiplying them. This would take ages and not be very accurate.
Any ideas are greatly appreciated. Thanks
Solved! Go to Solution.
I've got a little more time now to dig into things.
What you want can be obtained through the Public API. There's a link at the top about how to integrate it with their OAuth.
I gave the link to the Public API documentation on Canvas' site, but if you take your Canvas Studio URL (something like <instance>.instructuremedia.com) and add /api/public/docs/ to the end of it, you will get one for your specific instance. In theory, there's an authorize button that allows you to try things out.
I was originally concerned whether to use the Public or private (Arconaut's API). Their public API documentation doesn't show the size being returned, but when I tested it, the size was there.
Looking at the size of videos is misleading. There may be multiple transcodings of the videos (high, medium, low quality). The size, mixed with sharing between different courses (but only stored once), throws off the notion of traditional storage.
Here's a general workflow to get the original upload size for all videos within a course. When I say <instance>, I'm talking about xxx.instructuremedia.com, where xxx is your Canvas instance. For us, our Canvas instance is richland.instructure.com so our Canvas Studio instance is richland.instructuremedia.com.
Start by getting the collection ID using the get courses endpoint. The {course_id} is your Canvas course ID. In my example, the Canvas course ID is 3903130. It tells me my collection ID is 24709.
GET <instance>/api/public/v1/courses/3903130
{
"course": {
"id": 24709,
"name": "MATH 113 - Stats (SP24)",
"type": "course_wide",
"created_at": "2023-12-08T00:45:26Z",
"course_id": 3903130,
"owner": null
}
}
Now that I know the collection ID, I can list the media in a collection. The {collection_id} is the the ID that you just obtained from the course request. This will return an array of media in the course. It is most likely going to be paginated and have a maximum per_page=50. If you try more than 50, you will get erroneous results in the metadata.
GET <instance>/api/public/v1/collections/24709/media
{
"media": [
{
"id": 42563,
"title": "Intro to Data Prezi",
"description": "this Prezi introduces the topic of data.",
"duration": 333.927,
"created_at": "2020-08-10T20:19:10Z",
"thumbnail_url": "<truncated>/thumbnail?width=540&height=320",
"transcoding_status": "transcoding_finished",
"size": 36648249,
"source": "upload",
"owner": {
"id": 168,
"full_name": "James Jones",
"display_name": "James Jones",
"email": "james@richland.edu"
}
},
],
"meta": {
"current_page": 1,
"last_page": 13,
"total_count": 241
}
}
There were 19 other media on that page that I truncated for space purposes. The metadata at the bottom tells me there are 241 videos total with 12 more pages to go through. They pagination uses page and per_page parameters.
What you're looking for is the size property. Here it's 36648249 bytes (36MB). Also note that the source is "upload" and that lets me know it's an actual upload as opposed to a linked YouTube video.
Now you just need to iterate through all of the pages and get the information.
You really need to watch throttling with the Canvas Studio API. If you make the requests too quickly, you can get blocked. Unlike the Canvas REST API where you start with x-rate-limit-remaining at 700 and can basically make requests as fast as you want as long as you let one finish before starting the next, that is not true with Canvas Studio API. There is no x-rate-limit-remaining in the response headers, just an x-runtime. I've done more exploring with the old (now unpublished) Arconauts API and it started at 70 (I think) and would drop quickly.
In practice, I've found that sustained requests to the API should not exceed 1 request per second. Anything faster than that and it eventually runs out. For small requests, you might be able to exceed that. It is far more sensitive to throttling than the Canvas REST API.
@RichC Studio is a separate application, a first party LTI from Instructure. Its storage space is separate. Studio videos don't show up in Files areas in Canvas and don't count against quotas.
I'm curious about your purpose in calculating the total size of files that are associated with a Canvas course in any way.
Hi @stimme, I work for a charity and user licenses are a huge cost for us. We aren't too keen to pay for an extra 5000 users. So we are investigating ways to save money by reducing the number of users in Canvas. An idea was to turn one of our popular courses into a bunch of web pages that are outside of the VLE, the videos could be hosted on another platform.
That why I was interested in video file size, to know how much storage we'd use and also to give us an idea of how long it would take to transfer any content.
Hi @RichC ...
In addition to the response from @stimme, I'll add that your Canvas administrator (if you are not one yourself) can run a report to get an idea of the total storage size of a course (excluding Studio because of what @stimme has mentioned). The "Course Storage" report can be run following the instructions in this Guide: How do I view reports for an account?.
In addition, there are some tools available within the Studio interface for Canvas administrators. Here are some Guides for that:
I hope this additional information will be helpful to you in some way.
Hi @Chris_Hofer
Studio Admin hadn't been enabled on our system before, so that has given me some more options. Thanks for the guides too.
I can now see the total number of videos in a course but no way to see what that file size is. Any ideas?
Thanks
@RichC ...
Unfortunately, I don't have any other suggestions for you. Sorry about that, Rich.
I only have time for a quick response.
Studio videos have been organized more by library than by course as a single video might be used in multiple courses, especially if you copy a Canvas course and reuse it.
What I do to get this information is use the Canvas Studio API. It can get your a list of videos and information about each one. What I cannot remember right now is whether I use the Public API or their private one that they used to use but removed the documentation -- but it still mostly works.
I've got a little more time now to dig into things.
What you want can be obtained through the Public API. There's a link at the top about how to integrate it with their OAuth.
I gave the link to the Public API documentation on Canvas' site, but if you take your Canvas Studio URL (something like <instance>.instructuremedia.com) and add /api/public/docs/ to the end of it, you will get one for your specific instance. In theory, there's an authorize button that allows you to try things out.
I was originally concerned whether to use the Public or private (Arconaut's API). Their public API documentation doesn't show the size being returned, but when I tested it, the size was there.
Looking at the size of videos is misleading. There may be multiple transcodings of the videos (high, medium, low quality). The size, mixed with sharing between different courses (but only stored once), throws off the notion of traditional storage.
Here's a general workflow to get the original upload size for all videos within a course. When I say <instance>, I'm talking about xxx.instructuremedia.com, where xxx is your Canvas instance. For us, our Canvas instance is richland.instructure.com so our Canvas Studio instance is richland.instructuremedia.com.
Start by getting the collection ID using the get courses endpoint. The {course_id} is your Canvas course ID. In my example, the Canvas course ID is 3903130. It tells me my collection ID is 24709.
GET <instance>/api/public/v1/courses/3903130
{
"course": {
"id": 24709,
"name": "MATH 113 - Stats (SP24)",
"type": "course_wide",
"created_at": "2023-12-08T00:45:26Z",
"course_id": 3903130,
"owner": null
}
}
Now that I know the collection ID, I can list the media in a collection. The {collection_id} is the the ID that you just obtained from the course request. This will return an array of media in the course. It is most likely going to be paginated and have a maximum per_page=50. If you try more than 50, you will get erroneous results in the metadata.
GET <instance>/api/public/v1/collections/24709/media
{
"media": [
{
"id": 42563,
"title": "Intro to Data Prezi",
"description": "this Prezi introduces the topic of data.",
"duration": 333.927,
"created_at": "2020-08-10T20:19:10Z",
"thumbnail_url": "<truncated>/thumbnail?width=540&height=320",
"transcoding_status": "transcoding_finished",
"size": 36648249,
"source": "upload",
"owner": {
"id": 168,
"full_name": "James Jones",
"display_name": "James Jones",
"email": "james@richland.edu"
}
},
],
"meta": {
"current_page": 1,
"last_page": 13,
"total_count": 241
}
}
There were 19 other media on that page that I truncated for space purposes. The metadata at the bottom tells me there are 241 videos total with 12 more pages to go through. They pagination uses page and per_page parameters.
What you're looking for is the size property. Here it's 36648249 bytes (36MB). Also note that the source is "upload" and that lets me know it's an actual upload as opposed to a linked YouTube video.
Now you just need to iterate through all of the pages and get the information.
You really need to watch throttling with the Canvas Studio API. If you make the requests too quickly, you can get blocked. Unlike the Canvas REST API where you start with x-rate-limit-remaining at 700 and can basically make requests as fast as you want as long as you let one finish before starting the next, that is not true with Canvas Studio API. There is no x-rate-limit-remaining in the response headers, just an x-runtime. I've done more exploring with the old (now unpublished) Arconauts API and it started at 70 (I think) and would drop quickly.
In practice, I've found that sustained requests to the API should not exceed 1 request per second. Anything faster than that and it eventually runs out. For small requests, you might be able to exceed that. It is far more sensitive to throttling than the Canvas REST API.
Sorry for my late reply,
Wow, thanks for the detailed answer @James This has saved me a lot of time on trial and error on the API!
Thank you.
To participate in the Instructure Community, you need to sign up or log in:
Sign In