Digital Media

Digital Media

Digital Media Files

  • Consist of a container with metadata information
    • Dimensions of the display
    • Duration of the media
  • Can contain a number of tracks
    • Audio track
    • Video track
    • Subtitle track
  • Tracks are encoded by using a codec
    • Maximize quality
    • Minimize file size

Digital Media Containers

  • MP4
    • Uses the MPEG4 system container
    • Implemented by Quicktime and Adobe Flash
    • Wide support base spans many devices from phones to computers
    • Extensions: mp4, mov, m4v, m4a, m4b, m4p, f4v, 3gp, 3g2
    • Synonyms: MPEG4 Part 14, ISO/IEC 14496-14
  • WebM / Matroska
    • Similar to the MPEG4 system container
    • WebM uses a subset of Matroska to create a container optimized for web media and HTML5
    • Adobe plans to support WebM in the Flash player
    • Extensions: webm, mkv
  • AVI
    • Microsoft's generic container format
    • This can generally store anything and everything
    • It has excellent support on most computers
    • Extensions: avi
  • FLV
    • Adobe Flash media container
    • Useful for storing legacy Flash content
    • Excellent for low-latency live streaming
  • F4V
    • Adobe's new media format
    • A subset of the MPEG4 system container

Digital Video Codecs

  • H.264
    • Widely considered the best video codec
    • Used by YouTube
    • Synonyms: MPEG4 Part 10, MPEG4-AVC, AVC, ISO/IEC 14496-10
  • VP8
    • A new free video codec for digital media on the web
    • Comparable to H.264 in quality
    • From the WebM Project
  • MPEG4 Video
    • Last-generation video codec
    • Requires more file space than H.264 for the same quality, but encodes and decodes faster
    • Synonyms: DivX, Xvid, MPEG4-ASP, MPEG4 Part 2, ISO/IEC 14496-2,
  • MPEG2 Video
    • Generally used on DVDs
    • Now a few generations old
    • One of the official video codecs for Blu-ray
    • Synonyms: MPEG2 Part 2, ISO/IEC 13818-2
  • Flash Video
    • Sorenson H.263 for Flash
    • An older generation codec
    • Used before Flash supported H.264
    • Useful for low-power devices that cannot support H.264 or VP8

Internet Media Types

  • An identifier that enables the exchange of different kinds of media files on the Internet
  • Originally called MIME types
  • Sometimes referred to as Content-Types
  • Composed of at least two parts
    • A type
      • Types that begin with x- are not registered with IANA so are non-standard
    • A subtype
      • Subtypes that begin with x- are not registered with IANA so are non-standard
      • Subtypes that begin with vnd are vendor-specific
      • Subtypes that begin with prs are personal or vanity subtypes
    • One or more optional parameters
      • An example would be character encoding used for text subtypes

Sitecore Digital Media Guidelines

  • Sitecore assigns an .ashx (generic handler) extension to media stored in the Media Library
    • Indicates that the media should not be loaded directly from the file system
    • The request should be passed to Sitecore, even if the media is stored on the file system
  • Issues can occur from the .ashx extension for media stored in the Media Library
    • The web server may be unable to automatically determine the correct Content-Type
    • The browser may not be able to determine the MIME type on the client side
  • Use the MimeTypes.config file to define additional MIME types 
    • File is located in /<website root>/App_Config/MimeTypes.config
    • Add the required file extensions and their corresponding MIME type to the file
    • A MIME definition should only appear once in either the MimeTypes.config or web.config file
    • MIME definitions that appear in web.config are commented out in the MimeTypes.config
  • Use the web.config file to define MIME types and other configuration information
    • File is located in /<website root>/web.config
    • Path in web.config is <configuration>/<sitecore>/<mediaLibrary>/<mediaTypes>
    • Media configuration settings can be defined in <mediaTypes> section
      • MIME Type and file extension of the media
      • Whether to force download of the media item
      • The data template to use for storing the media item in the Media Library
      • Format of metadata stored with the media item
      • Type of validator to use to validate the media file
      • Prototype to use for the media item
      • Type to use for generating a thumbnail of the media for display in the Media Library
      • Dimensions for the thumbnail of the media
      • Background color for the thumbnail of the media
      • File extension for the thumbnail of the media
    • A set of common media file types is defined in Sitecore 6.5 web.config by default
      • audio - .mp3
      • documents - .doc, .docx, .pdf
      • images - .bmp, .gif, .jpeg, .jpg, .png
      • video - .swf
      • zip - .zip
  • Sitecore 6.5 does not include MIME definitions for the following file extensions so you should add them if you intend to display these video formats from media stored in the Media Library
    • .mp4
    • .wmv
    • .flv

Sitecore MP4 Video Setup

  • Download the Longtail Flash Video Player
  • Follow the Longtail instructions for configuring the player
  • In the Template Manager, duplicate the /System/Media/Unversioned/Flash template item
  • Name the duplicate Mp4
  • Add a Standard Values to the Mp4 template if there is none
  • In the Standard Values set the Extension field to mp4 and the Mime Type to video/mp4
  • Reset the Extension and Mime Type fields for all existing Mp4 videos to the Standard Values
  • Publish your template and mp4 item updates to your staging server
  • Back up your web.config file
  • Add the settings related to Mp4 in your web.config file

Sources