Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7675ad6

Browse files
committed
Clarify FFMPEG encoder/decoder
1 parent 214726a commit 7675ad6

File tree

2 files changed

+42
-31
lines changed

2 files changed

+42
-31
lines changed

Transcoder/MainForm.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ void MainForm_Load(object sender, EventArgs e)
5151
"-=====Lossless Encoders=====-",
5252
"-=======Lossless Copies=====-",
5353
"-=========Decoders========-",
54-
"-======Tracks/Regions======-",
54+
"-=====Tracks / Regions=====-",
5555
};
5656

5757
encoderComboBox.Items.Insert(0, new { Name = names[0] });
58-
encoderComboBox.Items.Insert(encoderComboBox.Items.IndexOf(TranscoderFile.Type.QTALAC), new { Name = names[1] });
59-
encoderComboBox.Items.Insert(encoderComboBox.Items.IndexOf(TranscoderFile.Type.AudioCopy), new { Name = names[2] });
60-
encoderComboBox.Items.Insert(encoderComboBox.Items.IndexOf(TranscoderFile.Type.WAV), new { Name = names[3] });
58+
encoderComboBox.Items.Insert(encoderComboBox.Items.IndexOf(TranscoderFile.Type.QT_ALAC), new { Name = names[1] });
59+
encoderComboBox.Items.Insert(encoderComboBox.Items.IndexOf(TranscoderFile.Type.FFMPEG_AudioCopy), new { Name = names[2] });
60+
encoderComboBox.Items.Insert(encoderComboBox.Items.IndexOf(TranscoderFile.Type.FFMPEG_WAV), new { Name = names[3] });
6161
encoderComboBox.Items.Insert(encoderComboBox.Items.IndexOf(TranscoderFile.Type.TracksCSV), new { Name = names[4] });
6262

63-
encoderComboBox.SelectedItem = TranscoderFile.Type.QTAAC;
63+
encoderComboBox.SelectedItem = TranscoderFile.Type.QT_AAC_CVBR;
6464
}
6565

6666
void Control_DragEnter(object sender, DragEventArgs e)
@@ -206,7 +206,7 @@ async void goButton_Click(object sender, EventArgs e)
206206
var outputFolder = outputTextbox.Text;
207207
TokenSource = new CancellationTokenSource();
208208

209-
if (encoderType == TranscoderFile.Type.SplitInput)
209+
if (encoderType == TranscoderFile.Type.FFMPEG_SplitInput)
210210
{
211211
var files = TranscoderFiles.ToList();
212212
fileIdx = files.Count;
@@ -290,9 +290,9 @@ await Task.Run(async () =>
290290
}
291291
}
292292

293-
if (encoderType == TranscoderFile.Type.SplitInput)
293+
if (encoderType == TranscoderFile.Type.FFMPEG_SplitInput)
294294
encoderType.FileExtension = Path.GetExtension(file.FileName);
295-
else if (encoderType == TranscoderFile.Type.AudioCopy)
295+
else if (encoderType == TranscoderFile.Type.FFMPEG_AudioCopy)
296296
encoderType.FileExtension = fileExtension;
297297

