Support for custom output bitrate, e.g. to target //gs in 2.8MHz mode.

For some reason playback speed is only about 1.6x (probably due to
slowing down accesses to the I/O page to 1MHz, so as not to mess up
hardware timings), but happily this comes within 3% of being 44100/2.
This commit is contained in:
kris
2019-07-14 22:05:20 +01:00
parent 35f999bc8a
commit 451523bdef
3 changed files with 34 additions and 9 deletions

View File

@@ -20,6 +20,11 @@ parser.add_argument(
'--audio_normalization', type=float, default=None,
help='Override auto-detected multiplier for audio normalization.'
)
parser.add_argument(
'--audio_bitrate', type=int, default=14700,
help='Select output audio bitrate (Hz), controls video speed (Default: '
'14700; try 22500 for //gs 2.8MHz mode)'
)
parser.add_argument(
'--every_n_video_frames', type=int, default=2,
help='Allows skipping frames of input video to lower effective output '
@@ -42,6 +47,7 @@ def main(args):
m = movie.Movie(
filename,
every_n_video_frames=args.every_n_video_frames,
audio_bitrate=args.audio_bitrate,
audio_normalization=args.audio_normalization,
max_bytes_out=1024. * 1024 * args.max_output_mb,
video_mode=video_mode.VideoMode[args.video_mode],