@@ -21,18 +21,52 @@ public static async Task Run()
2121 Program . mainForm . SetWorking ( true ) ;
2222 Logger . Log ( "Analyzing streams... This can take a few minutes on slower hard drives." ) ;
2323
24+ int totalKbpsVid = 0 ;
25+ int totalKbpsAud = 0 ;
26+ int totalKbpsSub = 0 ;
27+
28+ long totalBytesVid = 0 ;
29+ long totalBytesAud = 0 ;
30+ long totalBytesSub = 0 ;
31+
2432 foreach ( MediaStreamListEntry entry in Program . mainForm . streamListBox . Items )
2533 {
2634 if ( RunTask . canceled || ! Program . mainForm . streamListBox . GetItemChecked ( Program . mainForm . streamListBox . Items . IndexOf ( entry ) ) )
2735 continue ;
2836
2937 Stream s = entry . Stream ;
3038 FfmpegUtils . StreamSizeInfo info = await FfmpegUtils . GetStreamSizeBytes ( TrackList . current . TruePath , s . Index ) ;
31- string percent = FormatUtils . RatioInt ( info . Bytes , TrackList . current . Size ) . ToString ( "0.0" ) ;
39+ string percent = FormatUtils . RatioFloat ( info . Bytes , TrackList . current . Size ) . ToString ( "0.0" ) ;
3240 string br = info . Kbps > 1 ? FormatUtils . Bitrate ( info . Kbps . RoundToInt ( ) ) : info . Kbps . ToString ( "0.0" ) + " kbps" ;
3341 Logger . Log ( $ "Stream #{ s . Index } ({ s . Type } ) - Bitrate: { br } - Size: { FormatUtils . Bytes ( info . Bytes ) } ({ percent } %)") ;
42+
43+ if ( s . Type == Stream . StreamType . Video )
44+ {
45+ totalKbpsVid += info . Kbps . RoundToInt ( ) ;
46+ totalBytesVid += info . Bytes ;
47+ }
48+
49+ if ( s . Type == Stream . StreamType . Audio )
50+ {
51+ totalKbpsAud += info . Kbps . RoundToInt ( ) ;
52+ totalBytesAud += info . Bytes ;
53+ }
54+
55+ if ( s . Type == Stream . StreamType . Subtitle )
56+ {
57+ totalKbpsSub += info . Kbps . RoundToInt ( ) ;
58+ totalBytesSub += info . Bytes ;
59+ }
3460 }
3561
62+ string totalPercentVid = FormatUtils . RatioFloat ( totalBytesVid , TrackList . current . Size ) . ToString ( "0.0" ) ;
63+ string totalPercentAud = FormatUtils . RatioFloat ( totalBytesAud , TrackList . current . Size ) . ToString ( "0.0" ) ;
64+ string totalPercentSub = FormatUtils . RatioFloat ( totalBytesSub , TrackList . current . Size ) . ToString ( "0.0" ) ;
65+
66+ Logger . Log ( $ "Total Video Bitrate: { FormatUtils . Bitrate ( totalKbpsVid ) } - Total Video Size: { FormatUtils . Bytes ( totalBytesVid ) } ({ totalPercentVid } %)") ;
67+ Logger . Log ( $ "Total Audio Bitrate: { FormatUtils . Bitrate ( totalKbpsAud ) } - Total Audio Size: { FormatUtils . Bytes ( totalBytesAud ) } ({ totalPercentAud } %)") ;
68+ Logger . Log ( $ "Total Subtitle Bitrate: { FormatUtils . Bitrate ( totalKbpsSub ) } - Total Subtitle Size: { FormatUtils . Bytes ( totalBytesSub ) } ({ totalPercentSub } %)") ;
69+
3670 Program . mainForm . SetWorking ( false ) ;
3771 }
3872 }
0 commit comments