298298
using (var decoder = new Process())
@@ -301,7 +301,7 @@ await Task.Run(async () =>
301301
decoder.StartInfo = new ProcessStartInfo()
302302
{
303303
FileName = Path.Combine(Environment.CurrentDirectory, Encoder.FFMPEG.FilePath),
304-
Arguments = String.Format("-i \"{0}\" -vn -f wav {1} -", file.FilePath, TranscoderFile.Type.WAV.BitDepthArgs(file.Stream.BitDepth)),
304+
Arguments = String.Format("-i \"{0}\" -vn -f wav {1} -", file.FilePath, TranscoderFile.Type.FFMPEG_WAV.BitDepthArgs(file.Stream.BitDepth)),
305305
WindowStyle = ProcessWindowStyle.Hidden,
306306
CreateNoWindow = true,
307307
UseShellExecute = false,

Transcoder/TranscoderFile.cs

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ public class TranscoderFile
1212
#region Static Fields
1313

1414
public static Type[] Types = new Type[] {
15-
Type.QTAAC,
16-
Type.MP3CBR,
17-
Type.MP3VBR,
18-
Type.QTALAC,
15+
Type.QT_AAC_CVBR,
16+
Type.QT_AAC_TVBR,
17+
Type.FFMPEG_MP3_CBR,
18+
Type.FFMPEG_MP3_VBR,
19+
Type.QT_ALAC,
1920
Type.FFMPEG_ALAC,
20-
Type.FLAC,
21-
Type.AudioCopy,
22-
Type.SplitInput,
23-
Type.WAV,
21+
Type.FFMPEG_FLAC,
22+
Type.FFMPEG_AudioCopy,
23+
Type.FFMPEG_SplitInput,
24+
Type.FFMPEG_WAV,
2425
Type.TracksCSV,
2526
Type.RegionsCSV,
2627
};
@@ -176,9 +177,9 @@ public class Type
176177
{
177178
#region Static Fields
178179

179-
public static Type AudioCopy = new Type()
180+
public static Type FFMPEG_AudioCopy = new Type()
180181
{
181-
Name = "Copy Audio",
182+
Name = "FFMPEG Copy Audio",
182183
Encoder = Encoder.FFMPEG,
183184
CommandLineArgsWithoutDecoding = "-i \"{0}\" -vn -c:a copy -movflags +faststart -y \"{2}\"",
184185
IsAudioCopy = true
@@ -192,26 +193,26 @@ public class Type
192193
CommandLineArgsWithoutDecoding = "-i \"{0}\" -vn -c:a alac -movflags +faststart -metadata:s:a gapless_playback=2 -y \"{2}\""
193194
};
194195

195-
public static Type FLAC = new Type()
196+
public static Type FFMPEG_FLAC = new Type()
196197
{
197-
Name = "FLAC",
198+
Name = "FFMPEG FLAC",
198199
Encoder = Encoder.FFMPEG,
199200
FileExtension = ".flac",
200201
CommandLineArgsWithoutDecoding = "-i \"{0}\" -vn -y \"{2}\""
201202
};
202203

203-
public static Type MP3CBR = new Type()
204+
public static Type FFMPEG_MP3_CBR = new Type()
204205
{
205-
Name = "MP3 (CBR)",
206+
Name = "FFMPEG MP3 (CBR)",
206207
Encoder = Encoder.FFMPEG,
207208
FileExtension = ".mp3",
208209
IsBitrateRequired = true,
209210
CommandLineArgsWithoutDecoding = "-i \"{0}\" -vn -c:a libmp3lame -b:a {1}k -y \"{2}\""
210211
};
211212

212-
public static Type MP3VBR = new Type()
213+
public static Type FFMPEG_MP3_VBR = new Type()
213214
{
214-
Name = "MP3 (VBR)",
215+
Name = "FFMPEG MP3 (VBR)",
215216
Encoder = Encoder.FFMPEG,
216217
FileExtension = ".mp3",
217218
IsBitrateRequired = true,
@@ -228,7 +229,7 @@ public class Type
228229
}
229230
};
230231

231-
public static Type QTAAC = new Type()
232+
public static Type QT_AAC_CVBR = new Type()
232233
{
233234
Name = "QuickTime AAC (CVBR)",
234235
Encoder = Encoder.QAAC,
@@ -238,7 +239,17 @@ public class Type
238239
CommandLineArgsWithoutDecoding = "\"{0}\" --threading --gapless-mode 2 --copy-artwork -v{1} -o \"{2}\""
239240
};
240241

241-
public static Type QTALAC = new Type()
242+
public static Type QT_AAC_TVBR = new Type()
243+
{
244+
Name = "QuickTime AAC (TVBR)",
245+
Encoder = Encoder.QAAC,
246+
FileExtension = ".m4a",
247+
IsBitrateRequired = true,
248+
CommandLineArgsWithDecoding = "- --threading --gapless-mode 2 --copy-artwork -V{1} -o \"{2}\"",
249+
CommandLineArgsWithoutDecoding = "\"{0}\" --threading --gapless-mode 2 --copy-artwork -V{1} -o \"{2}\""
250+
};
251+
252+
public static Type QT_ALAC = new Type()
242253
{
243254
Name = "QuickTime ALAC",
244255
Encoder = Encoder.QAAC,
@@ -254,9 +265,9 @@ public class Type
254265
FileExtension = ".csv"
255266
};
256267

257-
public static Type SplitInput = new Type()
268+
public static Type FFMPEG_SplitInput = new Type()
258269
{
259-
Name = "Split Input File",
270+
Name = "FFMPEG Split File from Tracks CSV / Chapters XML",
260271
Encoder = Encoder.FFMPEG,
261272
CommandLineArgsWithoutDecoding = "-i \"{0}\" -c copy -ss {4} -to {5} -y \"{2}\""
262273
};
@@ -268,9 +279,9 @@ public class Type
268279
FileExtension = ".csv"
269280
};
270281

271-
public static Type WAV = new Type()
282+
public static Type FFMPEG_WAV = new Type()
272283
{
273-
Name = "WAV",
284+
Name = "FFMPEG WAV",
274285
Encoder = Encoder.FFMPEG,
275286
FileExtension = ".wav",
276287
CommandLineArgsWithoutDecoding = "-i \"{0}\" -vn -y {3} \"{2}\"",

0 commit comments

Comments
 (0)