forked from DRMTalks/devine
master #2
|
@ -201,6 +201,7 @@ class Video(Track):
|
||||||
], check=True)
|
], check=True)
|
||||||
|
|
||||||
self.path = output_path
|
self.path = output_path
|
||||||
|
original_path.unlink()
|
||||||
|
|
||||||
def ccextractor(
|
def ccextractor(
|
||||||
self, track_id: Any, out_path: Union[Path, str], language: Language, original: bool = False
|
self, track_id: Any, out_path: Union[Path, str], language: Language, original: bool = False
|
||||||
|
@ -320,11 +321,12 @@ class Video(Track):
|
||||||
i = file.index(b"x264")
|
i = file.index(b"x264")
|
||||||
encoding_settings = file[i: i + file[i:].index(b"\x00")].replace(b":", br"\\:").replace(b",", br"\,").decode()
|
encoding_settings = file[i: i + file[i:].index(b"\x00")].replace(b":", br"\\:").replace(b",", br"\,").decode()
|
||||||
|
|
||||||
cleaned_path = self.path.with_suffix(f".cleaned{self.path.suffix}")
|
original_path = self.path
|
||||||
|
cleaned_path = original_path.with_suffix(f".cleaned{original_path.suffix}")
|
||||||
subprocess.run([
|
subprocess.run([
|
||||||
executable, "-hide_banner",
|
executable, "-hide_banner",
|
||||||
"-loglevel", "panic",
|
"-loglevel", "panic",
|
||||||
"-i", self.path,
|
"-i", original_path,
|
||||||
"-map_metadata", "-1",
|
"-map_metadata", "-1",
|
||||||
"-fflags", "bitexact",
|
"-fflags", "bitexact",
|
||||||
"-bsf:v", f"filter_units=remove_types=6,h264_metadata=sei_user_data={uuid}+{encoding_settings}",
|
"-bsf:v", f"filter_units=remove_types=6,h264_metadata=sei_user_data={uuid}+{encoding_settings}",
|
||||||
|
@ -335,6 +337,7 @@ class Video(Track):
|
||||||
log.info(" + Removed")
|
log.info(" + Removed")
|
||||||
|
|
||||||
self.path = cleaned_path
|
self.path = cleaned_path
|
||||||
|
original_path.unlink()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue