TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
29.47k stars 2.95k forks source link

[Feature request] Codec selection instead of format #3159

Open opusforlife2 opened 4 years ago

opusforlife2 commented 4 years ago

What matters is that the user should be able to select the most efficient codec if they have the required hardware decoder, or a battery friendly/non-CPU-intensive codec if they don't. The container format doesn't really matter.

So I think it would be better to offer these options in order from most efficient to least:

Video:

Audio:

Can Newpipe query the OS for available hardware decoders? If so, it should select the most efficient codec by default whose hardware decoder is available.

wb9688 commented 4 years ago

Our video playback should be really improved. I don't know anything about the ExoPlayer side of things though. What we should do is add all the Itags to NewPipeExtractor (i.e. TeamNewPipe/NewPipeExtractor#71, which I opened years ago, e.g. we don't extract AV1 streams at all), and properly implement DASH support. We should also indeed automatically detect what codec to use, instead of having a setting that defaults to MPEG-4

opusforlife2 commented 4 years ago

Any progress on this, @wb9688? I'm also interested in seeing if this possibly solves the #2934 weirdness as well.

opusforlife2 commented 3 years ago

I don't know anything about the ExoPlayer side of things though.

@Redirion does. What say, Red?

Redirion commented 3 years ago

I need to check, if we can obtain the name of the decoder or, probably more meaningful, the extractor score of each decoder and then select the one with the highest score as this most likely indicates an efficient decoder.

wb9688 commented 3 years ago

@Redirion: While of course also keeping in mind what codecs a device supports (preferably hardware accelerated)…

Stypox commented 3 years ago

Closing in favour of #4358

opusforlife2 commented 3 years ago

Reopening after discussion.

shockergit commented 2 years ago

Dont remove the format options please. just add this without removing format

opusforlife2 commented 2 years ago

@shockergit Why?

shockergit commented 2 years ago

@shockergit Why?

3gp consumes less data especially good when listening podcasts.

opusforlife2 commented 2 years ago

@shockergit 3GPP will be included in the list of codecs available for you to select.

shockergit commented 2 years ago

@shockergit 3GPP will be included in the list of codecs available for you to select.

thank you soo much my lord. 🙏

opusforlife2 commented 2 years ago

Lol, calm down, it's just how the logic of the code will work. No extra effort needs to go into including it.

Edit: BTW, you'll actually use more data if you use 3GPP instead of an audio-only codec, like opus or m4a. For most streams, those two will be the lowest data use options. You should be using background playback for all podcasts.

shockergit commented 2 years ago

Lol, calm down, it's just how the logic of the code will work. No extra effort needs to go into including it.

Edit: BTW, you'll actually use more data if you use 3GPP instead of an audio-only codec, like opus or m4a. For most streams, those two will be the lowest data use options. You should be using background playback for all podcasts.

If we set 3gpp and run the app in background it will stream only audio right?

opusforlife2 commented 2 years ago

@shockergit The 3GPP option is for video streams only. So no, when you use the background play option, it is ignored completely. Only the audio format setting (opus vs m4a) is checked and the correct audio stream loaded.

shockergit commented 2 years ago

@shockergit The 3GPP option is for video streams only. So no, when you use the background play option, it is ignored completely. Only the audio format setting (opus vs m4a) is checked and the correct audio stream loaded.

yes thats all i wanted. so if we run the app minimizing no video is streamed right?

opusforlife2 commented 2 years ago

@shockergit Correct.

n-ce commented 2 years ago

@opusforlife2 Can you discuss about this?

  1. Setting for UltraLow Bandwidth Audio Mode for 50kbps Opus Background Playback, I use vanced only for this one reason.
  2. Setting for Forced AV1/VP9/AVC mode , if the desired codec is not available switch to available one.
opusforlife2 commented 2 years ago

@n-ce The app already falls back to the available container format when the default one isn't available. I don't see why this behaviour wouldn't be retained for codec selection. Regarding your second point, see https://github.com/TeamNewPipe/NewPipe/issues/1583#issuecomment-800014739. ;)

n-ce commented 2 years ago

Reasoning is clear For no. 1. Data speed reduces to theoretical 64kbps (actual 55kbps), currently no other app than the youtube app itself can stream audio smoothly at that speed. Audio playing smoothness : Youtube Background Play > Spotify data saver > Ymusic compact mode > Newpipe background play.

For no. 2. Some people want highest quality codec playing in their phones and not care about hw support so theyd likely want av1 always. Some people want to conserve battery and hardware support in old phones theyd want AVC.

opusforlife2 commented 1 year ago

This is implemented in Piped.

SyCoREAPER commented 8 months ago

This has my vote. AV1 is a big deal and as are being able to select other codecs as well.

The one feature I I really like on Smart tube that's missing here.

tsilvs commented 1 month ago

h264ify browser extension implements forced codec selection for better performance & lower resource consumption.

foxjaw commented 1 month ago

@tsilvs It has nothing to do with this project. Please stick to this feature request only. No offtopic discussions please.