Skip to content

Instantly share code, notes, and snippets.

@azaroth42
Last active October 15, 2016 00:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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"
}
}
}
@azaroth42
Copy link
Author

azaroth42 commented Oct 14, 2016

Notes:

  • id and type to follow the 3.0 convention of dropping the @ sign
  • rights instead of license to follow the 3.0 change
  • No top level height, width or duration to as the information is repeated in the sizes block.
  • Media types in formats could have a codec parameter, e.g. video/mp4; codecs="avc1.4D401E, mp4a.40.2"

Questions:

  • Do we need protocol? I don't think so as it's to distinguish from non IIIF JSON formats, ala OpenSeadragon?
  • Is "type": "Video" useful? Perhaps if we have the same structure for Audio? (And backport to Image?)
    • But is it a Video, or a Service? Modeling question to be answered.

@azaroth42
Copy link
Author

Issues:

  • formats is the full media type, which is different from the formats in Image's info.json, which are the strings to put in the format slot of the URL. The link to the media type is done at the specification level. It seems like here we need both.

@zimeon
Copy link

zimeon commented Oct 14, 2016

re: protocol & type -- perhaps one or the other? If we have separate specs for a and v then a .../video/ protocol would say type=video

@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