I have downloaded several videos recently which I have not very good video but have been downloaded for the music. My intention has been to play the audio only download using my music player. (Music saved as flac file on NAS, served by minimserver, controlled by BubbleDS and played on Linn DS devices.)
The video downloads are downloaded separately, combined and saved in .mp4 container. I cannot now find the button for Code but recent example of a download results in the following:-
alastair@IBMW530:~> yt-dlp -f 'bv*+ba' --merge-output-format mp4 PU1uHf_1Bj0
[youtube] Extracting URL: PU1uHf_1Bj0
[youtube] PU1uHf_1Bj0: Downloading webpage
[youtube] PU1uHf_1Bj0: Downloading android player API JSON
[info] PU1uHf_1Bj0: Downloading 1 format(s): 248+251
[download] Resuming download at byte 45842861
[download] Destination: Monteverdi | Marienvesper [PU1uHf_1Bj0].f248.webm
[download] 100% of 850.09MiB in 00:02:56 at 4.82MiB/s
[download] Destination: Monteverdi | Marienvesper [PU1uHf_1Bj0].f251.webm
[download] 100% of 100.43MiB in 00:00:22 at 4.55MiB/s
[Merger] Merging formats into "Monteverdi | Marienvesper [PU1uHf_1Bj0].mp4"
Deleting original file Monteverdi | Marienvesper [PU1uHf_1Bj0].f251.webm (pass -k to keep)
Deleting original file Monteverdi | Marienvesper [PU1uHf_1Bj0].f248.webm (pass -k to keep)
alastair@IBMW530:~>
This results in an .mp4 file with a size shown in Dolphin as 950.3MiB.
However if I try and download the file as audio only the file is saved as much larger than the 100.43 MiB shown above before conversion to flac.
Here is the command I have run:-
alastair@IBMW530:~> yt-dlp --extract-audio --audio-format flac PU1uHf_1Bj0
[youtube] Extracting URL: PU1uHf_1Bj0
[youtube] PU1uHf_1Bj0: Downloading webpage
[youtube] PU1uHf_1Bj0: Downloading android player API JSON
[info] PU1uHf_1Bj0: Downloading 1 format(s): 251
[download] Destination: Monteverdi | Marienvesper [PU1uHf_1Bj0].webm
[download] 100% of 100.43MiB in 00:00:25 at 3.99MiB/s
[ExtractAudio] Destination: Monteverdi | Marienvesper [PU1uHf_1Bj0].flac
Deleting original file Monteverdi | Marienvesper [PU1uHf_1Bj0].webm (pass -k to keep)
alastair@IBMW530:~>
This results in a flac file with a size shown in Dolphin as 1010.4 MiB.
Clearly my command may be wrong but I do not understand why the file is so large. Please could I have some help with this and also please let me know how to get back the and inserts.
Budge
Using flac in this case is probably rather a waste, the audio quality is going to be limited by the original encoding of the youtube video, usually 126 kbps AAC in an MP4 container, or 50-165 kbps Opus in a WebM container.
As Malcolm says, perhaps use mp3 instead, encoded at 196 kbps subjective quality wise you won’t really be loosing anything and the file size will be much smaller…
Hi Malcolm,
Many thanks for replying. On reflection I should perhaps have posted on multimedia but thanks anyhow.
I am having some difficulty understanding this. AFAIK the best resolution available on YT is what is downloaded when “best audio” is included in my original video download. Shall play around with ffmpeg on the mp4 and see what I get but for my audio download to have grown by x10 doesn’t seem right.
What happened to the Code brackets?
BTW wishing you a very Happy New Year!
A.
Hi Paul,
The download starts as a WebM so I assume Opus. I agree there is no point in consuming so much space but I wrongly assumed that lossless would just give me the received Opus file.
I have most of my classical collection ripped to flac nowadays as it is lossless and is now generally accepted by most players.
I shall try a few other options now and thanks again.
Regards,
A.
Further to this I have tried mp3, ogg and flac with file sizes of 89.9MiB, 106.9MiB and 1010.4, the last being larger than mp4. I also tried m4a and this was the smallest file with 81.3MiB.
I am none the wiser so will need to read a bit more. Meanwhile I shall try each in the NAS and see if I can hear any difference.
Many thanks to all.
A.
but I wrongly assumed that lossless would just give me the received Opus file
Opus is a lossy format. If you want to get the best quality out of a youtube video your best option is to not convert it. To do that, remove the --audio format flac from the command and it will just extract the audio to its original format (in this case opus).
I have most of my classical collection ripped to flac nowadays as it is lossless and is now generally accepted by most players.
Lots of player nowadays support opus too, so it shouldn’t be a problem in that regard
Hi and thanks for the reply. I want to get the best audio from YT, hence my trying different options. Not familiar with Opus so will check it out but I need to dump the video. Not much use in my Linn DS audio renderers and some audio control apps reject mp4.
Thanks for the information on Opus.
Budge.