Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to add multi-channel into my format selection config can, can I do that? #22409

Open
3 tasks done
mzso opened this issue Sep 15, 2019 · 6 comments
Open
3 tasks done
Labels

Comments

@mzso
Copy link

mzso commented Sep 15, 2019

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

Hello!
I already have a convoluted format selection configuration, that I got with some help. Which prefers opus over Vorbis over AAC. (Also video with resolution preferred over format up to a certain size, otherwise vp9 preferred)
But recently I noticed that new higher bitrate multi-channel audio streams (formats 258, 256) were added which makes sense to be preferred, but apparently only in AAC. So I'd like to add them somehow.

-f "(bestvideo[vcodec=vp9]/bestvideo[vcodec^=avc]/bestvideo[vcodec!=vp8])[height<=1440]+(bestaudio[acodec=opus]/bestaudio[acodec=vorbis]/bestaudio[acodec^=m4a]/bestaudio)/(best[vcodec=vp9]/best[vcodec^=avc]/best[vcodec!=vp8])[height<=1440]"

Example video:
https://www.youtube.com/watch?v=_ttYSpt8oiw

Or should I just revert to bestaudio? I don't know if bestaudio actually selects bestaudio, or tries to combine AAC for AVC and opus/vorbis to VP9. Besed on the formats available for the example video it might work if bestaudio only looks at bitrate only. Though I'm not sure if there are videos with residual stereo AAC streams of higher bitrate than opus which I don't want. Or vorbis streams for which the bitrate I don't remember.

@mzso mzso added the question label Sep 15, 2019
@dstftw
Copy link
Collaborator

dstftw commented Sep 15, 2019

@dstftw dstftw closed this as completed Sep 15, 2019
@mzso
Copy link
Author

mzso commented Sep 15, 2019

@dstftw commented on 2019. szept. 15. 12:35 CEST:

https://github.com/ytdl-org/youtube-dl#format-selection

Yeah, well it's a tad complicated. And it's difficult to test without videos that have every single format possible.

@mzso
Copy link
Author

mzso commented Sep 23, 2019

Doesn't format selection have channel number meta fields?
Otherwise I'm not sure what I want is possible in a generic way.

@mzso
Copy link
Author

mzso commented Sep 23, 2019

This attempted workaround doesn't seem to work at all:
-f "(bestvideo[vcodec=vp9]/bestvideo[vcodec^=avc]/bestvideo[vcodec!=vp8])[height<=1440]+(bestaudio[acodec=opus][abr>170]/bestaudio[acodec=vorbis][abr>170]/bestaudio[abr>170]/bestaudio[acodec=opus]/bestaudio[acodec=vorbis]/bestaudio/[acodec^=m4a]/bestaudio)/(best[vcodec=vp9]/best[vcodec^=avc]/best[vcodec!=vp8])[height<=1440]"

@remitamine
Copy link
Collaborator

the number of audio channels has to be introduced(documented) and extracted.

{
    'itag': 258,
    'url': '[URL]',
    'mimeType': 'audio/mp4; codecs="mp4a.40.2"',
    'bitrate': 386741,
    'initRange': {
        'start': '0',
        'end': '591'
    },
    'indexRange': {
        'start': '592',
        'end': '743'
    },
    'lastModified': '1540024145491026',
    'contentLength': '4485228',
    'quality': 'tiny',
    'projectionType': 'RECTANGULAR',
    'averageBitrate': 385333,
    'audioQuality': 'AUDIO_QUALITY_HIGH',
    'approxDurationMs': '93119',
    'audioSampleRate': '48000',
    'audioChannels': 6
}

@remitamine remitamine reopened this Sep 23, 2019
@mzso
Copy link
Author

mzso commented Sep 23, 2019

@remitamine commented on 2019. szept. 23. 16:04 CEST:

the number of audio channels has to be introduced(documented) and extracted.

Cool. But I also can't figure out why my workaround with bitrate > 170 doesn't work.
Apart from the above I also tried:
-f "(bestvideo[vcodec=vp9]/bestvideo[vcodec^=avc]/bestvideo[vcodec!=vp8])[height<=1440]+((bestaudio[acodec=opus]/bestaudio[acodec=vorbis]/bestaudio)[abr>170]/bestaudio[acodec=opus]/bestaudio[acodec=vorbis]/bestaudio[acodec^=m4a]/bestaudio)/(best[vcodec=vp9]/best[vcodec^=avc]/best[vcodec!=vp8])[height<=1440]"

Either I'm missing something or something's bugged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants