@@ -721,6 +721,17 @@ def enableControls(self):
721
721
def accept (self ):
722
722
""" Start exporting video """
723
723
724
+ # Build the export window title
725
+ def titlestring (sec , fps , mess ):
726
+ formatstr = "%(hours)d:%(minutes)02d:%(seconds)02d " + mess + " (%(fps)5.2f FPS)"
727
+ title_mes = _ (formatstr ) % {
728
+ 'hours' : sec / 3600 ,
729
+ 'minutes' : (sec / 60 ) % 60 ,
730
+ 'seconds' : sec % 60 ,
731
+ 'fps' : fps }
732
+ return title_mes
733
+
734
+
724
735
# get translations
725
736
_ = get_app ()._tr
726
737
@@ -936,11 +947,7 @@ def accept(self):
936
947
if frame == end_frame_export :
937
948
title_message = _ ("Finalizing video export, please wait..." )
938
949
else :
939
- title_message = _ ("%(hours)d:%(minutes)02d:%(seconds)02d Remaining (%(fps)5.2f FPS)" ) % {
940
- 'hours' : seconds_left / 3600 ,
941
- 'minutes' : (seconds_left / 60 ) % 60 ,
942
- 'seconds' : seconds_left % 60 ,
943
- 'fps' : fps_encode }
950
+ title_message = titlestring (seconds_left , fps_encode , "Remaining" )
944
951
945
952
# Emit frame exported
946
953
get_app ().window .ExportFrame .emit (title_message , video_settings .get ("start_frame" ), video_settings .get ("end_frame" ), frame , progress_format )
@@ -960,11 +967,7 @@ def accept(self):
960
967
961
968
# Emit final exported frame (with elapsed time)
962
969
seconds_run = round ((end_time_export - start_time_export ))
963
- title_message = _ ("%(hours)d:%(minutes)02d:%(seconds)02d Elapsed (%(fps)5.2f FPS)" ) % {
964
- 'hours' : seconds_run / 3600 ,
965
- 'minutes' : (seconds_run / 60 ) % 60 ,
966
- 'seconds' : seconds_run % 60 ,
967
- 'fps' : fps_encode }
970
+ title_message = titlestring (seconds_left , fps_encode , "Elapsed" )
968
971
969
972
get_app ().window .ExportFrame .emit (title_message , video_settings .get ("start_frame" ),
970
973
video_settings .get ("end_frame" ), frame , progress_format )
@@ -1032,11 +1035,7 @@ def accept(self):
1032
1035
self .close_button .setVisible (True )
1033
1036
1034
1037
# Restore windows title to show elapsed time
1035
- title_message = _ ("%(hours)d:%(minutes)02d:%(seconds)02d Elapsed (%(fps)5.2f FPS)" ) % {
1036
- 'hours' : seconds_run / 3600 ,
1037
- 'minutes' : (seconds_run / 60 ) % 60 ,
1038
- 'seconds' : seconds_run % 60 ,
1039
- 'fps' : fps_encode }
1038
+ title_message = titlestring (seconds_left , fps_encode , "Elapsed" )
1040
1039
1041
1040
get_app ().window .ExportFrame .emit (title_message , video_settings .get ("start_frame" ),
1042
1041
video_settings .get ("end_frame" ), frame , progress_format )
0 commit comments