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
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
7
setup.py
7
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",
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue