{"id":902,"date":"2022-04-10T11:50:33","date_gmt":"2022-04-10T10:50:33","guid":{"rendered":"https:\/\/blog.thomarite.uk\/?p=902"},"modified":"2022-04-10T11:50:33","modified_gmt":"2022-04-10T10:50:33","slug":"youtube-dl-extract-specific-audio-portion","status":"publish","type":"post","link":"https:\/\/blog.thomarite.uk\/index.php\/2022\/04\/10\/youtube-dl-extract-specific-audio-portion\/","title":{"rendered":"youtube-dl extract specific audio portion"},"content":{"rendered":"\n<p>I was watching a concert and I wanted to take just the audio of a song, no video. I knew you could download the full audio from videos pretty easily with youtube-dl but now just wanted an specific portion. Thanks to these links (<a href=\"https:\/\/unix.stackexchange.com\/questions\/230481\/how-to-download-portion-of-video-with-youtube-dl-command\">link1<\/a> and <a href=\"https:\/\/stackoverflow.com\/questions\/9913032\/how-can-i-extract-audio-from-video-with-ffmpeg\">link2<\/a>) I managed to get what I wanted:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ youtube-dl --youtube-skip-dash-manifest -g \"VIDEO_URL\"\n\n# copy the second url (audio) from the above command output\n\n$ audio_url=\"AUDIO_URL_FROM_ABOVE\"\n\n$ ffmpeg -i \"$audio_url\" -ss 00:00:30 -t 00:05:20.0 -q:a 0 -map a sample.mp3\n\n# PLAY IT!\n\n$ vlc sample.mp3<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was watching a concert and I wanted to take just the audio of a song, no video. I knew you could download the full audio from videos pretty easily with youtube-dl but now just wanted an specific portion. Thanks to these links (link1 and link2) I managed to get what I wanted:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-902","post","type-post","status-publish","format-standard","hentry","category-unix"],"_links":{"self":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/comments?post=902"}],"version-history":[{"count":1,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/902\/revisions"}],"predecessor-version":[{"id":903,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/902\/revisions\/903"}],"wp:attachment":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/media?parent=902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/categories?post=902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/tags?post=902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}