ffmpeg-for-python


Nameffmpeg-for-python JSON
Version 0.3.5 PyPI version JSON
download
home_pageNone
SummaryWrapper para o binário FFmpeg
upload_time2024-09-21 18:47:17
maintainerNone
docs_urlNone
authorPauloCesar-dev404
requires_pythonNone
licenseMIT
keywords ffmpeg
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ffmpeg-for-python

Wrapper para o binário FFmpeg, permitindo o uso de comandos FFmpeg via Python. Para saber como usar FFmpeg, consulte a documentação no [site oficial](https://ffmpeg.org/ffmpeg.html)


---


**conversão básica**

```python

from ffmpeg_for_python import FFmpeg, FFmpegExceptions

# Cria uma instância do wrapper FFmpeg
ffmpeg = FFmpeg()
# Caminho do arquivo de entrada e saída
input_video = 'input_video.mp4'
output_video = 'output_video.mkv'

# Define o arquivo de entrada e o arquivo de saída
(ffmpeg
        .overwrite_output  # Sobrescrever se existir
        .input(input_video)  # Vídeo de entrada
        .output(output_video)  # Vídeo final
)

    # Executa o comando FFmpeg e exibe a saída
try:
        ffmpeg.run(capture_output=True)
except FFmpegExceptions as e:
        print("Erro ao executar FFmpeg:", e)
```
---

**remux audio e video**

```python
from ffmpeg_for_python import FFmpeg, FFmpegExceptions
# Cria uma instância do wrapper FFmpeg
ffmpeg = FFmpeg()
# Caminho dos arquivos de entrada e saída
input_video = 'input_video.mp4'
input_audio = 'input_audio.mp4'
output_video = 'output_video.mp4'
# Define os arquivos de entrada e o arquivo de saída
(ffmpeg
        .overwrite_output  # Sobrescrever se existir
        .input(input_video)  # Vídeo de entrada
        .input(input_audio)  # Áudio
        .args(arguments=['-c:a', 'copy', '-c:v', 'copy'])  # Parâmetros de cópia de áudio e vídeo
        .output(output_video)  # Vídeo final
)

# Executa o comando FFmpeg e exibe a saída
try:
        ffmpeg.run(capture_output=True)
except FFmpegExceptions as e:
        print("Erro ao executar FFmpeg:", e)
```
---

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ffmpeg-for-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "ffmpeg",
    "author": "PauloCesar-dev404",
    "author_email": "paulocesar0073dev404@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/84/9b/2220d2272bffcacc49c5944a916eb9c6b87bad7b72ff9680cf7196b2587d/ffmpeg_for_python-0.3.5.tar.gz",
    "platform": "any",
    "description": "# ffmpeg-for-python\r\n\r\nWrapper para o bin\u00e1rio FFmpeg, permitindo o uso de comandos FFmpeg via Python. Para saber como usar FFmpeg, consulte a documenta\u00e7\u00e3o no [site oficial](https://ffmpeg.org/ffmpeg.html)\r\n\r\n\r\n---\r\n\r\n\r\n**convers\u00e3o b\u00e1sica**\r\n\r\n```python\r\n\r\nfrom ffmpeg_for_python import FFmpeg, FFmpegExceptions\r\n\r\n# Cria uma inst\u00e2ncia do wrapper FFmpeg\r\nffmpeg = FFmpeg()\r\n# Caminho do arquivo de entrada e sa\u00edda\r\ninput_video = 'input_video.mp4'\r\noutput_video = 'output_video.mkv'\r\n\r\n# Define o arquivo de entrada e o arquivo de sa\u00edda\r\n(ffmpeg\r\n        .overwrite_output  # Sobrescrever se existir\r\n        .input(input_video)  # V\u00eddeo de entrada\r\n        .output(output_video)  # V\u00eddeo final\r\n)\r\n\r\n    # Executa o comando FFmpeg e exibe a sa\u00edda\r\ntry:\r\n        ffmpeg.run(capture_output=True)\r\nexcept FFmpegExceptions as e:\r\n        print(\"Erro ao executar FFmpeg:\", e)\r\n```\r\n---\r\n\r\n**remux audio e video**\r\n\r\n```python\r\nfrom ffmpeg_for_python import FFmpeg, FFmpegExceptions\r\n# Cria uma inst\u00e2ncia do wrapper FFmpeg\r\nffmpeg = FFmpeg()\r\n# Caminho dos arquivos de entrada e sa\u00edda\r\ninput_video = 'input_video.mp4'\r\ninput_audio = 'input_audio.mp4'\r\noutput_video = 'output_video.mp4'\r\n# Define os arquivos de entrada e o arquivo de sa\u00edda\r\n(ffmpeg\r\n        .overwrite_output  # Sobrescrever se existir\r\n        .input(input_video)  # V\u00eddeo de entrada\r\n        .input(input_audio)  # \u00c1udio\r\n        .args(arguments=['-c:a', 'copy', '-c:v', 'copy'])  # Par\u00e2metros de c\u00f3pia de \u00e1udio e v\u00eddeo\r\n        .output(output_video)  # V\u00eddeo final\r\n)\r\n\r\n# Executa o comando FFmpeg e exibe a sa\u00edda\r\ntry:\r\n        ffmpeg.run(capture_output=True)\r\nexcept FFmpegExceptions as e:\r\n        print(\"Erro ao executar FFmpeg:\", e)\r\n```\r\n---\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Wrapper para o bin\u00e1rio FFmpeg",
    "version": "0.3.5",
    "project_urls": {
        "Bugs/Melhorias": "https://github.com/PauloCesar-dev404/ffmpeg-for-python/issues",
        "C\u00f3digo Fonte": "https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.5.tar.gz",
        "Documenta\u00e7\u00e3o": "https://github.com/PauloCesar-dev404/ffmpeg-for-python/wiki",
        "GitHub": "https://github.com/PauloCesar-dev404/ffmpeg-for-python",
        "lib": "https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.5-py3-none-any.whl"
    },
    "split_keywords": [
        "ffmpeg"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e3edb3790f3625aba98295ace5dd31e6de67256bd2f831f42b1950734d11197",
                "md5": "621f0b9a423e95bf3572df8040c83951",
                "sha256": "29dc341dc54df8fa91c727602f87fdcf02bdce43de1364ce3f4cecfc925a2c96"
            },
            "downloads": -1,
            "filename": "ffmpeg_for_python-0.3.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "621f0b9a423e95bf3572df8040c83951",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10146,
            "upload_time": "2024-09-21T18:47:16",
            "upload_time_iso_8601": "2024-09-21T18:47:16.003054Z",
            "url": "https://files.pythonhosted.org/packages/6e/3e/db3790f3625aba98295ace5dd31e6de67256bd2f831f42b1950734d11197/ffmpeg_for_python-0.3.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "849b2220d2272bffcacc49c5944a916eb9c6b87bad7b72ff9680cf7196b2587d",
                "md5": "80dfad812a84ec7ba6a8421d49bc8911",
                "sha256": "18642123d56565bb67d7496bc1b3ba74915d3a3635d01256a7f75574db25ee6f"
            },
            "downloads": -1,
            "filename": "ffmpeg_for_python-0.3.5.tar.gz",
            "has_sig": false,
            "md5_digest": "80dfad812a84ec7ba6a8421d49bc8911",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 90910,
            "upload_time": "2024-09-21T18:47:17",
            "upload_time_iso_8601": "2024-09-21T18:47:17.881988Z",
            "url": "https://files.pythonhosted.org/packages/84/9b/2220d2272bffcacc49c5944a916eb9c6b87bad7b72ff9680cf7196b2587d/ffmpeg_for_python-0.3.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-21 18:47:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PauloCesar-dev404",
    "github_project": "ffmpeg-for-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ffmpeg-for-python"
}
        
Elapsed time: 0.57740s