XML element definitions
Complete feed samples
Expected metadata fields by asset type
The following lists identify expected metadata fields for each asset type that YouTube supports. Note that YouTube will still process your feed even if you include a supported, but unexpected, metadata tag for a particular asset type but will flag the value in the response feed. For example, YouTube will process a feed that tries to associate a TMS ID with a sound recording but will not actually create the association.
composition: <iswc> <title> <writer> |
music_video: <artist> <genre> <grid> <isrc> <label> <title> |
sound_recording: <album> <artist> – required for any sound recording you are including in AudioSwap. <genre> – required for any sound recording you are including in AudioSwap. You must specify a valid music genre. <grid> <isrc> <label> <title> – required for any sound recording you are including in AudioSwap. |
There are special metadata requirements for videos that appear in the Shows or Movies categories on YouTube.com. When you upload your feed, YouTube’s feed handler enforces the rules listed below for any asset that has its <shows_and_movies_programming> element set to True. Assets that do not meet the requirements will not be processed. (Videos for episode or movie assets that do not have the<shows_and_movies_programming> element set to True can instead be categorized in one of the categories for web videos.)
For episode, movie, or trailer assets, you must create a video and claim the video as a match of the asset. An asset that appears in the Shows or Movies section must be linked to exactly one video. You can specify values for certain metadata fields as part of the asset definition or the video definition. For example, you can identify the<director> as a subtag of the <asset> tag or the <video> tag. When YouTube processes your upload, these shared metadata tags are ultimately stored as part of the video regardless of where you specified them in the feed. If you subsequently update the values for these fields, you must update them on the video. See Update video metadatafor more information.
If your feed contains information for a new trailer asset, the feed must also contain a relationship that identifies the movie that the trailer promotes.
web: <custom_id> <description> <notes> <title> <URL> |
Genres and categories
The following sections describe the schemes for categorizing different types of assets:
You must specify at least one genre for movie assets using the <genre> tag that is a subtag of <asset>. (You can specify more than one.) The movie genre also appears as the <movie_genre> on the associated video.
Valid movie genres are:
|
|
Genres marked with an asterisk (*) are not listed in the browsable genre menu in YouTube’s Movies category.
Genres marked with a dagger (†) are only applicable in Japan.
Genres marked with a double dagger (‡) are only applicable in Australia.
Genres marked with a section sign (§) are not displayed in Japan.
You must specify at least one genre for sound recordings that are included in the AudioSwap program. You can also specify genres for music video assets. If you specify an invalid genre for an AudioSwap recording, YouTube uses the default genre Other instead of the invalid genre. Valid genres for AudioSwap are:
|
|
You must specify at least one genre for television show assets. (You can specify more than one.) Valid genres are:
|
|
Genres marked with an asterisk (*) are also valid genres for Google Play.
Whereas the previous sections explained how to specify the genre of an asset, this section explains how to specify the category for a video. This value is specified in the <genre> tag that is a subtag of <video>.
The YouTube category document, which can be downloaded fromhttp://gdata.youtube.com/schemas/2007/categories.cat, identifies the categories that you can use to classify web video content. The category document is an XML file that identifies the categories and indicates whether new videos can be assigned to each category. The document also identifies the countries where each category is browsable on YouTube.
The excerpt below shows the entries for the “Entertainment” and “Nonprofit & Activism” categories as they appear in the YouTube category document as of August 13, 2008. Please note that videos could be assigned to both categories. In addition, the document lists many countries where the “Entertainment” category is browsable but indicates that the “Nonprofit & Activism” category was only browsable in the United States at that time.
As shown in the example, the presence of the <yt:assignable> tag indicates that new videos may be assigned to that category. (New videos cannot be assigned to categories that are not marked as assignable using the<yt:assignable> tag.) In addition, the presence of the <yt:browsable> tag indicates that the corresponding category is browsable on YouTube in one or more countries. The <yt:browsable> tag’s regions attribute contains a space-delimited list of two-letter region IDs that identify the particular countries where the category is browsable. Categories that are neither assignable or browsable are deprecated and are identified as such using the<yt:deprecated> tag.
<atom:category term='Entertainment' label='Entertainment' xml:lang='en-US'> <yt:browsable regions='AU BR CA FR DE GB NL HK IN IE IT JP MX NZ PL RU KR ES TW US'/> <yt:assignable/> </atom:category> <atom:category term='Nonprofit' label='Nonprofit & Activism' xml:lang='en-US'> <yt:assignable/> <yt:browsable regions='US'/> </atom:category> <atom:category term='Videoblog' label='Videoblogging' xml:lang='en-US'> <yt:deprecated/> </atom:category>
If you have retrieved the default category list, then you can set the <genre> tag’s value to either the term or thelabel attribute value. For example, both of the following values are valid ways of identifying the same video genre:
<genre>Film</genre> <genre>Film & Animation</genre>
Localized category lists for web videos
You can also retrieve localized category lists that specify category labels for classifying video content in particular languages. You can download these lists from http://gdata.youtube.com/schemas/2007/categories.cat?hl=<LANGUAGE>, where you replace the term LANGUAGE in the URL with the appropriate language value from the following list. (Instead of appending the hl parameter value to the schema URL, you can also set the Accept-Language HTTP request header to the appropriate language value.)
Language/Locale | hl Parameter Value |
---|---|
Chinese (Traditional) | zh-TW |
Czech | cs-CZ |
Dutch | nl-NL |
English (Great Britain, Ireland, Australia and New Zealand) | en-GB |
English (United States and Canada) * default value |
en-US |
French | fr-FR |
German | de-DE |
Italian | it-IT |
Japanese | ja-JP |
Korean | ko-KR |
Polish | pl-PL |
Portuguese (Brazil) | pt-BR |
Russian | ru-RU |
Spanish (Spain) | es-ES |
Spanish (Mexico) | es-MX |
Swedish | sv-SE |
The XML excerpt below shows the entries for the “Entertainment” and “Nonprofit & Activism” categories as they appear in the YouTube category document for the French language as of May 5, 2008:
<atom:category term='Entertainment' label='Divertissement' xml:lang='fr-FR'> <yt:assignable/> <yt:browsable/> </atom:category> <atom:category term='Nonprofit' label='Associations et organismes' xml:lang='fr-FR'> <yt:assignable/> </atom:category>
Set the <genre> tag’s value to the term attribute value for the category. Note that the only label attribute values that are valid values for the <genre> tag are those from the default category document (hl=en-US).
YouTube content ratings
A <content_rating> tag provides information that can be used to categorize the content of a video in the absence of an official rating, such as a Motion Picture Association of America (MPAA) rating. You can also use a <content_rating> tag to indicate that a music video contains explicit lyrics. YouTube could use that information to display a badge on the video’s watch page or in search results.
The <content_rating> tag is a child of the <feed> tag. You then define a relationship to associate the content rating with one or more videos.
A YouTube content rating contains a series of values that categorize the content of a video several categories. Each category has three options that indicate the level of mature content. To provide a YouTube rating for a video, select one value for each of the categories and separate the values with spaces. For details about the rating options, see YouTube content rating.
- Strong or explicit language
- L0 – No strong language
- L1 – Strong language
- L2 – Explicit language
- Nudity
- N0 – No nudity
- N1 – Brief or partial nudity
- N2 – Graphic nudity
- Sexual references and content
- S0 – No sexual situations
- S1 – Mild sexual situations
- S2 – Explicit sexual situations
- Violence
- V0 – Not violent or disturbing
- V1 – Mildly violent or disturbing
- V2 – Strongly violent or disturbing
- Drug references and content
- D0 – No drug references or content
- D1 – Mild drug references or content
- D2 – Strong drug references or content
- Flashing or strobing lights
- F0 – No flashing lights content
- F1 – Flashing lights content
The XML snippet below demonstrates how to specify content ratings and use relationships to associate them with different videos:
<content_rating system="youtube" tag="family">L0 S0 N0 D0 V0 F0</content_rating> <content_rating system="youtube" tag="very bad for kids">L2 S2 N2 D2 V2 F0</content_rating> <relationship> <item path="/feed/content_rating[@tag='family']"/> <related_item path="/external/video[@id='VIDEO_ID_1_']"/> <related_item path="/external/video[@id='VIDEO_ID_2_']"/> </relationship> <relationship> <item path="/feed/content_rating[@tag='very bad for kids']"/> <related_item path="/external/video[@id='VIDEO_ID_3_']"/> </relationship>
The XML snippet below demonstrates how to indicate that an existing music video contains explicit lyrics. The<content_rating> could also be associated with the video when the video is created. Note that a video must be in theMusic video genre to display an “Explicit Lyrics” badge.
<content_rating system='lyrics' rating='explicit'/> <relationship> <item path="/external/video[@id='VIDEO_ID_1_']"/> <related_item path="/feed/content_rating[1]"/> </relationship>
Video and audio formatting specifications
Video formatting guidelines
The following guidelines describe the formatting specifications that yield the highest quality for playing videos on YouTube. YouTube encourages partners to upload videos that are as close to the original, high quality source format as possible to increase the likelihood that your videos will play in higher quality (HQ). Note that YouTube always re-encodes videos to optimize their playback quality.
- File format: YouTube prefers the original, 1080p HD broadcast format that you have in your digital content library, as well as DVD-compliant MPEG-2 program streams saved with a .MPG extension. If you cannot submit videos in MPEG-2 format, then MPEG-4 is the preferred format. The following specifications provide optimal playback of MPEG-2 and MPEG-4 videos:
- MPEG-2
- Audio codec: MPEG Layer II or Dolby AC-3
- Audio bitrate: 128 kbps or better
- MPEG-4
- Video codec: H.264
- Audio codec: AAC
- Audio bitrate: 128 kbps or better
- MPEG-2
- Minimum audio-visual duration: 33 seconds (excluding black and static images in the video channel as well as silence and background noise in the audio channel)
- Framerate: Videos should be in their native frame rates without resampling. For film sources, a 24fps or 25fps progressive master yields the best results. Typically, frame rates are set at 24, 25 or 30 frames per second. Please do not use resampling techniques since they can cause images to shudder and often result in lower quality video. Examples of undesirable techniques include upsampling and transfer processes such as Telecine pulldown.
- Aspect ratio: Videos should be in their native aspect ratios, and uploaded videos should never include letterboxing or pillarboxing bars. The YouTube player automatically frames videos to ensure that they are displayed correctly, without cropping or stretching, regardless of the size of the video or player. For example, the player frames 4:3 videos with vertical bars (pillarboxing) when those videos are played in a widescreen (16:9) player. Similarly, the player frames 16:9 videos with horizontal bars (letterboxing) if those videos are played in a standard (4:3) player. See Advanced encodingfor visual examples.
- If the video’s native aspect ratio is 1.77:1 and the total frame size also has a 1.77:1 aspect ratio, use 16:9 matting with square pixels and no border.
- If the video’s native aspect ratio is 1.77:1 and the total frame size does not have a 1.77:1 aspect ratio, use 16:9 matting with square pixels and a single-color border with no variations over time.
- If the video’s native aspect ratio is 1.33:1 and the total frame size also has a 1.33:1 aspect ratio, use 4:3 matting with square pixels and no border.
- If the video’s native aspect ratio is 1.33:1 and the total frame size does not have a 1.33:1 aspect ratio, use 4:3 matting with square pixels and a single-color border with no variations over time.
If theatrical releases have a “pan-and-scan” version as well as the original 16:9 version, upload both versions separately.
- Video resolution: YouTube prefers high-definition videos and, in general, you should provide videos in the highest resolution available to provide the maximum degree of flexibility in the encoding and playback processes. For videos intended for sale or rental, you should provide a minimum resolution of 1920×1080 with a 16:9 aspect ratio. For either free or ad-supported content, YouTube does not set a minimum resolution but recommends a resolution of at least 1280×720 for video that has a 16:9 aspect ratio and a resolution of at least 640×480 for video that has a 4:3 aspect ratio.You may consider providing reduced quality videos if those videos will not be publicly visible on YouTube and are only being uploaded to serve as Content ID references. These videos can be a typical “one quarter” resolution – i.e. 320×240. However, the videos must be greater than 200 lines to yield effective references.
- Video bitrate: Since bitrate is highly dependent on codec, there is no recommended minimum value. Videos should be optimized for frame rate, aspect ratio and resolution rather than bitrate. Bitrates of 50 or 80Mbps are common for videos intended for sale or rental.
If you are unable to encode your videos using the preferred specifications, you can still submit your video in .WMV, .AVI, .MOV and .FLV formats. In this case, we recommend that you upload the highest quality video possible. YouTube will still accept your video content and then re-encode your video files as necessary. However, the quality of your videos may not be optimal and could make your videos ineligible for HQ encoding. If you are not able to encode your videos using the preferred specifications, we recommend that you upload a few test videos online to ensure that you are satisfied with the playback quality on YouTube.
Audio file guidelines
The following guidelines are for audio tracks that you provide to YouTube. These guidelines describe the formatting specifications that yield the highest quality for playing audio on YouTube and for matching your audio tracks to the audio tracks of user-uploaded videos. Note that an audio track would only be played back on YouTube if you have opted to include that track in YouTube’s AudioSwap program. Generally, we recommend that you upload the highest quality audio possible.
- Supported file formats:
- MP3 audio in MP3/WAV container
- PCM audio in WAV container
- AAC audio in MOV container
- FLAC audio
- Minimum audio bitrate for lossy formats: 64 kbps
- Minimum audible duration: 33 seconds (excluding silence and background noise)
- Maximum duration: None
For more information on Multi Channel Network’s and YouTube how to videos please check back weekly or subscribe here.