U
    Eh                     @   s   d dl mZ d dlmZ ddlmZ ddlmZmZmZm	Z	m
Z
mZ dd Ze dd Ze d	d
 Ze dd Ze dd Zdddd
gZdS )    )unicode_literals)
basestring   )filter_operator
GlobalNode	InputNodeMergeOutputsNode
OutputNodeoutput_operatorc                 K   sB   | |d< | dd}|r0d|kr(td||d< ttj|d S )a>  Input file URL (ffmpeg ``-i`` option)

    Any supplied kwargs are passed to ffmpeg verbatim (e.g. ``t=20``,
    ``f='mp4'``, ``acodec='pcm'``, etc.).

    To tell ffmpeg to read from stdin, use ``pipe:`` as the filename.

    Official documentation: `Main options <https://ffmpeg.org/ffmpeg.html#Main-options>`__
    filenamefNformat*Can't specify both `format` and `f` kwargskwargs)pop
ValueErrorr   input__name__stream)r   r   fmt r   @/var/www/html/venv/lib/python3.8/site-packages/ffmpeg/_ffmpeg.pyr      s    
r   c                 G   s   t | tj| S )zCAdd extra global command-line argument(s), e.g. ``-progress``.
    )r   global_argsr   r   )r   argsr   r   r   r   #   s    r   c                 C   s   t | tjdg S )zOverwrite output files without asking (ffmpeg ``-y`` option)

    Official documentation: `Main options <https://ffmpeg.org/ffmpeg.html#Main-options>`__
    z-y)r   overwrite_outputr   r   )r   r   r   r   r   *   s    r   c                  G   s   t | tj S )z9Include all given outputs in one ffmpeg command line
    )r   merge_outputsr   r   )streamsr   r   r   r   3   s    r   c                  O   st   t | } d|kr4t| d ts&td| d|d< | }|dd}|r`d|krXtd||d< t|tj|d S )	a?  Output file URL

    Syntax:
        `ffmpeg.output(stream1[, stream2, stream3...], filename, **ffmpeg_args)`

    Any supplied keyword arguments are passed to ffmpeg verbatim (e.g.
    ``t=20``, ``f='mp4'``, ``acodec='pcm'``, ``vcodec='rawvideo'``,
    etc.).  Some keyword-arguments are handled specially, as shown below.

    Args:
        video_bitrate: parameter for ``-b:v``, e.g. ``video_bitrate=1000``.
        audio_bitrate: parameter for ``-b:a``, e.g. ``audio_bitrate=200``.
        format: alias for ``-f`` parameter, e.g. ``format='mp4'``
            (equivalent to ``f='mp4'``).

    If multiple streams are provided, they are mapped to the same
    output.

    To tell ffmpeg to write to stdout, use ``pipe:`` as the filename.

    Official documentation: `Synopsis <https://ffmpeg.org/ffmpeg.html#Synopsis>`__
    r   zA filename must be providedr   Nr   r   r   )	list
isinstancer   r   r   r	   outputr   r   )Zstreams_and_filenamer   r   r   r   r   r   r!   :   s    r!   N)
__future__r   Zpast.builtinsr   Z_utilsZnodesr   r   r   r   r	   r
   r   r   r   r   r!   __all__r   r   r   r   <module>   s    




&