{"id":1963,"date":"2014-03-31T16:02:31","date_gmt":"2014-03-31T12:02:31","guid":{"rendered":"http:\/\/sandalov.org\/blog\/?p=1963"},"modified":"2014-03-31T16:03:33","modified_gmt":"2014-03-31T12:03:33","slug":"compress-video-keeping-subtitles","status":"publish","type":"post","link":"https:\/\/sandalov.org\/blog\/1963\/","title":{"rendered":"Compress video keeping subtitles"},"content":{"rendered":"<div class=\"2d836d85a73757df15d0de19d7bef594\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-2287684400845931\";\r\n\/* valerymorozov *\/\r\ngoogle_ad_slot = \"5606708872\";\r\ngoogle_ad_width = 728;\r\ngoogle_ad_height = 90;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>This method is generally used if you are targeting a specific output file size and output quality from frame to frame is of less importance. This is best explained with an example. Your video is 10 minutes (600 seconds) long and an output of 50 MB is desired. Since bitrate = file size \/ duration:<br \/>\n(50 MB * 8192 [converts MB to kilobits]) \/ 600 seconds = ~683 kilobits\/s total bitrate<br \/>\n683k &#8211; 128k (desired audio bitrate) = 555k video bitrate<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\navconv -y -i video.mkv -c:v libx264 -preset medium -b:v 555k -pass 1 -an -sn -f matroska \/dev\/null &amp;&amp; \\\r\navconv -i video.mkv -c:v libx264 -preset medium -b:v 555k -pass 2 -c:a libmp3lame -ac 2 -b:a 128k \\ \r\n -c:s copy -map 0:0 -map 0:1 -map 0:2 -map 0:3 video_out.mkv\r\n<\/pre>\n<div class=\"2d836d85a73757df15d0de19d7bef594\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-2287684400845931\";\r\n\/* valerymorozov *\/\r\ngoogle_ad_slot = \"5606708872\";\r\ngoogle_ad_width = 728;\r\ngoogle_ad_height = 90;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>This method is generally used if you are targeting a specific output file size and output quality from frame to frame is of less importance. This is best explained with an example. Your video is 10 minutes (600 seconds) long and an output of 50 MB is desired. Since bitrate &hellip; <a class=\"continue-reading-link\" href=\"https:\/\/sandalov.org\/blog\/1963\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1963","post","type-post","status-publish","format-standard","hentry","category-unsorted"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/comments?post=1963"}],"version-history":[{"count":2,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1963\/revisions"}],"predecessor-version":[{"id":1965,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1963\/revisions\/1965"}],"wp:attachment":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/media?parent=1963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/categories?post=1963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/tags?post=1963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}