§
    ù²ÅjéQ  ã            %       óŽ  — d dl Z d dlZd dlmZ d dlmZmZmZmZm	Z	 d dl
Z
ddlmZ 	  ed¦  «         dZn# eef$ r dZY nw xY weZ ed d	¦  «        Z G d
„ d¦  «        Z G d„ d¦  «        Zdeeef         ddfd„Zde
j        de
j        de
j        de
j        de
j        de
j        defd„Zde
j        de
j        deeef         de
j        fd„Zddd d d d dedd d defdeded ed!ed"ed#ed$ed%eeef         d&ed'ed(ed)edeeef         d*edee
j        e
j        ef         fd+„Zdedeee         ee         ef         fd,„Zdedefd-„Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d<d.e
j        ded ed!ed"ed#ed$ed%eeef         d/ed0ed'ed(ed)edeeef         d1ed2edee
j        e
j        f         f"d3„Zd.e
j        deee         ee         ef         fd4„Z d.e
j        defd5„Z!	 	 	 d=ded7e	eef         d8ee	eef                  d9edee
j        e
j        eeef         f         f
d:„Z"	 d>ded9edee	ee         ee         f         ee         f         fd;„Z#dS )?é    N)ÚFraction)ÚDictÚListÚOptionalÚTupleÚUnioné   )Ú_load_libraryÚvideo_readerTFé   c                   ó4   — e Zd ZeedœZddgZdededdfd„ZdS )ÚTimebase©Ú	numeratorÚdenominatorr   r   ÚreturnNc                 ó"   — || _         || _        d S )Nr   )Úselfr   r   s      úJC:\Projects\Historical\venv\Lib\site-packages\torchvision/io/_video_opt.pyÚ__init__zTimebase.__init__   s   € ð
 #ˆŒØ&ˆÔÐÐó    )Ú__name__Ú
__module__Ú__qualname__ÚintÚ__annotations__Ú	__slots__r   © r   r   r   r      s[   € € € € € Ø$'¸Ð<Ð<€OØ˜mÐ,€Ið'àð'ð ð'ð 
ð	'ð 'ð 'ð 'ð 'ð 'r   r   c            	       ó4   — e Zd ZeeeeeeeedœZg d¢Zdd„ZdS )ÚVideoMetaData)Ú	has_videoÚvideo_timebaseÚvideo_durationÚ	video_fpsÚ	has_audioÚaudio_timebaseÚaudio_durationÚaudio_sample_rater   Nc                 ó®   — d| _         t          dd¦  «        | _        d| _        d| _        d| _        t          dd¦  «        | _        d| _        d| _        d S )NFr   r   g        )	r!   r   r"   r#   r$   r%   r&   r'   r(   )r   s    r   r   zVideoMetaData.__init__:   sU   € ØˆŒÝ& q¨!™nœnˆÔØ!ˆÔØˆŒØˆŒÝ& q¨!™nœnˆÔØ!ˆÔØ!$ˆÔÐÐr   )r   N)	r   r   r   Úboolr   Úfloatr   r   r   r   r   r   r    r    $   s]   € € € € € àØ"ØØØØ"ØØ"ð	ð 	€Oð	ð 	ð 	€Ið%ð %ð %ð %ð %ð %r   r    Ú	pts_ranger   c                 ó‚   — | d         | d         cxk    rdk    r%n d S t          d| d         › d| d         › �¦  «        ‚d S )Nr   r   z=Start pts should not be smaller than end pts, got start pts: z and end pts: )Ú
ValueError)r,   s    r   Ú_validate_ptsr/   E   sh   € à�„|�i ”lÐ&Ð&Ò&Ð& QÒ&Ð&Ð&Ð&Ð&Ð&ÝØvÈIÐVWÌLÐvÐvÐhqÐrsÔhtÐvÐvñ
ô 
ð 	
ð 'Ð&r   Ú	vtimebaseÚvfpsÚ	vdurationÚ	atimebaseÚasample_rateÚ	adurationc                 ó  — t          ¦   «         }|                      ¦   «         dk    rét          t          | d                              ¦   «         ¦  «        t          | d                              ¦   «         ¦  «        ¦  «        |_        | d                              ¦   «         t          | d                              ¦   «         ¦  «        z  }|                     ¦   «         dk    r0d|_        t          |                     ¦   «         ¦  «        |z  |_        |                     ¦   «         dk    r&t          |                     ¦   «         ¦  «        |_	        |                     ¦   «         dk    rét          t          |d                              ¦   «         ¦  «        t          |d                              ¦   «         ¦  «        ¦  «        |_
        |d                              ¦   «         t          |d                              ¦   «         ¦  «        z  }|                     ¦   «         dk    r0d|_        t          |                     ¦   «         ¦  «        |z  |_        |                     ¦   «         dk    r&t          |                     ¦   «         ¦  «        |_        |S )zE
    Build update VideoMetaData struct with info about the video
    r   r   T)r    Únumelr   r   Úitemr"   r+   r!   r#   r$   r&   r%   r'   r(   )r0   r1   r2   r3   r4   r5   ÚmetaÚtimebases           r   Ú
_fill_infor;   M   s÷  € õ ‰?Œ?€DØ‡‚ÑÔ˜1ÒÐÝ&¥s¨9°Q¬<×+<Ò+<Ñ+>Ô+>Ñ'?Ô'?ÅÀYÈqÄ\×EVÒEVÑEXÔEXÑAYÔAYÑZÔZˆÔØ˜Q”<×$Ò$Ñ&Ô&­¨y¸¬|×/@Ò/@Ñ/BÔ/BÑ)CÔ)CÑCˆØ�?Š?ÑÔ˜qÒ Ð Ø!ˆDŒNÝ"'¨	¯ªÑ(8Ô(8Ñ"9Ô"9¸HÑ"DˆDÔØ‡z‚z�|„|�aÒÐÝ˜tŸyšy™{œ{Ñ+Ô+ˆŒØ‡‚ÑÔ˜1ÒÐÝ&¥s¨9°Q¬<×+<Ò+<Ñ+>Ô+>Ñ'?Ô'?ÅÀYÈqÄ\×EVÒEVÑEXÔEXÑAYÔAYÑZÔZˆÔØ˜Q”<×$Ò$Ñ&Ô&­¨y¸¬|×/@Ò/@Ñ/BÔ/BÑ)CÔ)CÑCˆØ�?Š?ÑÔ˜qÒ Ð Ø!ˆDŒNÝ"'¨	¯ªÑ(8Ô(8Ñ"9Ô"9¸HÑ"DˆDÔØ×ÒÑÔ˜aÒÐÝ!& |×'8Ò'8Ñ':Ô':Ñ!;Ô!;ˆÔà€Kr   ÚaframesÚ
aframe_ptsÚaudio_pts_rangec                 ón  — |d         |d         }}|                       d¦  «        }t          ||z
  dz   ¦  «        t          |¦  «        z  }d}|}||d         k     rt          |d         |z
  |z  ¦  «        }|d         dk    r'||d         k    rt          |d         |z
  |z  ¦  «        }| ||…d d …f         S )Nr   éÿÿÿÿr   )Úsizer+   r   )	r<   r=   r>   ÚstartÚendÚnum_samplesÚstep_per_aframeÚs_idxÚe_idxs	            r   Ú_align_audio_framesrH   m   sÎ   € ð ˜A” 
¨2¤ˆ3€EØ—,’,˜q‘/”/€KÝ˜C %™K¨!™OÑ,Ô,­u°[Ñ/AÔ/AÑA€OØ€EØ€EØˆ˜qÔ!Ò!Ð!Ý�_ QÔ'¨%Ñ/°?ÑBÑCÔCˆØ�qÔ˜RÒÐ C¨/¸!Ô*<Ò$<Ð$<Ý�_ QÔ'¨#Ñ-°Ñ@ÑAÔAˆØ�5˜�;   �>Ô"Ð"r   ç      Ð?©r   r@   ÚfilenameÚseek_frame_marginÚread_video_streamÚvideo_widthÚvideo_heightÚvideo_min_dimensionÚvideo_max_dimensionÚvideo_pts_ranger"   Úread_audio_streamÚaudio_samplesÚaudio_channelsr&   c                 ó   — t          |¦  «         t          |¦  «         t          j        j                             | |d||||||d         |d         |j        |j        |	|
||d         |d         |j        |j        ¦  «        }|\
  }}}}}}}}}}t          ||||||¦  «        }|                     ¦   «         dk    rt          |||¦  «        }|||fS )ab  
    Reads a video from a file, returning both the video frames and the audio frames

    Args:
    filename (str): path to the video file
    seek_frame_margin (double, optional): seeking frame in the stream is imprecise. Thus,
        when video_start_pts is specified, we seek the pts earlier by seek_frame_margin seconds
    read_video_stream (int, optional): whether read video stream. If yes, set to 1. Otherwise, 0
    video_width/video_height/video_min_dimension/video_max_dimension (int): together decide
        the size of decoded frames:

            - When video_width = 0, video_height = 0, video_min_dimension = 0,
                and video_max_dimension = 0, keep the original frame resolution
            - When video_width = 0, video_height = 0, video_min_dimension != 0,
                and video_max_dimension = 0, keep the aspect ratio and resize the
                frame so that shorter edge size is video_min_dimension
            - When video_width = 0, video_height = 0, video_min_dimension = 0,
                and video_max_dimension != 0, keep the aspect ratio and resize
                the frame so that longer edge size is video_max_dimension
            - When video_width = 0, video_height = 0, video_min_dimension != 0,
                and video_max_dimension != 0, resize the frame so that shorter
                edge size is video_min_dimension, and longer edge size is
                video_max_dimension. The aspect ratio may not be preserved
            - When video_width = 0, video_height != 0, video_min_dimension = 0,
                and video_max_dimension = 0, keep the aspect ratio and resize
                the frame so that frame video_height is $video_height
            - When video_width != 0, video_height == 0, video_min_dimension = 0,
                and video_max_dimension = 0, keep the aspect ratio and resize
                the frame so that frame video_width is $video_width
            - When video_width != 0, video_height != 0, video_min_dimension = 0,
                and video_max_dimension = 0, resize the frame so that frame
                video_width and  video_height are set to $video_width and
                $video_height, respectively
    video_pts_range (list(int), optional): the start and end presentation timestamp of video stream
    video_timebase (Fraction, optional): a Fraction rational number which denotes timebase in video stream
    read_audio_stream (int, optional): whether read audio stream. If yes, set to 1. Otherwise, 0
    audio_samples (int, optional): audio sampling rate
    audio_channels (int optional): audio channels
    audio_pts_range (list(int), optional): the start and end presentation timestamp of audio stream
    audio_timebase (Fraction, optional): a Fraction rational number which denotes time base in audio stream

    Returns
        vframes (Tensor[T, H, W, C]): the `T` video frames
        aframes (Tensor[L, K]): the audio frames, where `L` is the number of points and
            `K` is the number of audio_channels
        info (Dict): metadata for the video and audio. Can contain the fields video_fps (float)
            and audio_fps (int)
    r   r   )
r/   ÚtorchÚopsr   Úread_video_from_filer   r   r;   r7   rH   )rK   rL   rM   rN   rO   rP   rQ   rR   r"   rS   rT   rU   r>   r&   ÚresultÚvframesÚ_vframe_ptsr0   r1   r2   r<   r=   r3   r4   r5   Úinfos                             r   Ú_read_video_from_filer^   |   sü   € õ@ �/Ñ"Ô"Ð"Ý�/Ñ"Ô"Ð"åŒYÔ#×8Ò8ØØØ	ØØØØØØ˜ÔØ˜ÔØÔ ØÔ"ØØØØ˜ÔØ˜ÔØÔ ØÔ"ñ'ô €Fð* qwÑm€Gˆ[˜) T¨9°g¸zÈ9ÐVbÐdmÝ�i  y°)¸\È9ÑUÔU€DØ‡}‚}�„˜ÒÐå% g¨z¸?ÑKÔKˆØ�G˜TÐ!Ð!r   c                 óR  — t           j        j                             | dddddddddddddddddd¦  «        }|\
  }}}}}}}}	}
}t	          ||||	|
|¦  «        }|                     ¦   «                              ¦   «         }|                     ¦   «                              ¦   «         }|||fS )zÉ
    Decode all video- and audio frames in the video. Only pts
    (presentation timestamp) is returned. The actual frame pixel data is not
    copied. Thus, it is much faster than read_video(...)
    r   r   r@   )rW   rX   r   rY   r;   ÚnumpyÚtolist)rK   rZ   Ú_vframesÚ
vframe_ptsr0   r1   r2   Ú_aframesr=   r3   r4   r5   r]   s                r   Ú _read_video_timestamps_from_filere   Ü   sÕ   € õ ŒYÔ#×8Ò8ØØ	Ø	Ø	Ø	Ø	Ø	Ø	Ø	Ø
Ø	Ø	Ø	Ø	Ø	Ø	Ø
Ø	Ø	ñ'ô €Fð* rxÑn€Hˆj˜) T¨9°hÀ
ÈIÐWcÐenÝ�i  y°)¸\È9ÑUÔU€Dà×!Ò!Ñ#Ô#×*Ò*Ñ,Ô,€JØ×!Ò!Ñ#Ô#×*Ò*Ñ,Ô,€JØ�z 4Ð'Ð'r   c                 óˆ   — t           j        j                             | ¦  «        }|\  }}}}}}t	          ||||||¦  «        }|S )zO
    Probe a video file and return VideoMetaData with info about the video
    )rW   rX   r   Úprobe_video_from_filer;   )	rK   rZ   r0   r1   r2   r3   r4   r5   r]   s	            r   Ú_probe_video_from_filerh   ÿ   sJ   € õ ŒYÔ#×9Ò9¸(ÑCÔC€FØEKÑB€Iˆt�Y 	¨<¸Ý�i  y°)¸\È9ÑUÔU€DØ€Kr   Ú
video_dataÚvideo_timebase_numeratorÚvideo_timebase_denominatorÚaudio_timebase_numeratorÚaudio_timebase_denominatorc                 óD  — t          |¦  «         t          |¦  «         t          | t          j        ¦  «        sat	          j        ¦   «         5  t	          j        dd¬¦  «         t          j        | t          j        ¬¦  «        } ddd¦  «         n# 1 swxY w Y   t          j	        j
                             | |d||||||d         |d         ||	|
|||d         |d         ||¦  «        }|\
  }}}}}}}}}}|                     ¦   «         dk    rt          |||¦  «        }||fS )aÏ  
    Reads a video from memory, returning both the video frames as the audio frames
    This function is torchscriptable.

    Args:
    video_data (data type could be 1) torch.Tensor, dtype=torch.int8 or 2) python bytes):
        compressed video content stored in either 1) torch.Tensor 2) python bytes
    seek_frame_margin (double, optional): seeking frame in the stream is imprecise.
        Thus, when video_start_pts is specified, we seek the pts earlier by seek_frame_margin seconds
    read_video_stream (int, optional): whether read video stream. If yes, set to 1. Otherwise, 0
    video_width/video_height/video_min_dimension/video_max_dimension (int): together decide
        the size of decoded frames:

            - When video_width = 0, video_height = 0, video_min_dimension = 0,
                and video_max_dimension = 0, keep the original frame resolution
            - When video_width = 0, video_height = 0, video_min_dimension != 0,
                and video_max_dimension = 0, keep the aspect ratio and resize the
                frame so that shorter edge size is video_min_dimension
            - When video_width = 0, video_height = 0, video_min_dimension = 0,
                and video_max_dimension != 0, keep the aspect ratio and resize
                the frame so that longer edge size is video_max_dimension
            - When video_width = 0, video_height = 0, video_min_dimension != 0,
                and video_max_dimension != 0, resize the frame so that shorter
                edge size is video_min_dimension, and longer edge size is
                video_max_dimension. The aspect ratio may not be preserved
            - When video_width = 0, video_height != 0, video_min_dimension = 0,
                and video_max_dimension = 0, keep the aspect ratio and resize
                the frame so that frame video_height is $video_height
            - When video_width != 0, video_height == 0, video_min_dimension = 0,
                and video_max_dimension = 0, keep the aspect ratio and resize
                the frame so that frame video_width is $video_width
            - When video_width != 0, video_height != 0, video_min_dimension = 0,
                and video_max_dimension = 0, resize the frame so that frame
                video_width and  video_height are set to $video_width and
                $video_height, respectively
    video_pts_range (list(int), optional): the start and end presentation timestamp of video stream
    video_timebase_numerator / video_timebase_denominator (float, optional): a rational
        number which denotes timebase in video stream
    read_audio_stream (int, optional): whether read audio stream. If yes, set to 1. Otherwise, 0
    audio_samples (int, optional): audio sampling rate
    audio_channels (int optional): audio audio_channels
    audio_pts_range (list(int), optional): the start and end presentation timestamp of audio stream
    audio_timebase_numerator / audio_timebase_denominator (float, optional):
        a rational number which denotes time base in audio stream

    Returns:
        vframes (Tensor[T, H, W, C]): the `T` video frames
        aframes (Tensor[L, K]): the audio frames, where `L` is the number of points and
            `K` is the number of channels
    Úignoreú The given buffer is not writable©Úmessage©ÚdtypeNr   r   )r/   Ú
isinstancerW   ÚTensorÚwarningsÚcatch_warningsÚfilterwarningsÚ
frombufferÚuint8rX   r   Úread_video_from_memoryr7   rH   )ri   rL   rM   rN   rO   rP   rQ   rR   rj   rk   rS   rT   rU   r>   rl   rm   rZ   r[   r\   r0   r1   r2   r<   r=   r3   r4   r5   s                              r   Ú_read_video_from_memoryr}   	  s‘  € õJ �/Ñ"Ô"Ð"Ý�/Ñ"Ô"Ð"å�j¥%¤,Ñ/Ô/ð IÝÔ$Ñ&Ô&ð 	Ið 	IåÔ# HÐ6XÐYÑYÔYÐYÝÔ)¨*½E¼KÐHÑHÔHˆJð	Ið 	Ið 	Iñ 	Iô 	Ið 	Ið 	Ið 	Ið 	Ið 	Ið 	Iøøøð 	Ið 	Ið 	Ið 	Iõ
 ŒYÔ#×:Ò:ØØØ	ØØØØØØ˜ÔØ˜ÔØ Ø"ØØØØ˜ÔØ˜ÔØ Ø"ñ'ô €Fð, qwÑm€Gˆ[˜) T¨9°g¸zÈ9ÐVbÐdmà‡}‚}�„˜ÒÐå% g¨z¸?ÑKÔKˆà�GÐÐs   Á7BÂBÂBc                 óH  — t          | t          j        ¦  «        sat          j        ¦   «         5  t          j        dd¬¦  «         t          j        | t          j        ¬¦  «        } ddd¦  «         n# 1 swxY w Y   t          j        j	         
                    | dddddddddddddddddd¦  «        }|\
  }}}}}}}}	}
}t          ||||	|
|¦  «        }|                     ¦   «                              ¦   «         }|                     ¦   «                              ¦   «         }|||fS )	zÐ
    Decode all frames in the video. Only pts (presentation timestamp) is returned.
    The actual frame pixel data is not copied. Thus, read_video_timestamps(...)
    is much faster than read_video(...)
    ro   rp   rq   rs   Nr   r   r@   )ru   rW   rv   rw   rx   ry   rz   r{   rX   r   r|   r;   r`   ra   )ri   rZ   rb   rc   r0   r1   r2   rd   r=   r3   r4   r5   r]   s                r   Ú"_read_video_timestamps_from_memoryr   v  s�  € õ �j¥%¤,Ñ/Ô/ð IÝÔ$Ñ&Ô&ð 	Ið 	IåÔ# HÐ6XÐYÑYÔYÐYÝÔ)¨*½E¼KÐHÑHÔHˆJð	Ið 	Ið 	Iñ 	Iô 	Ið 	Ið 	Ið 	Ið 	Ið 	Ið 	Iøøøð 	Ið 	Ið 	Ið 	Iõ ŒYÔ#×:Ò:ØØ	Ø	Ø	Ø	Ø	Ø	Ø	Ø	Ø
Ø	Ø	Ø	Ø	Ø	Ø	Ø
Ø	Ø	ñ'ô €Fð* rxÑn€Hˆj˜) T¨9°hÀ
ÈIÐWcÐenÝ�i  y°)¸\È9ÑUÔU€Dà×!Ò!Ñ#Ô#×*Ò*Ñ,Ô,€JØ×!Ò!Ñ#Ô#×*Ò*Ñ,Ô,€JØ�z 4Ð'Ð'ó   ®7A1Á1A5Á8A5c                 ó~  — t          | t          j        ¦  «        sat          j        ¦   «         5  t          j        dd¬¦  «         t          j        | t          j        ¬¦  «        } ddd¦  «         n# 1 swxY w Y   t          j        j	         
                    | ¦  «        }|\  }}}}}}t          ||||||¦  «        }|S )zy
    Probe a video in memory and return VideoMetaData with info about the video
    This function is torchscriptable
    ro   rp   rq   rs   N)ru   rW   rv   rw   rx   ry   rz   r{   rX   r   Úprobe_video_from_memoryr;   )	ri   rZ   r0   r1   r2   r3   r4   r5   r]   s	            r   Ú_probe_video_from_memoryrƒ      s  € õ �j¥%¤,Ñ/Ô/ð IÝÔ$Ñ&Ô&ð 	Ið 	IåÔ# HÐ6XÐYÑYÔYÐYÝÔ)¨*½E¼KÐHÑHÔHˆJð	Ið 	Ið 	Iñ 	Iô 	Ið 	Ið 	Ið 	Ið 	Ið 	Ið 	Iøøøð 	Ið 	Ið 	Ið 	Iõ ŒYÔ#×;Ò;¸JÑGÔG€FØEKÑB€Iˆt�Y 	¨<¸Ý�i  y°)¸\È9ÑUÔU€DØ€Kr€   ÚptsÚ	start_ptsÚend_ptsÚpts_unitc           	      ó   ‡‡‡— ‰€t          d¦  «        Š‰dk    rt          j        d¦  «         t          | ¦  «        }|j        }|j        }ˆˆˆfd„}d}t          }	|r/t          |j        j	        |j        j
        ¦  «        }	 ||	¦  «        }d}
t          }|r/t          |j        j	        |j        j
        ¦  «        } ||¦  «        }
t          | d||	d|
|¬¦  «        \  }}}i }|r
|j        |d<   |r
|j        |d	<   |||fS )
NÚinfr„   úmThe pts_unit 'pts' gives wrong results and will be removed in a follow-up version. Please use pts_unit 'sec'.c                 ó  •— ‰}‰}‰dk    rat          t          j        ‰d| z  z  ¦  «        ¦  «        }|t          d¦  «        k    r't          t          j        ‰d| z  z  ¦  «        ¦  «        }|t          d¦  «        k    rd}||fS )NÚsecr   r‰   r@   )r   ÚmathÚfloorr+   Úceil)Ú	time_baseÚstart_offsetÚ
end_offsetr†   r‡   r…   s      €€€r   Úget_ptsz_read_video.<locals>.get_ptsÆ  sŠ   ø€ Ø ˆØˆ
Ø�uÒÐÝ�tœz¨)°q¸9±}Ñ*EÑFÔFÑGÔGˆLØ�U 5™\œ\Ò)Ð)Ý ¥¤¨7°a¸)±mÑ+DÑ!EÔ!EÑFÔF�
Ø�˜u™œÒ%Ð%ØˆJØ˜ZÐ'Ð'r   rJ   T)rM   rR   r"   rS   r>   r&   r$   Ú	audio_fps)r+   rw   Úwarnrh   r!   r%   Údefault_timebaser   r"   r   r   r&   r^   r$   r(   )rK   r…   r†   r‡   r]   r!   r%   r“   rR   r"   r>   r&   r[   r<   Ú_infos    ```           r   Ú_read_videor˜   ²  sb  øøø€ ð €Ý˜‘,”,ˆà�5ÒÐÝŒð>ñ	
ô 	
ð 	
õ
 " (Ñ+Ô+€Dà”€IØ”€Ið	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(ð €OÝ%€NØð 2Ý! $Ô"5Ô"?ÀÔATÔA`ÑaÔaˆØ!˜' .Ñ1Ô1ˆà€OÝ%€NØð 2Ý! $Ô"5Ô"?ÀÔATÔA`ÑaÔaˆØ!˜' .Ñ1Ô1ˆå2ØØØ'Ø%ØØ'Ø%ðñ ô Ñ€GˆW�dð €EØð ,Ø!œ^ˆˆkÑØð 4Ø!Ô3ˆˆkÑà�G˜UÐ"Ð"r   c                 óö   ‡— |dk    rt          j        d¦  «         t          | ¦  «        \  }}}|dk    r2t          |j        j        |j        j        ¦  «        Šˆfd„|D ¦   «         }|j        r|j        nd }||fS )Nr„   rŠ   rŒ   c                 ó   •— g | ]}|‰z  ‘ŒS r   r   )Ú.0ÚxÚvideo_time_bases     €r   ú
<listcomp>z*_read_video_timestamps.<locals>.<listcomp>ý  s   ø€ Ð0Ð0Ð0 qˆq�?Ñ"Ð0Ð0Ð0r   )	rw   r•   re   r   r"   r   r   r!   r$   )rK   r‡   r„   Ú_r]   r$   r�   s         @r   Ú_read_video_timestampsr    ï  s™   ø€ ð �5ÒÐÝŒð>ñ	
ô 	
ð 	
õ 4°HÑ=Ô=�L€CˆˆDà�5ÒÐÝ" 4Ô#6Ô#@À$ÔBUÔBaÑbÔbˆØ0Ð0Ð0Ð0¨CÐ0Ñ0Ô0ˆà"&¤.Ð:�”�°d€Ià�	ˆ>Ðr   )rI   r   r   r   r   r   rJ   r   r   r   r   r   rJ   r   r   )r   Nr„   )r„   )$r�   rw   Ú	fractionsr   Útypingr   r   r   r   r   rW   Ú	extensionr
   Ú_HAS_CPU_VIDEO_DECODERÚImportErrorÚOSErrorÚ_HAS_VIDEO_OPTr–   r   r    r   r/   rv   r;   rH   Ústrr+   r*   r^   re   rh   r}   r   rƒ   r˜   r    r   r   r   ú<module>r©      s¼  ðØ €€€Ø €€€Ø Ð Ð Ð Ð Ð Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5à €€€à %Ð %Ð %Ð %Ð %Ð %ð#Ø€M�.Ñ!Ô!Ð!Ø!ÐÐøØ�WÐð #ð #ð #Ø"ÐÐÐð#øøøð (€Ø�8˜A˜q‘>”>Ð ð

