Added ability to specify audio channels and sample rate #1283

Closed
wants to merge 3 commits into
from

3 participants

@schmoofer

Added option to specify number of channels for audio extraction. Also added support for specifying sample rate as part of the "audio quality" parameter. Integers greater than 8000 will be interpreted as the sampling rate, thus 8000 is the minimal.

David added some commits Aug 20, 2013
David Update __init__.py
Added option to set channels for audio extraction. Audio quality also supports sample rate integers.
8ba6683
David Update PostProcessor.py
Added option to set channels for audio extraction. Audio quality also supports sample rate integers.
871fd35
@jaimeMF
Collaborator

According to the ffmpeg docs the -ac option is set by default to the number of input audio channels, with your commit it will be 2 by default. I think the default value of the --audio-channels should be None, so that it's not overwritten.

@schmoofer
@jaimeMF jaimeMF commented on the diff Oct 14, 2013
youtube_dl/PostProcessor.py
more_opts += [self._exes['avconv'] and '-b:a' or '-ab', self._preferredquality + 'k']
+ else:
+ more_opts += [self._exes['avconv'] and '-ar', self._preferredquality]
@jaimeMF
Collaborator
jaimeMF added a line comment Oct 14, 2013

This option is also available in ffmpeg, ['-ar', self._preferredquality] shoudl be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@phihag phihag commented on the diff Oct 15, 2013
youtube_dl/__init__.py
postproc.add_option('--recode-video', metavar='FORMAT', dest='recodevideo', default=None,
help='Encode the video to another format if necessary (currently supported: mp4|flv|ogg|webm)')
postproc.add_option('-k', '--keep-video', action='store_true', dest='keepvideo', default=False,
help='keeps the video file on disk after the post-processing; the video is erased by default')
postproc.add_option('--no-post-overwrites', action='store_true', dest='nopostoverwrites', default=False,
help='do not overwrite post-processed files; the post-processed files are overwritten by default')
-
+ postproc.add_option('--audio-channels', metavar='CHANNELS', dest='audiochannels', default=None,
+ help='choose between 1 or 2 channels')
@phihag
Collaborator
phihag added a line comment Oct 15, 2013

This help is insufficient for the user - when should I ever use this option? What about 5.1 videos - am I breaking those when specifying the option? Can I recode to 4.1 with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@phihag
Collaborator

I'm still not sure what this option would be used for, and there has been no update since my inquiry well over a year ago. I must therefore sadly reject this PR. Feel free to comment and provide context for this PR and we will re-discuss it. Thanks!

@phihag phihag closed this Jan 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment