Now adjusts the audio bitrate to ensure that it is legal for MP2
This commit is contained in:
parent
6c1a186bb0
commit
f0893b3ff7
5 changed files with 31 additions and 9 deletions
|
|
@ -478,7 +478,7 @@ class avconv(devedeng.avbase.avbase):
|
|||
|
||||
if (vcd == False) and (file_project.no_reencode_audio_video == False):
|
||||
self.command_var.append("-b:a")
|
||||
self.command_var.append(str(file_project.audio_rate_final*1000))
|
||||
self.command_var.append(str(self._adjust_audio_bitrate(file_project.audio_rate_final)*1000))
|
||||
|
||||
self.command_var.append("-b:v")
|
||||
self.command_var.append(str(file_project.video_rate_final*1000))
|
||||
|
|
@ -494,6 +494,13 @@ class avconv(devedeng.avbase.avbase):
|
|||
|
||||
self.command_var.append(output_file)
|
||||
|
||||
def _adjust_audio_bitrate(self, bitrate):
|
||||
br = [32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384]
|
||||
for a in br:
|
||||
if a >= bitrate:
|
||||
return a
|
||||
return 384
|
||||
|
||||
def create_menu_mpeg(self, n_page, background_music, sound_length, pal, video_rate, audio_rate, output_path, use_mp2, widescreen):
|
||||
|
||||
self.n_page = n_page
|
||||
|
|
@ -537,7 +544,7 @@ class avconv(devedeng.avbase.avbase):
|
|||
self.command_var.append("-b:v")
|
||||
self.command_var.append(str(video_rate) + "k")
|
||||
self.command_var.append("-b:a")
|
||||
self.command_var.append(str(audio_rate) + "k")
|
||||
self.command_var.append(str(self._adjust_audio_bitrate(audio_rate)) + "k")
|
||||
self.command_var.append("-aspect")
|
||||
if widescreen:
|
||||
self.command_var.append("16:9")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue