NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

[Feature request] Codec selection instead of format

Open opusforlife2 opened this issue 4 years ago • 24 comments

  • [x] I checked if the issue/feature exists in the latest version.

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:

  • AV1 (if Android 10+)
  • VP9
  • AVC/H.264

Audio:

  • Opus
  • AAC

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.

opusforlife2 avatar Feb 29 '20 05:02 opusforlife2

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

wb9688 avatar Feb 29 '20 06:02 wb9688

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

opusforlife2 avatar Jun 06 '20 00:06 opusforlife2

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

@Redirion does. What say, Red?

opusforlife2 avatar Sep 09 '20 13:09 opusforlife2

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.

Redirion avatar Sep 10 '20 07:09 Redirion

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

wb9688 avatar Sep 10 '20 08:09 wb9688

Closing in favour of #4358

Stypox avatar Sep 30 '20 13:09 Stypox

Reopening after discussion.

opusforlife2 avatar Sep 30 '20 14:09 opusforlife2

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

shockergit avatar Nov 26 '21 17:11 shockergit

@shockergit Why?

opusforlife2 avatar Nov 26 '21 17:11 opusforlife2

@shockergit Why?

3gp consumes less data especially good when listening podcasts.

shockergit avatar Nov 26 '21 18:11 shockergit

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

opusforlife2 avatar Nov 26 '21 18:11 opusforlife2

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

thank you soo much my lord. 🙏

shockergit avatar Nov 26 '21 19:11 shockergit

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.

opusforlife2 avatar Nov 26 '21 19:11 opusforlife2

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?

shockergit avatar Nov 26 '21 19:11 shockergit

@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.

opusforlife2 avatar Nov 26 '21 19:11 opusforlife2

@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?

shockergit avatar Nov 26 '21 19:11 shockergit

@shockergit Correct.

opusforlife2 avatar Nov 26 '21 19:11 opusforlife2

@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.

n-ce avatar Jan 25 '22 15:01 n-ce

@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. ;)

opusforlife2 avatar Jan 25 '22 17:01 opusforlife2

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.

n-ce avatar Jan 26 '22 02:01 n-ce

This is implemented in Piped.

opusforlife2 avatar Aug 23 '22 23:08 opusforlife2

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.

SyCoREAPER avatar Oct 24 '23 02:10 SyCoREAPER

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

tsilvs avatar May 29 '24 11:05 tsilvs

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

foxjaw avatar Jun 01 '24 10:06 foxjaw