Skip to content

Instantly share code, notes, and snippets.

@xZise
Created April 26, 2014 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xZise/11329603 to your computer and use it in GitHub Desktop.
Save xZise/11329603 to your computer and use it in GitHub Desktop.
found = -2
if args.inposition < 0:
args.inposition %= len([s for s in video.streams if s.fftype == "a"])
args.inposition += 1
i = 0
left = args.inposition
for stream in video.streams:
if stream.fftype != "v" and found < -1:
found = -1
if left == 0 and found == -1:
params += ["-map", "1:a:{}".format(args.outposition)]
found = i
if stream.fftype == "a":
left -= 1
params += ["-map", "0:{}".format(i)]
i += 1
if found < 0:
params += ["-map", "1:a:{}".format(args.outposition)]
found = i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment