|
@@ -33,17 +33,18 @@ namespace Webmify {
|
|
|
new Thread<bool>("watcher", watch_directory);
|
|
|
|
|
|
// Create the workers
|
|
|
- print(@"Creating $workers workers.\n");
|
|
|
+ print(@"[Webmify] Creating $workers workers.\n");
|
|
|
queue.parallel_iterate(path => {
|
|
|
var filename = Path.get_basename(path);
|
|
|
- print(@"Dequeue \"$filename\"\n");
|
|
|
-
|
|
|
+ print(@"[Webmify] Dequeue \"$filename\"\n");
|
|
|
+
|
|
|
// Cooldown to allow for file to fully copy
|
|
|
Thread.usleep(10000000);
|
|
|
|
|
|
var video_file = File.new_for_path(path);
|
|
|
var video_info = new VideoInfo(video_file);
|
|
|
video_info.read_info();
|
|
|
+ print(@"[Webmify] Read metadata for \"$filename\"\n");
|
|
|
|
|
|
var profiles = construct_profiles();
|
|
|
var profile = profiles.first(p => p.suitable_for(video_info));
|
|
@@ -52,22 +53,22 @@ namespace Webmify {
|
|
|
var encoder = new Encoder(video_file, work_dir, profile);
|
|
|
encoder.progress_changed.connect((frac, done) => {
|
|
|
if(!done) {
|
|
|
- print(@"Encode \"$filename\": $(frac*100)%\n");
|
|
|
+ print(@"[Webmify] Encode \"$filename\": $(frac*100)%\n");
|
|
|
}
|
|
|
else {
|
|
|
- print(@"Encode \"$filename\": complete!\n");
|
|
|
+ print(@"[Webmify] Encode \"$filename\": complete!\n");
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- print(@"Begin encoding \"$filename\" as VP9/WebM using profile $(profile.version_label())\n");
|
|
|
+ print(@"[Webmify] Begin encoding \"$filename\" as VP9/WebM using profile $(profile.version_label())\n");
|
|
|
encoder.encode();
|
|
|
|
|
|
var output_path = encoder.get_output_file();
|
|
|
- print(@"Copy \"$(Path.get_basename(output_path.get_path()))\" to output directory\n");
|
|
|
+ print(@"[Webmify] Copy \"$(Path.get_basename(output_path.get_path()))\" to output directory\n");
|
|
|
output_path.copy(File.new_build_filename(output_dir, Path.get_basename(output_path.get_path())), FileCopyFlags.ALL_METADATA);
|
|
|
output_path.delete();
|
|
|
video_file.delete();
|
|
|
- print(@"Conversion complete: $filename -> $(Path.get_basename(output_path.get_path()))\n");
|
|
|
+ print(@"[Webmify] Conversion complete: $filename -> $(Path.get_basename(output_path.get_path()))\n");
|
|
|
}, workers);
|
|
|
|
|
|
assert_not_reached();
|
|
@@ -82,7 +83,7 @@ namespace Webmify {
|
|
|
files.remove_all(processed_files);
|
|
|
processed_files.add_all(files);
|
|
|
foreach (var file in files) {
|
|
|
- print(@"Adding file \"$file\" to queue.\n");
|
|
|
+ print(@"[Webmify] Adding file \"$file\" to queue.\n");
|
|
|
var path = Path.build_filename(watch_dir, file);
|
|
|
queue.push(path);
|
|
|
}
|