mirror of
https://github.com/kkroening/ffmpeg-python.git
synced 2025-04-06 04:15:44 +08:00
Moved main logic of examples/show_progress.py to a separate function
This commit is contained in:
parent
df129c7ba3
commit
6330535dab
@ -108,7 +108,7 @@ def show_progress(total_duration):
|
|||||||
yield socket_filename
|
yield socket_filename
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def main():
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
total_duration = float(ffmpeg.probe(args.in_filename)['format']['duration'])
|
total_duration = float(ffmpeg.probe(args.in_filename)['format']['duration'])
|
||||||
|
|
||||||
@ -128,3 +128,6 @@ if __name__ == '__main__':
|
|||||||
print(e.stderr, file=sys.stderr)
|
print(e.stderr, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user