Skip to content

Instantly share code, notes, and snippets.

@azaroth42
Last active October 15, 2016 00:34
Show Gist options
  • Save azaroth42/c850a409edc512be5465d15c3a2562ee to your computer and use it in GitHub Desktop.
Save azaroth42/c850a409edc512be5465d15c3a2562ee to your computer and use it in GitHub Desktop.
Ultra simple AV info.json
{
"@context": "http://iiif.io/api/av/0/context.json",
"id": "https://iiif-staging02.lib.ncsu.edu/iiifv/pets",
"profile": "http://iiif.io/api/av/0/level1.json",
"attribution": "Provided by NCSU",
"logo": "http://ncsu.edu/logo.png",
"rights": "http://creativecommons.org/4.0/cc-by/",
"sizes": [
{"width": 720, "height": 480, "duration": 35.6, "formats": ["video/mp4", "video/webm"]},
{"width": 360, "height": 240, "duration": 35.6, "formats": ["video/mp4"]}
],
"thumbnail": {
"id": "https://iiif-staging02.lib.ncsu.edu/iiifv/pets/2/full/full/0/default.jpg",
"type": "Image",
"format": "image/jpeg",
"width": 360,
"height": 240,
"service": {
"@context": "http://iiif.io/api/image/2/context.json",
"id": "https://iiif-staging02.lib.ncsu.edu/iiifv/pets",
"profile": "http://iiif.io/api/image/2/level2.json"
}
}
}
@jronallo
Copy link

Is size the only relevant way that versions of a video might differ? So we know that we can get frames for MP4 but that WebM doesn't really work that way. If we want to include frames or attributes other than size that will different across different types of video, sizes seems like it could get messy. For instance even the duration of a video can differ slightly just using ffmpeg while scaling down the height and width of the video with no intention of changing the duration. I've used sources as it maps to the media element source tag. I've included both the format (really file extension) as well as the content type (which could also include codecs).

sources": [
    {
        "width": 720,
        "height": 480,
        "duration": "35.627000",
        "type": "video/webm",
        "format": "webm",
        "size": "3360808"
    },
    {
        "width": 720,
        "height": 480,
        "duration": "35.627000",
        "type": "video/mp4",
        "format": "mp4",
        "size": "2924836",
        "frames": "1067"
    },
    {
        "width": 360,
        "height": 240,
        "duration": "35.648000",
        "type": "video/mp4",
        "format": "mp4",
        "size": "1075972",
        "frames": "1067"
    }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment