Moved main logic of examples/show_progress.py to a separate function

This commit is contained in:
David Singh 2024-03-29 22:44:04 +07:00
parent df129c7ba3
commit 6330535dab

View File

@ -108,7 +108,7 @@ def show_progress(total_duration):
yield socket_filename
if __name__ == '__main__':
def main():
args = parser.parse_args()
total_duration = float(ffmpeg.probe(args.in_filename)['format']['duration'])
@ -128,3 +128,6 @@ if __name__ == '__main__':
print(e.stderr, file=sys.stderr)
sys.exit(1)
if __name__ == '__main__':
main()