{"action":"created","comment":{"url":"https://api.github.com/repos/google/WebFundamentals/pulls/comments/120082601","pull_request_review_id":42014640,"id":120082601,"diff_hunk":"@@ -0,0 +1,180 @@\n+project_path: /web/_project.yaml\n+book_path: /web/fundamentals/_book.yaml\n+description: An aweful lot of media work requires changing characteristics of media files. In this section, I intend to provide an easy onramp into that world.\n+\n+{# wf_updated_on: 2017-06-05 #}\n+{# wf_published_on: 2017-06-05 #}\n+\n+# The Applications {: .page-title }\n+\n+{% include \"web/_shared/contributors/josephmedley.html\" %}\n+\n+An aweful lot of media work requires changing characteristics of media files.\n+This article covers many things including but not limited to encrypting,\n+changing the codec, setting a bit rit, and many others. Finding a\n+straightforward way to get started can be bewildering and intimidating. In this\n+section, I intend to provide an easy onramp into that world.\n+\n+You'll find two articles in this section. On this page, I provide some basic\n+instruction in using two common media command-line utilities:\n+[Shaka Packager](https://github.com/google/shaka-packager) and\n+[ffmpeg](https://ffmpeg.org/download.html). Why cover two applications? While\n+both are powerful and useful by themselves, neither does everthing needed to\n+prepare media for the web.  \n+\n+The next page is a [cheat sheet](cheatsheet) showing common operations with\n+those applications. Corrections and additions to that part are welcome.\n+\n+\n+## Media file characteristics\n+\n+One thing you'll do often is look at the characteristics of a video: resolution,\n+bitrate, codecs, etc.. Since this is just about the easiest thing to do in both\n+Shaka Packager and ffmpeg, let's use this to get comfortable with these\n+packages.\n+ \n+When we peak into a media file, we're going to see many file characteristics.\n+For this article, I'm only focusing on characteristics in the cheat sheet.\n+ \n+Let's start with streams. Media files can can almost be thought of as multiple\n+files in one. The multiple \"files\" are called _streams_. A media file can have\n+anywhere from one to four streams, but our examples will only contain at most\n+two, an audio stream and a video stream. (The other two stream types are\n+captions and data, both of which are beyond the scope of this article). There\n+are many instances where audio and video streams are dealt with separately.\n+ \n+The other characteristics I need for this article are listed below.\n+ \n+_Bitrate_ is the number of bits used to encode one second of a stream. \n+ \n+_Resolution_ is the amount of information in a single frame of video. It's\n+given a number of stacked horizontal lines. For example a resolution of 1080p\n+means that 1080 lines make up a single frame of video. Technically the width can\n+vary. For the sake of simplicity, I'm going to assume a width that gives me an\n+[aspect ratio](https://en.wikipedia.org/wiki/Aspect_ratio_(image)) of 16:9,\n+which is the ratio of movie screens and modern television sets. This works out\n+to the dimensions 1920 by 1080. By the way this is the resolution defined as\n+[full HD](https://www.google.com/search?q=what+is+hd+resolution&oq=what+is+hd+resolution&aqs=chrome.0.0l6.3183j0j8&sourceid=chrome&ie=UTF-8#q=full+hd+resolution).\n+\n+When you look at the file characteristics using Shaka Packager and ffmpeg,\n+you'll notice that the word 'resolution' doesn't appear. What the two\n+applications output are just the dimensions, the numbers themselves.\n+ \n+_Codec_ is a compression format for video or audio data. This is not the same\n+as a file format. Think of the file format as the container and the codec as a\n+way of arranging what's in the container. Different codecs are used for audio\n+and video streams. Many file formats support multiple codecs for the same stream\n+type. A complete list of available codecs would be a whole website itself.\n+Listed below are the currently preferred codecs for mp4 and webm files.\n+\n+|  |mp4|webm|\n+| --- | --- | --- |\n+|**video**|H264|VP9|\n+|**audio**|aac|vorbis,opus|\n+\n+## Shaka Packager\n+\n+[Shaka Packager](https://github.com/google/shaka-packager) is a free media\n+packaging SDK for creating DASH/HLS packager applications with common encryption\n+support, Widevine DRM support, live, and video-on-demand. Despite what it says\n+on the packaging, this utility for more than C++ developers. In can be used as\n+both a library for building media software and as a command-line utility for\n+preparing media files for playback. It's the later capacity that interestests me\n+here. In fact, for web media creators, it's the only way to do some tasks\n+without spending money on expensive commercial applications.\n+\n+Here's the basic pattern for a Shaka Packager command line.\n+\n+    packager stream_descriptor[ stream_descriptor-2[ stream_desdriptor-n]] [flags]\n+\n+This isn't quite what you get if you type `packager -help`. This is how I think\n+of it, and this reflects the examples in the\n+[Shaka PackagerREADME](https://github.com/google/shaka-packager).\n+Note the multiple _stream_descriptors_. This is useful for manipulating the\n+video and audio streams of the same file simultaneously.\n+\n+Compare this basic pattern with something simple like displaying file\n+characteristics. (I've lined up equivalent parts.)\n+\n+    packager stream_descriptor[ stream_descriptor-2[ stream_desdriptor-n]] [flags]\n+\n+    packager input=glocken.mp4                                              --dump_stream_info\n+\n+I've shown the output below. Look for the characteristics discussed in the last","path":"src/content/en/fundamentals/media/manipulating/applications.md","position":103,"original_position":103,"commit_id":"2f8c0c05e8385731d97e5602a4da58d0e42adee1","original_commit_id":"2f8c0c05e8385731d97e5602a4da58d0e42adee1","user":{"login":"paullewis","id":617438,"avatar_url":"https://avatars1.githubusercontent.com/u/617438?v=3","gravatar_id":"","url":"https://api.github.com/users/paullewis","html_url":"https://github.com/paullewis","followers_url":"https://api.github.com/users/paullewis/followers","following_url":"https://api.github.com/users/paullewis/following{/other_user}","gists_url":"https://api.github.com/users/paullewis/gists{/gist_id}","starred_url":"https://api.github.com/users/paullewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paullewis/subscriptions","organizations_url":"https://api.github.com/users/paullewis/orgs","repos_url":"https://api.github.com/users/paullewis/repos","events_url":"https://api.github.com/users/paullewis/events{/privacy}","received_events_url":"https://api.github.com/users/paullewis/received_events","type":"User","site_admin":false},"body":"Maybe move this below the output, so you see that before you see the remarks?","created_at":"2017-06-05T10:32:36Z","updated_at":"2017-06-05T10:44:23Z","html_url":"https://github.com/google/WebFundamentals/pull/4647#discussion_r120082601","pull_request_url":"https://api.github.com/repos/google/WebFundamentals/pulls/4647","_links":{"self":{"href":"https://api.github.com/repos/google/WebFundamentals/pulls/comments/120082601"},"html":{"href":"https://github.com/google/WebFundamentals/pull/4647#discussion_r120082601"},"pull_request":{"href":"https://api.github.com/repos/google/WebFundamentals/pulls/4647"}}},"pull_request":{"url":"https://api.github.com/repos/google/WebFundamentals/pulls/4647","id":123757681,"html_url":"https://github.com/google/WebFundamentals/pull/4647","diff_url":"https://github.com/google/WebFundamentals/pull/4647.diff","patch_url":"https://github.com/google/WebFundamentals/pull/4647.patch","issue_url":"https://api.github.com/repos/google/WebFundamentals/issues/4647","number":4647,"state":"open","locked":false,"title":"App 101 and cheat sheet.","user":{"login":"jpmedley","id":8204171,"avatar_url":"https://avatars2.githubusercontent.com/u/8204171?v=3","gravatar_id":"","url":"https://api.github.com/users/jpmedley","html_url":"https://github.com/jpmedley","followers_url":"https://api.github.com/users/jpmedley/followers","following_url":"https://api.github.com/users/jpmedley/following{/other_user}","gists_url":"https://api.github.com/users/jpmedley/gists{/gist_id}","starred_url":"https://api.github.com/users/jpmedley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpmedley/subscriptions","organizations_url":"https://api.github.com/users/jpmedley/orgs","repos_url":"https://api.github.com/users/jpmedley/repos","events_url":"https://api.github.com/users/jpmedley/events{/privacy}","received_events_url":"https://api.github.com/users/jpmedley/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-06-02T16:47:50Z","updated_at":"2017-06-05T10:44:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2860a7b3e6d4e86cb979713e203e6e9d67b401b","assignee":null,"assignees":[],"requested_reviewers":[{"login":"samdutton","id":205226,"avatar_url":"https://avatars3.githubusercontent.com/u/205226?v=3","gravatar_id":"","url":"https://api.github.com/users/samdutton","html_url":"https://github.com/samdutton","followers_url":"https://api.github.com/users/samdutton/followers","following_url":"https://api.github.com/users/samdutton/following{/other_user}","gists_url":"https://api.github.com/users/samdutton/gists{/gist_id}","starred_url":"https://api.github.com/users/samdutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdutton/subscriptions","organizations_url":"https://api.github.com/users/samdutton/orgs","repos_url":"https://api.github.com/users/samdutton/repos","events_url":"https://api.github.com/users/samdutton/events{/privacy}","received_events_url":"https://api.github.com/users/samdutton/received_events","type":"User","site_admin":false},{"login":"cwilso","id":507001,"avatar_url":"https://avatars1.githubusercontent.com/u/507001?v=3","gravatar_id":"","url":"https://api.github.com/users/cwilso","html_url":"https://github.com/cwilso","followers_url":"https://api.github.com/users/cwilso/followers","following_url":"https://api.github.com/users/cwilso/following{/other_user}","gists_url":"https://api.github.com/users/cwilso/gists{/gist_id}","starred_url":"https://api.github.com/users/cwilso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwilso/subscriptions","organizations_url":"https://api.github.com/users/cwilso/orgs","repos_url":"https://api.github.com/users/cwilso/repos","events_url":"https://api.github.com/users/cwilso/events{/privacy}","received_events_url":"https://api.github.com/users/cwilso/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/google/WebFundamentals/pulls/4647/commits","review_comments_url":"https://api.github.com/repos/google/WebFundamentals/pulls/4647/comments","review_comment_url":"https://api.github.com/repos/google/WebFundamentals/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/WebFundamentals/issues/4647/comments","statuses_url":"https://api.github.com/repos/google/WebFundamentals/statuses/2f8c0c05e8385731d97e5602a4da58d0e42adee1","head":{"label":"google:cheat","ref":"cheat","sha":"2f8c0c05e8385731d97e5602a4da58d0e42adee1","user":{"login":"google","id":1342004,"avatar_url":"https://avatars2.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":19249835,"name":"WebFundamentals","full_name":"google/WebFundamentals","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars2.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/WebFundamentals","description":"Best practices for modern web development","fork":false,"url":"https://api.github.com/repos/google/WebFundamentals","forks_url":"https://api.github.com/repos/google/WebFundamentals/forks","keys_url":"https://api.github.com/repos/google/WebFundamentals/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/WebFundamentals/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/WebFundamentals/teams","hooks_url":"https://api.github.com/repos/google/WebFundamentals/hooks","issue_events_url":"https://api.github.com/repos/google/WebFundamentals/issues/events{/number}","events_url":"https://api.github.com/repos/google/WebFundamentals/events","assignees_url":"https://api.github.com/repos/google/WebFundamentals/assignees{/user}","branches_url":"https://api.github.com/repos/google/WebFundamentals/branches{/branch}","tags_url":"https://api.github.com/repos/google/WebFundamentals/tags","blobs_url":"https://api.github.com/repos/google/WebFundamentals/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/WebFundamentals/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/WebFundamentals/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/WebFundamentals/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/WebFundamentals/statuses/{sha}","languages_url":"https://api.github.com/repos/google/WebFundamentals/languages","stargazers_url":"https://api.github.com/repos/google/WebFundamentals/stargazers","contributors_url":"https://api.github.com/repos/google/WebFundamentals/contributors","subscribers_url":"https://api.github.com/repos/google/WebFundamentals/subscribers","subscription_url":"https://api.github.com/repos/google/WebFundamentals/subscription","commits_url":"https://api.github.com/repos/google/WebFundamentals/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/WebFundamentals/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/WebFundamentals/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/WebFundamentals/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/WebFundamentals/contents/{+path}","compare_url":"https://api.github.com/repos/google/WebFundamentals/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/WebFundamentals/merges","archive_url":"https://api.github.com/repos/google/WebFundamentals/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/WebFundamentals/downloads","issues_url":"https://api.github.com/repos/google/WebFundamentals/issues{/number}","pulls_url":"https://api.github.com/repos/google/WebFundamentals/pulls{/number}","milestones_url":"https://api.github.com/repos/google/WebFundamentals/milestones{/number}","notifications_url":"https://api.github.com/repos/google/WebFundamentals/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/WebFundamentals/labels{/name}","releases_url":"https://api.github.com/repos/google/WebFundamentals/releases{/id}","deployments_url":"https://api.github.com/repos/google/WebFundamentals/deployments","created_at":"2014-04-28T18:45:45Z","updated_at":"2017-06-05T03:50:48Z","pushed_at":"2017-06-04T19:47:56Z","git_url":"git://github.com/google/WebFundamentals.git","ssh_url":"git@github.com:google/WebFundamentals.git","clone_url":"https://github.com/google/WebFundamentals.git","svn_url":"https://github.com/google/WebFundamentals","homepage":"https://developers.google.com/web/fundamentals","size":1264521,"stargazers_count":7458,"watchers_count":7458,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1433,"mirror_url":null,"open_issues_count":223,"forks":1433,"open_issues":223,"watchers":7458,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"42def23ddcb88608338534c510a485024124f935","user":{"login":"google","id":1342004,"avatar_url":"https://avatars2.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":19249835,"name":"WebFundamentals","full_name":"google/WebFundamentals","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars2.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/WebFundamentals","description":"Best practices for modern web development","fork":false,"url":"https://api.github.com/repos/google/WebFundamentals","forks_url":"https://api.github.com/repos/google/WebFundamentals/forks","keys_url":"https://api.github.com/repos/google/WebFundamentals/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/WebFundamentals/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/WebFundamentals/teams","hooks_url":"https://api.github.com/repos/google/WebFundamentals/hooks","issue_events_url":"https://api.github.com/repos/google/WebFundamentals/issues/events{/number}","events_url":"https://api.github.com/repos/google/WebFundamentals/events","assignees_url":"https://api.github.com/repos/google/WebFundamentals/assignees{/user}","branches_url":"https://api.github.com/repos/google/WebFundamentals/branches{/branch}","tags_url":"https://api.github.com/repos/google/WebFundamentals/tags","blobs_url":"https://api.github.com/repos/google/WebFundamentals/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/WebFundamentals/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/WebFundamentals/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/WebFundamentals/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/WebFundamentals/statuses/{sha}","languages_url":"https://api.github.com/repos/google/WebFundamentals/languages","stargazers_url":"https://api.github.com/repos/google/WebFundamentals/stargazers","contributors_url":"https://api.github.com/repos/google/WebFundamentals/contributors","subscribers_url":"https://api.github.com/repos/google/WebFundamentals/subscribers","subscription_url":"https://api.github.com/repos/google/WebFundamentals/subscription","commits_url":"https://api.github.com/repos/google/WebFundamentals/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/WebFundamentals/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/WebFundamentals/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/WebFundamentals/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/WebFundamentals/contents/{+path}","compare_url":"https://api.github.com/repos/google/WebFundamentals/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/WebFundamentals/merges","archive_url":"https://api.github.com/repos/google/WebFundamentals/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/WebFundamentals/downloads","issues_url":"https://api.github.com/repos/google/WebFundamentals/issues{/number}","pulls_url":"https://api.github.com/repos/google/WebFundamentals/pulls{/number}","milestones_url":"https://api.github.com/repos/google/WebFundamentals/milestones{/number}","notifications_url":"https://api.github.com/repos/google/WebFundamentals/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/WebFundamentals/labels{/name}","releases_url":"https://api.github.com/repos/google/WebFundamentals/releases{/id}","deployments_url":"https://api.github.com/repos/google/WebFundamentals/deployments","created_at":"2014-04-28T18:45:45Z","updated_at":"2017-06-05T03:50:48Z","pushed_at":"2017-06-04T19:47:56Z","git_url":"git://github.com/google/WebFundamentals.git","ssh_url":"git@github.com:google/WebFundamentals.git","clone_url":"https://github.com/google/WebFundamentals.git","svn_url":"https://github.com/google/WebFundamentals","homepage":"https://developers.google.com/web/fundamentals","size":1264521,"stargazers_count":7458,"watchers_count":7458,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1433,"mirror_url":null,"open_issues_count":223,"forks":1433,"open_issues":223,"watchers":7458,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/WebFundamentals/pulls/4647"},"html":{"href":"https://github.com/google/WebFundamentals/pull/4647"},"issue":{"href":"https://api.github.com/repos/google/WebFundamentals/issues/4647"},"comments":{"href":"https://api.github.com/repos/google/WebFundamentals/issues/4647/comments"},"review_comments":{"href":"https://api.github.com/repos/google/WebFundamentals/pulls/4647/comments"},"review_comment":{"href":"https://api.github.com/repos/google/WebFundamentals/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/WebFundamentals/pulls/4647/commits"},"statuses":{"href":"https://api.github.com/repos/google/WebFundamentals/statuses/2f8c0c05e8385731d97e5602a4da58d0e42adee1"}}}}
{"actor":{"display_login":"paullewis"}}