{"id":4583,"date":"2016-06-22T01:48:46","date_gmt":"2016-06-22T01:48:46","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=4583"},"modified":"2016-06-22T01:48:46","modified_gmt":"2016-06-22T01:48:46","slug":"google2srt-alternatives","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/google2srt-alternatives\/","title":{"rendered":"Google2SRT Alternatives for command line use"},"content":{"rendered":"<p>There is a neat GUI tool (written in Java) that extracts subtitles from Youtube, and converts them to the &#8220;SRT&#8221; subtitle format (which I like for ease of parsing). Youtube has subtitles for most things, because they automatically generate them from the audio.<\/p>\n<p>The downside of this application is that it does not work on the command line, and consequently is nearly worthless for any scale of conversion beyond a few hundred videos, and this is not a feature that the author is intending to add.<\/p>\n<p>However, you can get around this with youtube-dl and ffmpeg combined.<\/p>\n<p>First, you download a video with youtube-dl:<\/p>\n<pre lang=\"bash\">\nyoutube-dl -o .\/data\/mXC3xGZWo_M\"\/%(id)s.%(ext)s\" -x --sub-lang en \\\n  --write-sub --sub-format srt --convert-subtitles srt --write-auto-sub \n  --continue --write-info-json --write-description --write-annotations\n  --min-filesize 50k --ignore-errors --write-all-thumbnails --no-call-home \n  --audio-format mp3 mXC3xGZWo_M\n<\/pre>\n<p>Then convert it to SRT with ffmeg:<\/p>\n<pre lang=\"bash\">\nffmpeg.exe -i mXC3xGZWo_M.en.vtt mXC3xGZWo_M.en.srt\n<\/pre>\n<p>And then you get nice subtitles. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Extracting video subtitles from youtube without using Google2SRT<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[12],"tags":[607],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/4583"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=4583"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/4583\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=4583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=4583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=4583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}