@@ -48,8 +48,6 @@ public Converter()
48
48
49
49
private void ImportButton_Click ( object sender , RoutedEventArgs e )
50
50
{
51
- JoinVideosButton . IsEnabled = false ;
52
-
53
51
importAVDialog . ShowDialog ( ) ;
54
52
if ( importAVDialog . CheckFileExists )
55
53
{
@@ -97,32 +95,26 @@ private void ExportButton_Click(object sender, RoutedEventArgs e)
97
95
private void ConvertButton_Click ( object sender , RoutedEventArgs e )
98
96
{
99
97
string args = "" ;
100
- if ( JoinVideosButton . IsEnabled )
98
+
99
+ args = "-i \" " + inputFile + "\" " ;
100
+ string output = Path . GetExtension ( outputFile ) == ".png" ? "\" " + outputFile . Substring ( 0 , outputFile . LastIndexOf ( '.' ) ) + "_%03d.png\" " : " \" " + saveAVDialog . FileName + "\" " ;
101
+ if ( Path . GetExtension ( outputFile ) == ".png" ) { args += " -vf fps=" + IntervalSnagBox . Text + " " ; }
102
+ if ( CutStartTextbox . Text == "00:00:00.0" && EndOfVideoCheckbox . IsChecked == true )
101
103
{
102
- args = "-f concat -i file -list.txt -c copy " + saveAVDialog . FileName ;
104
+ if ( openMergeDialog . FileName != "" && openSubtitlesDialog . FileName != "" ) { System . Windows . Forms . MessageBox . Show ( "" ) ; }
105
+ else if ( openSubtitlesDialog . FileName != "" ) { args += " -i \" " + openSubtitlesDialog . FileName + "\" - map 0 - map 1 - c copy - c:v" ; }
106
+ else if ( openMergeDialog . FileName != "" ) { args += " -i \" " + openMergeDialog . FileName + "\" -c:v copy -c:a aac -map 0:v:0 -map 1:a:0" ; }
103
107
}
104
108
else
105
109
{
106
- args = "-i \" " + inputFile + "\" " ;
107
- string output = Path . GetExtension ( outputFile ) == ".png" ? "\" " + outputFile . Substring ( 0 , outputFile . LastIndexOf ( '.' ) ) + "_%03d.png\" " : " \" " + saveAVDialog . FileName + "\" " ;
108
- if ( Path . GetExtension ( outputFile ) == ".png" ) { args += " -vf fps=" + IntervalSnagBox . Text + " " ; }
109
- if ( CutStartTextbox . Text == "00:00:00.0" && EndOfVideoCheckbox . IsChecked == true )
110
- {
111
- if ( openMergeDialog . FileName != "" && openSubtitlesDialog . FileName != "" ) { System . Windows . Forms . MessageBox . Show ( "" ) ; }
112
- else if ( openSubtitlesDialog . FileName != "" ) { args += "-i " + openSubtitlesDialog . FileName + " - map 0 - map 1 - c copy - c:v" ; }
113
- else if ( openMergeDialog . FileName != "" ) { args += "-i " + openMergeDialog . FileName + " -c:v copy -c:a aac -strict experimental" ; }
114
- }
110
+ if ( openMergeDialog . FileName != "" || openSubtitlesDialog . FileName != "" ) { System . Windows . Forms . MessageBox . Show ( "" ) ; }
115
111
else
116
112
{
117
- if ( openMergeDialog . FileName != "" || openSubtitlesDialog . FileName != "" ) { System . Windows . Forms . MessageBox . Show ( "" ) ; }
118
- else
119
- {
120
- args += " -ss " + CutStartTextbox . Text ;
121
- args += EndOfVideoCheckbox . IsChecked == true ? "" : " -to " + CutEndTextbox . Text + " " ;
122
- }
113
+ args += " -ss " + CutStartTextbox . Text ;
114
+ args += EndOfVideoCheckbox . IsChecked == true ? "" : " -to " + CutEndTextbox . Text + " " ;
123
115
}
124
- args += output ;
125
116
}
117
+ args += output ;
126
118
127
119
ffMpegProc . StartInfo . Arguments = args ;
128
120
ffMpegProc . StartInfo . UseShellExecute = false ;
@@ -136,7 +128,7 @@ private void ConvertButton_Click(object sender, RoutedEventArgs e)
136
128
137
129
ffMpegProc . Start ( ) ;
138
130
139
- CancelButton . Visibility = CancelJoinButton . Visibility = CancelMergeButton . Visibility = CancelSubsButton . Visibility = Visibility . Hidden ;
131
+ CancelButton . Visibility = CancelMergeButton . Visibility = CancelSubsButton . Visibility = Visibility . Hidden ;
140
132
141
133
EndOfVideoCheckbox . IsEnabled = ConvertButton . IsEnabled = ExportButton . IsEnabled = ImportButton . IsEnabled = false ;
142
134
MergeButton . IsEnabled = CutStartTextbox . IsEnabled = EndOfVideoCheckbox . IsEnabled = AddSubsButton . IsEnabled = false ;
@@ -155,7 +147,7 @@ private void ffMpegProc_Exited(object sender, EventArgs e)
155
147
ConvertFromLabel . Content = "" ;
156
148
ConvertToLabel . Content = "" ;
157
149
158
- ImportButton . IsEnabled = CutStartTextbox . IsEnabled = EndOfVideoCheckbox . IsEnabled = JoinVideosButton . IsEnabled = true ;
150
+ ImportButton . IsEnabled = CutStartTextbox . IsEnabled = EndOfVideoCheckbox . IsEnabled = true ;
159
151
160
152
StatusLabel . Content = Localization . Strings . Done ;
161
153
} ) ) ;
@@ -167,43 +159,16 @@ private void EndOfVideoCheckbox_CheckedChanged(object sender, EventArgs e)
167
159
CutEndTextbox . Text = "0000000" ;
168
160
}
169
161
170
- private void JoinVideosButton_Click ( object sender , EventArgs e )
171
- {
172
- ImportButton . IsEnabled = false ;
173
- AddSubsButton . IsEnabled = false ;
174
- IntervalSnagBox . IsEnabled = false ;
175
- MergeButton . IsEnabled = false ;
176
- CancelJoinButton . Visibility = Visibility . Visible ;
177
-
178
- /*openVideoListDialog.ShowDialog();
179
-
180
- if (openVideoListDialog.CheckFileExists)
181
- {
182
- ExportButton.IsEnabled = true;
183
- }*/
184
- }
185
-
186
162
private void CancelImportButton_Click ( object sender , EventArgs e )
187
163
{
188
164
importAVDialog . FileName = "" ;
189
165
inputFile = "" ;
190
166
191
167
OriginalFileLabel . Content = "" ;
192
168
193
- JoinVideosButton . IsEnabled = true ;
194
169
CancelButton . Visibility = Visibility . Hidden ;
195
170
}
196
171
197
- private void CancelJoinButton_Click ( object sender , EventArgs e )
198
- {
199
- ConvertButton . IsEnabled = false ;
200
- ImportButton . IsEnabled = true ;
201
-
202
- //openVideoListDialog.FileName = ""; Will implement later
203
-
204
- CancelJoinButton . Visibility = Visibility . Hidden ;
205
- }
206
-
207
172
private void AddSubsButton_Click ( object sender , EventArgs e )
208
173
{
209
174
CancelSubsButton . Visibility = Visibility . Visible ;
@@ -218,20 +183,9 @@ private void AddSubsButton_Click(object sender, EventArgs e)
218
183
219
184
private void MergeButton_Click ( object sender , EventArgs e )
220
185
{
221
- if ( videoFormats . Any ( Path . GetExtension ( inputFile ) . Contains ) )
222
- {
223
- CancelMergeButton . Visibility = Visibility . Visible ;
224
- AddSubsButton . IsEnabled = false ;
225
- openMergeDialog . Filter = videoFilter ;
226
- openMergeDialog . ShowDialog ( ) ;
227
- }
228
- else if ( audioFormats . Any ( Path . GetExtension ( inputFile ) . Contains ) )
229
- {
230
- AddSubsButton . IsEnabled = false ;
231
- CancelMergeButton . Visibility = Visibility . Visible ;
232
- openMergeDialog . FileName = audioFilter ;
233
- openMergeDialog . ShowDialog ( ) ;
234
- }
186
+ CancelMergeButton . Visibility = Visibility . Visible ;
187
+ AddSubsButton . IsEnabled = false ;
188
+ openMergeDialog . ShowDialog ( ) ;
235
189
}
236
190
237
191
private void CancelMergeButton_Click ( object sender , EventArgs e )
0 commit comments