DV+HDR test
This commit is contained in:
parent
46fb3e7adf
commit
4eeda5414d
BIN
binaries/dovi_tool.exe
Normal file
BIN
binaries/dovi_tool.exe
Normal file
Binary file not shown.
14
install.sh
14
install.sh
@ -4,7 +4,7 @@ python -m pip install poetry==1.8.5
|
||||
poetry config virtualenvs.in-project true
|
||||
poetry lock --no-update
|
||||
poetry install
|
||||
sudo add-apt-repository ppa:ubuntuhandbook1/apps
|
||||
sudo add-apt-repository ppa:ubuntuhandbook1/apps -y
|
||||
sudo apt update
|
||||
sudo apt-get install ffmpeg aria2 mkvtoolnix libmediainfo0v5
|
||||
ffmpeg --version
|
||||
@ -15,11 +15,11 @@ mkvmerge --version
|
||||
rm -r ./binaries/
|
||||
mkdir ./binaries/
|
||||
mv -v ./linux_binaries/* ./binaries/
|
||||
cp aria2c ./binaries/
|
||||
cp ffmpeg ./binaries/
|
||||
cp ffprobe ./binaries/
|
||||
cp ffplay ./binaries/
|
||||
cp mkvtoolnix ./binaries/
|
||||
which aria2c | xargs -I{} cp {} ./binaries/
|
||||
which ffmpeg | xargs -I{} cp {} ./binaries/
|
||||
which ffprobe | xargs -I{} cp {} ./binaries/
|
||||
which ffplay | xargs -I{} cp {} ./binaries/
|
||||
which mkvmerge | xargs -I{} cp {} ./binaries/
|
||||
cd ./binaries/
|
||||
find . -type f -print0 | xargs -0 chmod +x
|
||||
chmod +x /home/hidden/VT/VT-PR/binaries/*
|
||||
chmod +x *
|
||||
BIN
linux_binaries/dovi_tool
Normal file
BIN
linux_binaries/dovi_tool
Normal file
Binary file not shown.
Binary file not shown.
@ -284,8 +284,17 @@ class Track:
|
||||
) + ".mp4"
|
||||
save_path = os.path.join(out, name)
|
||||
|
||||
if self.descriptor == self.Descriptor.M3U and self.extra[1]:
|
||||
master = self.extra[1]
|
||||
if self.descriptor == self.Descriptor.M3U:
|
||||
manifest = requests.get(as_list(self.url)[0], headers=headers, proxies={"all": proxy} if proxy else None).text
|
||||
if "Denied" in manifest and self.source == "DSNP":
|
||||
#DSNP sometimes gives errors with proxy. W/O headers also works. Sometimes it gives manifest after retrying. Dunno what triggers error. No geofencing for the segmenets themselves.
|
||||
manifest = requests.get(as_list(self.url)[0], proxies={"all": proxy} if proxy else None).text
|
||||
if "Denied" in manifest:
|
||||
manifest = requests.get(as_list(self.url)[0]).text
|
||||
master = m3u8.loads(
|
||||
manifest,
|
||||
uri=as_list(self.url)[0]
|
||||
)
|
||||
# Keys may be [] or [None] if unencrypted
|
||||
if any(master.keys + master.session_keys):
|
||||
self.encrypted = True
|
||||
@ -328,7 +337,7 @@ class Track:
|
||||
("" if re.match("^https?://", segment.uri) else segment.base_uri) +
|
||||
segment.uri
|
||||
)
|
||||
self.url = segments
|
||||
self.url = segments if segments != [] else self.url
|
||||
|
||||
if (
|
||||
Path(save_path).is_file() and not
|
||||
@ -433,7 +442,7 @@ class Track:
|
||||
if not os.path.exists(target) or not self._location:
|
||||
return False
|
||||
os.unlink(self._location)
|
||||
if "dec.mp4" in target:
|
||||
if "dec" in target or "fixed" in target:
|
||||
self._location = target
|
||||
else:
|
||||
os.rename(target, self._location)
|
||||
@ -1158,7 +1167,7 @@ class Tracks:
|
||||
#if bitrate < 99999:
|
||||
# bitrate = bitrate / 1000
|
||||
self.videos = [x for x in self.videos if int(x.bitrate) <= int(bitrate)]
|
||||
else:
|
||||
elif by_vbitrate:
|
||||
self.videos = [x for x in self.videos if int(x.bitrate) <= int(int(by_vbitrate) * 1001)]
|
||||
|
||||
if by_codec:
|
||||
@ -1335,7 +1344,13 @@ class Tracks:
|
||||
hdr_path = Path(hdr.locate())
|
||||
dv_path = Path(dv.locate())
|
||||
hybrid_path = hdr_path.with_name(hdr_path.stem + "_hybrid.hevc")
|
||||
hybrid_path = Path(self.make_hybrid_dv_hdr(str(dv_path), str(hdr_path), str(hybrid_path)))
|
||||
hybrid_path = Path(
|
||||
self.make_hybrid_dv_hdr(
|
||||
dv_file=str(dv_path),
|
||||
hdr_file=str(hdr_path),
|
||||
output_file=str(hybrid_path)
|
||||
)
|
||||
)
|
||||
timeout = 10
|
||||
waited = 0
|
||||
while not hybrid_path.exists() or os.path.getsize(hybrid_path) < 10000:
|
||||
@ -1344,9 +1359,7 @@ class Tracks:
|
||||
if waited >= timeout:
|
||||
raise FileNotFoundError(f"Hybrid file never appeared or too small: {hybrid_path}")
|
||||
hdr.swap(str(hybrid_path))
|
||||
# Hapus DV-only
|
||||
self.videos = [v for v in self.videos if not (v.dv and not v.hdr10)]
|
||||
#self._cleanup_paths = [dv_path, hybrid_path]
|
||||
try:
|
||||
if hdr_path.exists():
|
||||
hdr_path.unlink()
|
||||
@ -1355,12 +1368,12 @@ class Tracks:
|
||||
except Exception as e:
|
||||
logsi.warning(f" - Failed to delete the temp file: {e}")
|
||||
end_time = time.time()
|
||||
duration = format_duration(end_time - start_time)
|
||||
logsi.info(gradient_text(f" + Finish processing Hybrid in {duration}!", (173, 255, 47), (0, 191, 255)))
|
||||
duration = hdr.format_duration(end_time - start_time)
|
||||
logsi.info(f" + Finish processing Hybrid in {duration}!")
|
||||
|
||||
return str(hybrid_path)
|
||||
|
||||
def make_hybrid_dv_hdr(dv_file: str, hdr_file: str, output_file: str = None) -> str:
|
||||
def make_hybrid_dv_hdr(self, dv_file: str, hdr_file: str, output_file: str = None) -> str:
|
||||
dovi_tool = shutil.which("dovi_tool") or "./binaries/dovi_tool"
|
||||
if not os.path.isfile(dovi_tool):
|
||||
raise FileNotFoundError("dovi_tool not found.")
|
||||
|
||||
@ -24,7 +24,7 @@ cdm_api:
|
||||
credentials:
|
||||
iTunes: 'username:password'
|
||||
Hotstar: 'username:password'
|
||||
DisneyPlus: 'username:password'
|
||||
DisneyPlus: 'tjp4252@gmail.com:Tjcooke@121382'
|
||||
|
||||
directories:
|
||||
temp: ''
|
||||
|
||||
Loading…
Reference in New Issue
Block a user