- If using the advanced encoding functions, it disable the audio properties.

This commit is contained in:
pabloalcantara
2011-08-25 14:28:54 -03:00
parent f85d78c452
commit f23fd3b09e
3 changed files with 49 additions and 31 deletions

View File

@@ -290,7 +290,9 @@
<option value=${x} ${outputselect}>${x}</option>
%endfor
</select></h4>
<br>
<h3>Audio Properties:</h3>
<br>
<h4>VBR/CBR: <select name="encodervbrcbr">
%for x in ['cbr', 'vbr']:
@@ -343,7 +345,11 @@
</select></h4>
<br>
<br>
<h3>Advance Encode Options:</h3><input type="text" name="advancedencoder" value="${config['advancedencoder']}" size="43">
<h3>Advance Encode Options:</h3>
<h4>
(ignores audio properties)
</h4>
<input type="text" name="advancedencoder" value="${config['advancedencoder']}" size="43">
<br>
<h3>Path to Encoder:</h3><input type="text" name="encoderfolder" value="${config['encoderfolder']}" size="43">
</td>

View File

@@ -290,7 +290,8 @@
<option value=${x} ${outputselect}>${x}</option>
%endfor
</select></h4>
<br>
<h3>Audio Properties:</h3>
<br>
<h4>VBR/CBR: <select name="encodervbrcbr">
%for x in ['cbr', 'vbr']:
@@ -343,8 +344,11 @@
</select></h4>
<br>
<br>
<h3>Advance Encode Options:</h3><input type="text" name="advancedencoder" value="${config['advancedencoder']}" size="43">
<br>
<h3>Advance Encode Options:</h3>
<h4>
(ignores audio properties)
</h4>
<input type="text" name="advancedencoder" value="${config['advancedencoder']}" size="43"><br>
<h3>Path to Encoder:</h3><input type="text" name="encoderfolder" value="${config['encoderfolder']}" size="43">
</td>
</tr>

View File

@@ -91,38 +91,46 @@ def command(encoder,musicSource,musicDest,albumPath):
cmd=''
startMusicTime=time.clock()
if headphones.ENCODER == 'lame':
cmd=encoder + ' -h'
if headphones.ENCODERVBRCBR=='cbr':
cmd=cmd+ ' --resample ' + str(headphones.SAMPLINGFREQUENCY) + ' -b ' + str(headphones.BITRATE)
elif headphones.ENCODERVBRCBR=='vbr':
if (ENCODERQUALITY>=0 and ENCODERQUALITY<=9):
cmd=cmd+' -V'+str(ENCODERQUALITY)
elif (ENCODERQUALITY<0):
cmd=cmd+' -V0'
elif (ENCODERQUALITY>9):
cmd=cmd+' -V9'
cmd=cmd+ ' ' + headphones.ADVANCEDENCODER
if headphones.ADVANCEDENCODER =='':
cmd=encoder + ' -h'
if headphones.ENCODERVBRCBR=='cbr':
cmd=cmd+ ' --resample ' + str(headphones.SAMPLINGFREQUENCY) + ' -b ' + str(headphones.BITRATE)
elif headphones.ENCODERVBRCBR=='vbr':
if (ENCODERQUALITY>=0 and ENCODERQUALITY<=9):
cmd=cmd+' -V'+str(ENCODERQUALITY)
elif (ENCODERQUALITY<0):
cmd=cmd+' -V0'
elif (ENCODERQUALITY>9):
cmd=cmd+' -V9'
cmd=cmd+ ' ' + headphones.ADVANCEDENCODER
else:
cmd=cmd+' '+ headphones.ADVANCEDENCODER
cmd=cmd+ ' "' + musicSource + '"'
cmd=cmd+ ' "' + musicDest +'"'
elif headphones.ENCODER == 'ffmpeg':
cmd=encoder+ ' -i'
cmd=cmd+ ' "' + musicSource + '"'
if headphones.ENCODEROUTPUTFORMAT=='ogg':
cmd=cmd+ ' -acodec libvorbis'
if headphones.ENCODEROUTPUTFORMAT=='m4a':
cmd=cmd+ ' -strict experimental'
if headphones.ENCODERVBRCBR=='cbr':
cmd=cmd+ ' -ar ' + str(headphones.SAMPLINGFREQUENCY) + ' -ab ' + str(headphones.BITRATE) + 'k'
elif headphones.ENCODERVBRCBR=='vbr':
if (ENCODERQUALITY>=0 and ENCODERQUALITY<=9):
cmd=cmd+' -aq '+str(ENCODERQUALITY)
elif (ENCODERQUALITY<0):
cmd=cmd+' -aq 0'
elif (ENCODERQUALITY>9):
cmd=cmd+' -aq 9'
cmd=cmd+ ' -y -ac 2 -map_metadata 0:0,s0 -vn'
cmd=cmd+ ' ' + headphones.ADVANCEDENCODER
if headphones.ADVANCEDENCODER =='':
if headphones.ENCODEROUTPUTFORMAT=='ogg':
cmd=cmd+ ' -acodec libvorbis'
if headphones.ENCODEROUTPUTFORMAT=='m4a':
cmd=cmd+ ' -strict experimental'
if headphones.ENCODERVBRCBR=='cbr':
cmd=cmd+ ' -ar ' + str(headphones.SAMPLINGFREQUENCY) + ' -ab ' + str(headphones.BITRATE) + 'k'
elif headphones.ENCODERVBRCBR=='vbr':
if (ENCODERQUALITY>=0 and ENCODERQUALITY<=9):
cmd=cmd+' -aq '+str(ENCODERQUALITY)
elif (ENCODERQUALITY<0):
cmd=cmd+' -aq 0'
elif (ENCODERQUALITY>9):
cmd=cmd+' -aq 9'
cmd=cmd+ ' -y -ac 2 -map_metadata 0:0,s0 -vn'
else:
cmd=cmd+' '+ headphones.ADVANCEDENCODER
cmd=cmd+ ' "' + musicDest + '"'
print cmd
time.sleep(10)
return_code = call(cmd, shell=True)
if (return_code==0) and (os.path.exists(musicDest)):
os.remove(musicSource)