Wrapper para o binário FFmpeg
Project description
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
conversão básica
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
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ffmpeg_for_python-0.3.9.tar.gz
(91.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ffmpeg_for_python-0.3.9.tar.gz.
File metadata
- Download URL: ffmpeg_for_python-0.3.9.tar.gz
- Upload date:
- Size: 91.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b23a68c870877476e2fbe304ddf48604d8e29f05671d501107b7d3eb883404bc
|
|
| MD5 |
4704811b3c1a58156880bbff154244c1
|
|
| BLAKE2b-256 |
4814072693a53912915471bc6829a11e42642053b21fe42cbbe17e5a9e467d7c
|
File details
Details for the file ffmpeg_for_python-0.3.9-py3-none-any.whl.
File metadata
- Download URL: ffmpeg_for_python-0.3.9-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b335c5210190934a0ba6fe1c811c0be224ba566f43a0f4d3131814d0bdb14ca
|
|
| MD5 |
8ca164ea98a7c3dc39407d3a52dc93a3
|
|
| BLAKE2b-256 |
669dc8384a0cf50279c65a1a49b5614233a27e957b8aa845d400a0c295755e06
|