th: video: prefer embedded cover/pic

This commit is contained in:
ed 2026-07-15 22:00:33 +00:00
parent ed0be42a3b
commit 5952401815

View file

@ -833,7 +833,7 @@ class ThumbSrv(object):
def conv_ffmpeg(self, abspath: str, tpath: str, fmt: str, vn: VFS) -> None:
self.wait4ram(0.2, tpath)
ret, _, _, _ = ffprobe(abspath, int(vn.flags["convt"] / 2))
ret, raw, strms, ctnr = ffprobe(abspath, int(vn.flags["convt"] / 2))
if not ret:
return
@ -841,6 +841,13 @@ class ThumbSrv(object):
# audio in a video trenchcoat
return self.conv_spec(abspath, tpath, fmt, vn)
for strm in strms:
if (
strm.get("codec_type") == "video"
and strm.get("DISPOSITION:attached_pic") == "1"
):
return self.conv_emb_cv(abspath, tpath, fmt, vn, strm)
ext = abspath.rsplit(".")[-1].lower()
if ext in ["h264", "h265"] or ext in self.fmt_ffi:
seek: list[bytes] = []