groovebasin icon indicating copy to clipboard operation
groovebasin copied to clipboard

extract the audio from a ytdl import before saving into library

Open eyecreate opened this issue 10 years ago • 3 comments

ytdl should be told to only retrieve the audio(or if for some reason video might be wanted, make it an option to set) so that when things are imported, space is saved and bandwidth is saved for what will not be seen.

eyecreate avatar Feb 12 '15 20:02 eyecreate

Update: I think this should be already the case. See import_url_filters.js. And it's not using youtube-dl, it's using ytdl - sorry for my wrong assumptions before...

~~Not every website provides audio, so you need to write a wrapper that checks for audio and if there is no audio, provide a fallback for downloading the video-file. If needed you could use the youtube-dl build in video-processor that extracts audio only. This might take lot's of CPU-load, so you want to have an option in the groovebasin-gui... One flag for downloading audio is youtube-dl -f bestaudio/best $URL, youtube's default for audio is youtube-dl -f140 $URL.~~

norpol avatar Feb 12 '15 22:02 norpol

libgroove already has the capability to transcode audio, or even better in this case, extract the audio stream from a video and put it in a format container without going through a lossy transcode.

It just needs to be implemented in groovebasin to take advantage of this feature.

This is planned.

andrewrk avatar Feb 12 '15 23:02 andrewrk

It's a bit "hacky" but adding this line to the filter function of import_url_filters.js:

    function filter(format) {
      return format.audioBitrate === bestFormat.audioBitrate &&
        format.audioEncoding === bestFormat.audioEncoding &&
        format.type.indexOf("audio") === 0; ## The EDIT
    }

A given format has a type value that typically goes like "video/mp4..." or "audio/mp4...". I couldn't find a better way than this. I tried format.resolution === null but that even nabbed some resources with video for some reason.

ValerieDittmar avatar May 25 '15 23:05 ValerieDittmar