
    ga                     T    d dl mZ d dlmZ d dlmZ d dlmZ e G d de             Zy)    )	dataclass)Clip)Effect)concatenate_videoclipsc                   Z    e Zd ZU dZdZeed<   dZeed<   dZeed<   dZ	eed<   de
d	e
fd
Zy)Freezea  Momentarily freeze the clip at time t.

    Set `t='end'` to freeze the clip at the end (actually it will freeze on the
    frame at time clip.duration - padding_end seconds - 1 / clip_fps).
    With ``duration`` you can specify the duration of the freeze.
    With ``total_duration`` you can specify the total duration of
    the clip and the freeze (i.e. the duration of the freeze is
    automatically computed). One of them must be provided.
    r   tNfreeze_durationtotal_durationpadding_endclipreturnc                 P   |j                   t        d      | j                  dk(  r.|j                   | j                  z
  d|j                  z  z
  | _        | j
                  5| j                  t        d      | j                  |j                   z
  | _        | j                  dk7  r|d| j                   gng }|j                  | j                        j                  | j
                        g}| j                  |j                   k7  r|| j                  d gng }t        ||z   |z         S )zApply the effect to the clip.NzAttribute 'duration' not setend   z=You must provide either 'freeze_duration' or 'total_duration'r   )
duration
ValueErrorr	   r   fpsr
   r   to_ImageClipwith_durationr   )selfr   beforefreezeafters        `/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/moviepy/video/fx/Freeze.pyapplyzFreeze.apply   s   == ;<<66U?]]T%5%55DHHDDF'""* S  $(#6#6#FD &*ffk$x.!##DFF+99$:N:NOP%)VVt}}%<dffh 2%fvo&=>>    )__name__
__module____qualname____doc__r	   float__annotations__r
   r   r   r   r    r   r   r   r      sC     AuL!OU! NE K?$ ?4 ?r   r   N)	dataclassesr   moviepy.Clipr   moviepy.Effectr   ,moviepy.video.compositing.CompositeVideoClipr   r   r$   r   r   <module>r)      s,    !  ! O "?V "? "?r   