Newpipe: [Bug] Downloaded Opus files still have the extension .webm instead of .opus

Created on 28 Dec 2019  路  9Comments  路  Source: TeamNewPipe/NewPipe

MediaInfo and the file command both confirm that the codec is Opus and the container is Ogg, but the file is named with the wrong extension by default.

bug downloader

All 9 comments

@Stypox If it isn't complicated to fix, could you tell me which file to edit to get the correct extension?

I'd also like to change the string "WebM Opus" in the download dialogue to just "Opus".

Well, I think both changes are to be done in this line: https://github.com/TeamNewPipe/NewPipeExtractor/blob/dev/extractor/src/main/java/org/schabi/newpipe/extractor/MediaFormat.java#L41

But looking at the other audio formats, there seems to be a difference between 'just' opus and WebM Opus.

Now I'm not sure if it's supposed to be changed.

Wait, I think I got it. After my comment here https://github.com/TeamNewPipe/NewPipe/pull/2679#issuecomment-537441586, in commit fceacef, kapodamy seemingly changed the filename extension from 'ogg' back to 'opus'.

But this change was made under the video case, not audio, so even though this didn't affect the audio filename, it actually corrected a possible bug with the video filename.

If I were to change https://github.com/TeamNewPipe/NewPipe/blob/f9e7873e542ab5ea789e806f285ddc5187cf2f29/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java#L559 to
filename += format == MediaFormat.OPUS ? "opus" : format.suffix;
would that fix the issue?

Edit: or maybe
filename += format == MediaFormat.WEBMA_OPUS ? "opus" : format.suffix;

@kapodamy

@opusforlife2 yes, nice catch

I did some testing on different Android versions lately and realized that not all Android versions come with native .opus file extension support. Wikipedia lists the supported containers by version:

On Android 5:
WebM (.webm)
Matroska (.mka, .mkv)
On Android 6 and 7:
Ogg (.opus is not recognised; requires pseudo extension) [On Android 9 the .opus filename extension isn't recognized by Android's MediaScanner service. A pseudo extension of another audio format (such as .ogg or .m4a) is required to detect and playback files]
On Android 10:
Ogg (.opus is recognised officially)

I completely agree that .webm is the wrong file extension, but seeing the list above makes me wonder if .opus the the best extension, too. People using VLC to play the downloaded files don't face any problems, but what about the "average" user? What could go wrong when using .ogg?

@TobiGr Anyone who downloads opus audio files on purpose would be aware which app can play them.

I think a better solution (keeping in mind the general user who doesn't know/care about this) would be to make the default selection under audio download be m4a instead of the highest bit rate one, which is generally opus. This would ensure that all Android versions can play the files.

This will probably also avoid a bad impression on users who downloaded Newpipe on the recommendation that it can download audio, only to find those files don't play with their music app.

@TobiGr What's your opinion on this? Since, as you said, proper Opus support has just been included in Android 10 (which is very weird, considering how fast Google jumped on the Opus bandwagon for Youtube) I think Newpipe should default to showing the m4a audio for downloading.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

desmonk picture desmonk  路  3Comments

PanderMusubi picture PanderMusubi  路  3Comments

Knowbody42 picture Knowbody42  路  3Comments

hassanseoul123 picture hassanseoul123  路  3Comments

probonopd picture probonopd  路  3Comments