+
    ‚°ñjÄ
  ã                  ó^   € R t ^ RIHt ^ RIt^ RIHt ]P                  ! ]4      tRR R llt	R# )a  Video metadata extraction for asset ingest.

Reads only the container/stream headers via PyAV to capture dimensions,
duration, fps and frame count cheaply, without decoding frames. Returns a
metadata dict suitable for merging into ``AssetReference.system_metadata``.
)ÚannotationsN)ÚAnyc               ó$   € V ^8„  d   QhRRRRRR/# )é   Ú	file_pathÚstrÚ	mime_typez
str | NoneÚreturnzdict[str, Any] | None© )Úformats   "ÚFC:\Ai_Coding\apps\studio\ComfyUI\app\assets\services\video_metadata.pyÚ__annotate__r      s)   € ÷ @ñ @Øð@Ø)ð@àñ@ó    c                ór  € Ve   VP                  R4      '       g   R#  ^ RIp TP                  T 4      ;_uu_ 4       p\        R TP                   4       R4      pTf    RRR4       R# TP                  '       d   \        TP                  4      MRpRpTP                  e6   TP                  e(   \        TP                  TP                  ,          4      pM4TP                  e'   \        TP                  TP                  ,          4      pTP                  ;'       g    RpTP                  P                  pTP                  P                  p	RRR4       \)        X\*        4      '       d%   \)        X	\*        4      '       d   T^ 8:  g   T	^ 8:  d   R# RRRTR	T	/pXe   YkR
&   Xe   Y[R&   Xe   Y{R&   T#   \         d    \        P	                  RT 4        R# i ; i  + '       g   i     L–; i  \         \"        TP$                  P&                  3 d"   p
\        P	                  RY
4        Rp
?
R# Rp
?
ii ; i)aÙ  Extract video stream metadata for the file at ``file_path``.

Args:
    file_path: Absolute path to a file on disk.
    mime_type: Optional MIME type hint. When provided and not prefixed
        with ``video/``, extraction is skipped without touching the file.

Returns:
    ``{"kind": "video", "width": W, "height": H, ...}`` with optional
    ``duration`` (seconds), ``fps`` and ``frame_count`` keys when the
    file has a recognizable video stream, otherwise ``None``.
Nzvideo/z=PyAV not available; skipping video metadata extraction for %sc              3  óJ   "  € T F  qP                   R 8X  g   K  Vx € K  	  R# 5i)ÚvideoN)Útype)Ú.0Úss   & r   Ú	<genexpr>Ú)extract_video_metadata.<locals>.<genexpr>-   s   é € ÐCÑ-�q·±¸7Ñ1B—’Ó-ùs   ‚#™
#z)Failed to read video metadata from %s: %sÚkindr   ÚwidthÚheightÚdurationÚfpsÚframe_count)Ú
startswithÚavÚImportErrorÚloggerÚdebugÚopenÚnextÚstreamsÚaverage_rateÚfloatr   Ú	time_baseÚframesÚcodec_contextr   r   ÚOSErrorÚ
ValueErrorÚerrorÚFFmpegErrorÚ
isinstanceÚint)r   r   r   Ú	containerÚstreamr   r   r   r   r   ÚexcÚmetadatas   &&          r   Úextract_video_metadatar4      sè  € ð Ò Y×%9Ñ%9¸(×%CÒ%CÙðÛðØ�W‰W�Y×Ô 9ÜÙC˜I×-Ò-ÓCÀTóˆFð Š~Ø÷  Ñð 17×0C×0CÐ0C”%˜×+Ñ+Ô,ÈˆCØˆHØ�‰Ò*¨v×/?Ñ/?Ò/KÜ  §¡°6×3CÑ3CÕ!CÓD‘Ø×#Ñ#Ò/Ü  ×!3Ñ!3°b·l±lÕ!BÓC�Ø Ÿ-™-×/Ð/¨4ˆKà×(Ñ(×.Ñ.ˆEØ×)Ñ)×0Ñ0ˆF÷!  ô, �uœc×"Ò"Ü˜&¤#×&Ò&Ø�AŒ:Ø�QŒ;áà &¨°¸%ÀÈ6ÐR€HØÒØ'�ÑØ
‚Ø�‰ØÒØ"-�ÑØ€OøôY ô Ü�‰ØKØô	
ò ðú÷  ×ûô" ”Z §¡×!5Ñ!5Ð6ô Ü�‰Ð@À)ÔQÝûðús^   ŸF4 ¤G/ ½#GÁ G/ Á*GÁ<B"GÄ/GÅG/ Æ4!GÇGÇG,	Ç'G/ Ç,G/ Ç/&H6ÈH1È1H6)N)
Ú__doc__Ú
__future__r   ÚloggingÚtypingr   Ú	getLoggerÚ__name__r    r4   r
   r   r   Ú<module>r;      s1   ðñõ #ã Ý à	×	Ò	˜8Ó	$€÷@ñ @r   