diff --git a/HISTORY.md b/HISTORY.md index 9b12f8f..11fd64f 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,8 @@ # History of versions # +* version 4.12.0 (2018-06-28) + * Now ensures that the audio bitrate is always a legal value + * version 4.11.0 (2018-05-01) * Added support for XFBurn * Added experimental support for 16:9 menues diff --git a/setup.cfg b/setup.cfg index bf95f8e..919fde2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,3 @@ [bdist_rpm] release: 1 -requires: python3 python3-urllib3 python3-gobject gtk3 dvdauthor vcdimager python3-setuptools python3-cairo +Requires: gettext python3 python3-urllib3 python3-gobject gtk3 dvdauthor vcdimager python3-setuptools python3-cairo diff --git a/setup.py b/setup.py index 0da5353..70503b2 100755 --- a/setup.py +++ b/setup.py @@ -68,8 +68,11 @@ def compile_translations(): except: pass +try: + compile_translations() +except: + print("Failed to generate the translations") -compile_translations() try: if os.path.isfile('data/devede.1'): os.system("gzip -c data/devede.1 > data/devede.1.gz") @@ -81,7 +84,7 @@ except: setup( name='devedeng', - version='4.11.0', + version='4.12.0', description='A video DVD creator', long_description="A program that allows to create video DVDs", diff --git a/src/devedeng/avconv.py b/src/devedeng/avconv.py index 4b05bc7..2020d22 100644 --- a/src/devedeng/avconv.py +++ b/src/devedeng/avconv.py @@ -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") diff --git a/src/devedeng/ffmpeg.py b/src/devedeng/ffmpeg.py index e70d61b..d9f86f2 100644 --- a/src/devedeng/ffmpeg.py +++ b/src/devedeng/ffmpeg.py @@ -125,7 +125,7 @@ class ffmpeg(devedeng.executor.executor): # add it as a child process of this one self.add_child_process(tmp) else: - self.text = _("Converting %(X)s") % {"X": file_project.title_name} + self.text = ("Converting %(X)s") % {"X": file_project.title_name} if (pass2 == False) and (file_project.two_pass_encoding == True): # this is the first pass in a 2-pass codification @@ -473,7 +473,7 @@ class ffmpeg(devedeng.executor.executor): 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)) @@ -489,11 +489,20 @@ class ffmpeg(devedeng.executor.executor): 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: + print(a) + return a + print("384b") + 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 self.final_length = float(sound_length) - self.text = _("Creating menu %(X)d") % {"X": self.n_page} + self.text = ("Creating menu %(X)d") % {"X": self.n_page} self.command_var = [] self.command_var.append("ffmpeg") @@ -532,7 +541,7 @@ class ffmpeg(devedeng.executor.executor): 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")