diff --git a/src/devedeng/avconv.py b/src/devedeng/avconv.py index aabd94c..85cdb7a 100644 --- a/src/devedeng/avconv.py +++ b/src/devedeng/avconv.py @@ -219,7 +219,10 @@ class avconv(devedeng.avbase.avbase): self.command_var.append("-y") - vcd=False + vcd = False + + maxrate = int(file_project.video_rate_final * 1500) + minrate = int(file_project.video_rate_final * 666.66) if (self.config.disc_type == "divx"): self.command_var.append("-vcodec") @@ -262,10 +265,14 @@ class avconv(devedeng.avbase.avbase): self.command_var.append("30000/1001") self.command_var.append("-pix_fmt") self.command_var.append("yuv420p") - self.command_var.append("-maxrate") - self.command_var.append("9000000") - self.command_var.append("-minrate") - self.command_var.append("1500000") + self.command_var.append("-maxrate:v") + if maxrate > 9000000: + maxrate = 9000000 + self.command_var.append(str(maxrate)) + self.command_var.append("-minrate:v") + if minrate < 15000000: + minrate = 15000000 + self.command_var.append(str(minrate)) self.command_var.append("-bufsize") self.command_var.append("1835008") self.command_var.append("-packetsize") @@ -354,9 +361,13 @@ class avconv(devedeng.avbase.avbase): self.command_var.append("-pix_fmt") self.command_var.append("yuv420p") self.command_var.append("-maxrate:v") - self.command_var.append("2516000") + if maxrate > 2516000: + maxrate = 2516000 + self.command_var.append(str(maxrate)) self.command_var.append("-minrate:v") - self.command_var.append("1145000") + if minrate < 1145000: + minrate = 1145000 + self.command_var.append(str(minrate)) self.command_var.append("-bufsize") self.command_var.append("1835008") self.command_var.append("-packetsize") diff --git a/src/devedeng/ffmpeg.py b/src/devedeng/ffmpeg.py index 4fad70f..478c940 100644 --- a/src/devedeng/ffmpeg.py +++ b/src/devedeng/ffmpeg.py @@ -217,7 +217,6 @@ class ffmpeg(devedeng.executor.executor): maxrate = int(file_project.video_rate_final * 1500) minrate = int(file_project.video_rate_final * 666.66) - if (self.config.disc_type == "divx"): self.command_var.append("-vcodec") self.command_var.append("mpeg4") @@ -354,17 +353,14 @@ class ffmpeg(devedeng.executor.executor): self.command_var.append("480x480") self.command_var.append("-pix_fmt") self.command_var.append("yuv420p") + self.command_var.append("-maxrate:v") if maxrate > 2516000: maxrate = 2516000 self.command_var.append(str(maxrate)) - self.command_var.append("-minrate") + self.command_var.append("-minrate:v") if minrate < 1145000: minrate = 1145000 self.command_var.append(str(minrate)) - self.command_var.append("-maxrate:v") - self.command_var.append("2516000") - self.command_var.append("-minrate:v") - self.command_var.append("1145000") self.command_var.append("-bufsize") self.command_var.append("1835008") self.command_var.append("-packetsize")