audiobanner: supports --intro and --outro
+ small refactoring
This commit is contained in:
parent
0df98bacad
commit
c023462ef3
1 changed files with 13 additions and 4 deletions
|
@ -13,10 +13,17 @@ def mix(args):
|
|||
'-o', 'orig_@n_@m.mp3',
|
||||
'-t', interval,
|
||||
args.original])
|
||||
ffmpegconcat = 'concat:%s' % args.banner
|
||||
parts = []
|
||||
if args.intro:
|
||||
parts.append(args.intro)
|
||||
for part in sorted(os.listdir(tempdir)):
|
||||
ffmpegconcat += '|%s|%s' % (os.path.join(tempdir, part),
|
||||
args.banner)
|
||||
parts += [os.path.join(tempdir, part),
|
||||
args.banner]
|
||||
parts.pop()
|
||||
if args.outro:
|
||||
parts.append(args.outro)
|
||||
|
||||
ffmpegconcat = 'concat:%s' % "|".join(parts)
|
||||
|
||||
cmd = ['ffmpeg', '-i', ffmpegconcat,
|
||||
'-loglevel', 'error', '-n',
|
||||
|
@ -26,7 +33,9 @@ def mix(args):
|
|||
|
||||
def get_parser():
|
||||
p = argparse.ArgumentParser("audiobanner")
|
||||
p.add_argument("--interval", help='In seconds', default=60, type=int)
|
||||
p.add_argument("--interval", help='In seconds', default=600, type=int)
|
||||
p.add_argument("--intro", type=str)
|
||||
p.add_argument("--outro", type=str)
|
||||
p.add_argument("original")
|
||||
p.add_argument("banner")
|
||||
p.add_argument("destination")
|
||||
|
|
Loading…
Reference in a new issue