'ð 
'ð 
'ð 
'ð 
'ñ 
'ô 
'ð 
'ð%ð %ð %ð %ð %ñ %ô %ð %ðB
˜U 3¨ 8œ_ð 
°ð 
ð 
ð 
ð 
ðØŒ|ðà
Œ,ðð Œ|ðð Œ|ð	ð
 ”,ðð Œ|ðð ðð ð ð ð@#ØŒ\ð#Ø',¤|ð#ØFKÈCÐQTÈHÄoð#à
„\ð#ð #ð #ð #ð"  $Ø"ØØØ Ø Ø'.Ø/Ø"ØØØ'.Ø/ð]"ð ]"Øð]"àð]"ð ð]"ð ð	]"ð
 ð]"ð ð]"ð ð]"ð ˜3 ˜8”_ð]"ð ð]"ð ð]"ð ð]"ð ð]"ð ˜3 ˜8”_ð]"ð ð]"ð ˆ5Œ<˜œ }Ð4Ô5ð]"ð ]"ð ]"ð ]"ð@ (¨sð  (°u¸TÀ#¼YÈÈSÌ	ÐS`Ð=`Ô7að  (ð  (ð  (ð  (ðF Sð ¨]ð ð ð ð ð  $ØØØØ Ø Ø'.Ø$%Ø&'ØØØØ'.Ø$%Ø&'ð!jð jØ”ðjàðjð ðjð ð	jð
 ðjð ðjð ðjð ˜3 ˜8”_ðjð "ðjð !$ðjð ðjð ðjð ðjð ˜3 ˜8”_ðjð "ðjð  !$ð!jð" ˆ5Œ<˜œÐ%Ô&ð#jð jð jð jðZ'(Ø”ð'(à
ˆ4�Œ9�d˜3”i Ð.Ô/ð'(ð '(ð '(ð '(ðTØ”ðàðð ð ð ð( )*Ø04Øð	:#ð :#Øð:#à�U˜H�_Ô%ð:#ð �e˜E 8˜OÔ,Ô-ð:#ð ð	:#ð
 ˆ5Œ<˜œ t¨C°¨JÔ'7Ð7Ô8ð:#ð :#ð :#ð :#ð| $)ðð ØðØ ðà
ˆ5��c”˜D œNÐ*Ô+¨X°e¬_Ð<Ô=ðð ð ð ð ð s   ¨6 ¶	AÁA