Now I saw we could download audio in .opus (up to 160kbps) but it doesnt work. When you open the file in an adapted player, you dont have any sound. I think someone need to search why.
*only for 160kbps (50-70 work) so maybe its because youtube uses 128kbps as a maximum bitrate
yea noticed that its not working right.
When you open in VLC you see a low resolution video
O.o
@gappleto97 we might need to check the format it might be 3GPP.
I may need to remove opus again until we can make it work properly.
Well, I'm currently using the 50k opus downloads, so I hope they aren't removed. I hope to see 50k opus as an audio streaming option as well once it gets polished. I must admit, 50k opus sounds pretty good, and is great for saving data.
Believe it or not, but I finally tried opus my self using VLC, and for me it works as well. The Download UI could be optimized however.
It just seems to be 160k opus that is broken. It would be nice if that one gets fixed at some point (since it should have the best sound quality), but at least the ones with small file sizes are currently working, which is a huge plus for those on limited data plans.
Just a side note though, 50k opus really shows how bad "bad transcodes" are. For example, listen to this "backseat by new Boyz" in 50k opus https://www.youtube.com/watch?v=herLMUn2-U0 it sounds horrible, right? Now listen to this song that is generally notorious for being difficult to compress daft punk's "Get Lucky" https://www.youtube.com/watch?v=5NV6Rdv1a3I that sounds a ton better at 50k. Seems like 50k opus amplifies existing mp3 sizzle to the point that it sounds like a 50k mp3. This is why anyone uploading music to YouTube should do so in FLAC.
Downloaded 160kbps Opus with NewPipe v0.13.5, but neither GoneMad, VLC or foobar2000 mobile where able to play it.
When downloading streams with youtube-dl, stream 251 which always is the 160kbps opus, comes in a webm container. Ergo, I believe the bug with NewPipe is that the app wrongly lables webm as opus. Cause it's not remuxing in the download process/ on the fly, right?
Edit: I renamed from *.opus to *.webm, now it plays just fine.
Edit 2: NewPipe downloaded a video without audio when selecting Opus 160kbps. So, some major bug here, selecting the wrong stream and wrongly labeling it *.opus. I got avc / h264 at 256x144p.
Cause it's not remuxing in the download process/ on the fly, right?
No, but newpipe should now that 251 is not an audio format, but a video/audio format.
However what I found weird is that 251 should not even be handled atm since its uncomended as you can see here.
But I'm also not sure if this also applies to the version of the extractor that is running in the current version of NewPipe.
From your link I'd say it looks like NewPipe is not handling codec vs container. Stream 160 which is not uncommented, is Opus inside webm, just like 151.
That's true, we don't handle this correct.
Is newpipe now using opus, as audio format for playback?
Well for me also downloading opus@160k results in an useless file. I guess this is because NewPipe not uses format 251 (it is commented out).
Downloading opus@70k (format 250) works. And this is also webm.
So why downloading opus@160k (format 251) should not work? it is the same as format 250 (which works) but with higher bitrate. So since 250 works, 251 should also work. Why is it commented out here:
https://github.com/TeamNewPipe/NewPipeExtractor/blob/466865385e565cb1777d631efa8bfd262467a04b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/ItagItem.java#L40
but the opus options with less bitrate are not commented out. That makes no sense to me.
Well the author wrote // Disable Opus codec as it's not well supported in older devices however that doesn't look really useful to me anymore you are right, I think we should uncomment this and see if it is usable.
Help is welcome :)
@theScrabi I did the change in my fork: https://github.com/Bleuzen/NewPipeExtractor/commit/9af07a25620edf38211a7caf71b9288bb0ea6370
But I have no idea how to test. Building NewPipeExtractor results in a lot Failed tests. And I currently don't know how to test my own build with NewPipe.
NewPipe itself builds ok.
I'm missing some experience with android development / gradle so I don't know how to fix / build / test the Extractor. And I haven't found instructions for that until now.
Don't know if I should do this PR.
if its about 5 its ok, this is basicly borken code. And since no one is maintaining that code it gets remove soon.
Send a pr so i will take a look at it.
@theScrabi Please enable the Opus codec again. We are using Exoplayer so there shouldn't be an issues with playback.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I noticed that the files from the OPUS downloads are encapsulated in a WEBM container (WEBM is a video+audio container).
That may be OK for VLC, but it's bad for other players.
As audio only, OPUS should be encapsulated in an OGG container (just like VORBIS).
Edit: Just noticed that the OPUS formats 249, 250 and 251 have a WEBM container as default.
So we need to repack the OPUS stream (without transcoding it) from the WEBM to an OGG container after the download is done.
format code extension resolution note
249 webm audio only DASH audio 50k , opus @ 50k, ?.??MiB
250 webm audio only DASH audio 63k , opus @ 70k, ?.??MiB
251 webm audio only DASH audio 123k , opus @160k, ?.??MiB
From: https://tools.ietf.org/html/rfc7845#section-9
9. Content Type
An "Ogg Opus file" consists of one or more sequentially multiplexed
segments, each containing exactly one Ogg Opus stream. The
RECOMMENDED mime-type for Ogg Opus files is "audio/ogg".
If more specificity is desired, one MAY indicate the presence of Opus
streams using the codecs parameter defined in [RFC6381] and
[RFC5334], e.g.,
audio/ogg; codecs=opus
for an Ogg Opus file.
The RECOMMENDED filename extension for Ogg Opus files is '.opus'.
Times change. I have created a tutorial in which I show how it is possible for everyone to publish high-quality sound (opus @ 160kbps) on YouTube. See here: '2019 How to Upload Best Audio Quality to YouTube. Opus for All. ' → https://youtu.be/yjBIzNId5Yk
Can we please see some revival on this issue?
This is not an issue for me anymore :-D
I tried all opus formats on this video: 50kbps, 70kbps, 160kbps
Can you confirm, please?
The download is working well since a while (for me), but the file isn't encapsulated in an OGG container. Instead Google delivers it encapsulated in a WEBM container. So we need something which repacks it to an OGG container (without transcoding it) after the download is finished, as I wrote before.
```#mediainfo A.I. Learns to play Snake using Deep Q Learning.opus
General
Complete name : A.I. Learns to play Snake using Deep Q Learning.opus
Format : WebM
Format version : Version 4
File size : 13.4 MiB
Duration : 15 min 14 s
Overall bit rate : 123 kb/s
Writing application : google/video-file
Writing library : google/video-file
FileExtension_Invalid : webm
Audio
ID : 1
Format : Opus
Codec ID : A_OPUS
Duration : 15 min 14 s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Bit depth : 16 bits
Compression mode : Lossy
Language : English
Default : Yes
Forced : No
An OPUS file should look like this:
```mediainfo A.I.\ Learns\ to\ play\ Snake\ using\ Deep\ Q\ Learning.opus
General
Complete name : A.I. Learns to play Snake using Deep Q Learning.opus
Format : Ogg
File size : 13.2 MiB
Duration : 15 min 14 s
Overall bit rate : 121 kb/s
Writing application : Lavf58.29.100
Audio
ID : 814017394 (0x3084EB72)
Format : Opus
Duration : 15 min 14 s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Compression mode : Lossy
Writing library : Lavf58.29.100
Language : English
No, we don't need to to do anything anymore. The codec is opus and the
files are saved as .opus files. This is how it should be, no need to repack
to ogg. Everything is perfect in the current version, so I think this can
be closed now.
Works fine for me too :)
Sorry but you are wrong. An OPUS audio file has to be encapsulated in an OGG container not in an WEBM container. Just only having the extension OPUS doesn't mean the container is automatically OGG.
Check for the file type yourself, with e.g. mediainfo
Please re-open this. If it is saving in a webm container, that means it is not resolved.
Well, I know that another popular yt downloader, youtube-dl also downloads
this formats as .opus. And the .opus files download by NewPipe play well on
VLC, Poweramp, an other players on PC etc..
So no, .opus is how it should be. Ogg vorbis is another format. Opus files
typically have the .opus extension.
This no need to do anything anymore.
youtube-dl does the needed repacking from WEBM to OGG after the download is finished (ffmpeg has to be installed to do this task).
And do you know the difference between OGG and OPUS or OGG and VORBIS ?
Ok sorry, I think I got it now. Your are not only talking about the file
extension. Sorry.
But anyway, the .opus files created by NewPipe play just fine. So it's
another, but minor issue.
By the way I am able to play audio from NewPipe even in Huawei's music player, so I think the current format is commonly accepted
An OPUS file has to be encapsulated in OGG, not WEBM to play everywhere without problems.
See: https://tools.ietf.org/html/rfc7845#section-9
But never mind, I open an own issue if you don*t have the knowledge to understand this. ;-)
I understand it now, but this is another issue, the main thing here has been fixed. So yes, please open a new one.
Yes, it is better to open another issue. Link this one there, so the discussion is not lost :-)
OK I'll try to create a new issue in the next few days. If someone is faster ... ;-)
OK, opened #2542
youtube is NOT the place to upload or download sound. use google drive instead. there you have the option for FLAC.
YouTube is a pretty good place to find just about any song without having to hunt down google drive links or subscribe to a premium service, so for my use case, I'm pretty happy with it for casual use. Though if there is something I really want to listen to thoroughly, I know where to look.
Most helpful comment
I understand it now, but this is another issue, the main thing here has been fixed. So yes, please open a new one.