Convert audio download with youtube-dl to flac?
Asked Answered
B

1

15

Is it possible to download a YouTube video as e.g. mp3 and then convert it to flac with ffmpeg? I can specify the arguments that ffmpeg shall use after the download with --postprocessor-args but I don't know how to get the file name there.

--postprocessor-args "-i downloadedfile.xxx -c:a flac downloadedfile.flac"

This would be the argument I want to use. Is this possible?

Bud answered 16/3, 2017 at 7:44 Comment(2)
youtube-dl is open source. Why not try and add the conversion function in it ?Paschasia
Forgot about that one haha. I might try it later today, but maybe it's possible without a modificationBud
T
35

Starting with youtube-dl 2017.03.16 - or right now if you check out the git repository - you can simply pass in --extract-audio --audio-format flac, as in:

youtube-dl -x --audio-format flac  https://www.youtube.com/watch?v=BaW_jenozKc

(-x is short for --extract-audio.)

Tight answered 16/3, 2017 at 11:57 Comment(3)
Thank you so much! I will try it immediately when I get home and mark the answer. I've done python so it would've taken me a while to get the hang of it I guess.Bud
Since I don't know how to build my own version, I'm gonna wait this 10 days. Thanks again for your commit!Bud
2016.03.25 was just a conservative guess from me. youtube-dl 2017.03.16 - released just now - already contains flac support. See the FAQ if you need help updating.Tight

© 2022 - 2024 — McMap. All rights reserved.