ffmpeg-for-python 0.3.2__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ffmpeg_for_python-0.3.2/ffmpeg_for_python.egg-info → ffmpeg_for_python-0.3.4}/PKG-INFO +3 -3
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/README.md +1 -1
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python/__version__.py +1 -1
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python/ffmpeg.py +33 -27
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4/ffmpeg_for_python.egg-info}/PKG-INFO +3 -3
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/MANIFEST.in +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/assets/ffmpeg-for-python-logo.png +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python/__config__.py +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python/__init__.py +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python/__utils.py +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python/exeptions.py +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python/ffmpeg-bin/readme.md +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python.egg-info/SOURCES.txt +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python.egg-info/dependency_links.txt +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python.egg-info/not-zip-safe +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python.egg-info/top_level.txt +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/setup.cfg +0 -0
- {ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/setup.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ffmpeg-for-python
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Wrapper para o binário FFmpeg
|
|
5
5
|
Author: PauloCesar-dev404
|
|
6
6
|
Author-email: paulocesar0073dev404@gmail.com
|
|
7
7
|
License: MIT
|
|
8
|
-
Project-URL: Código Fonte, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.
|
|
9
|
-
Project-URL: lib, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.
|
|
8
|
+
Project-URL: Código Fonte, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.4.tar.gz
|
|
9
|
+
Project-URL: lib, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.4-py3-none-any.whl
|
|
10
10
|
Project-URL: GitHub, https://github.com/PauloCesar-dev404/ffmpeg-for-python
|
|
11
11
|
Project-URL: Bugs/Melhorias, https://github.com/PauloCesar-dev404/ffmpeg-for-python/issues
|
|
12
12
|
Project-URL: Documentação, https://github.com/PauloCesar-dev404/ffmpeg-for-python/wiki
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-

|
|
8
8
|

|
|
9
9
|
[](https://apoia.se/paulocesar-dev404)
|
|
10
10
|
|
|
@@ -45,15 +45,14 @@ class FFmpeg:
|
|
|
45
45
|
"""Executa o comando FFmpeg construído.
|
|
46
46
|
|
|
47
47
|
Args:
|
|
48
|
-
capture_output (bool): Se verdadeiro, captura a saída
|
|
48
|
+
capture_output (bool): Se verdadeiro, captura a saída e printa no console.
|
|
49
|
+
Se False, a saída é retornada assincronamente em tempo real.
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
Yields:
|
|
52
|
+
str: Cada linha da saída filtrada do FFmpeg quando capture_output é False.
|
|
52
53
|
"""
|
|
53
54
|
|
|
54
55
|
configs = self.__oculte_comands_your_system.get('startupinfo')
|
|
55
|
-
# Armazenar a saída completa, se for necessário capturá-la
|
|
56
|
-
output = []
|
|
57
56
|
|
|
58
57
|
# Executa o comando utilizando subprocess
|
|
59
58
|
with subprocess.Popen(
|
|
@@ -66,25 +65,32 @@ class FFmpeg:
|
|
|
66
65
|
bufsize=1, # Linha por linha
|
|
67
66
|
universal_newlines=True # Garante que novas linhas sejam interpretadas corretamente
|
|
68
67
|
) as process:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
68
|
+
try:
|
|
69
|
+
# Lê a saída de erro padrão (stderr) em tempo real
|
|
70
|
+
for linha in process.stderr:
|
|
71
|
+
time.sleep(0.01) # Simulação de latência, opcional
|
|
72
|
+
|
|
73
|
+
# Filtra a linha de erro padrão
|
|
74
|
+
linha_filtrada = wraper_erros(linha)
|
|
75
|
+
|
|
76
|
+
if linha_filtrada:
|
|
77
|
+
# Se houver um erro detectado, o processo é encerrado
|
|
78
|
+
process.terminate()
|
|
79
|
+
raise FFmpegExceptions(message=f'Erro na execução do ffmpeg: "{linha_filtrada}"')
|
|
80
|
+
else:
|
|
81
|
+
if capture_output:
|
|
82
|
+
# Se `capture_output` estiver ativado, imprime a saída
|
|
83
|
+
print(linha.strip())
|
|
84
|
+
else:
|
|
85
|
+
# Retorna a linha assincronamente quando capture_output é False
|
|
86
|
+
yield linha.strip()
|
|
87
|
+
|
|
88
|
+
# Aguarda a conclusão do processo
|
|
89
|
+
process.wait()
|
|
90
|
+
|
|
91
|
+
except Exception as e:
|
|
92
|
+
process.terminate()
|
|
93
|
+
raise FFmpegExceptions(message=f'Erro no processo FFmpeg: {str(e)}')
|
|
88
94
|
|
|
89
95
|
def input(self, file_path: str) -> 'FFmpeg':
|
|
90
96
|
"""Define o arquivo de entrada para o FFmpeg."""
|
|
@@ -134,9 +140,9 @@ class FFmpeg:
|
|
|
134
140
|
self.__command.extend(['-c:a', 'copy', '-c:v', 'copy'])
|
|
135
141
|
return self
|
|
136
142
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
143
|
+
def reset_ffmpeg(self) -> 'FFmpeg':
|
|
144
|
+
"""Reseta o comando para reutilização do objeto,isso é necessário em caso de uso em loops,
|
|
145
|
+
a cada execução execute o reset para ter certeza que estar limpo o cache de comandos"""
|
|
140
146
|
self.__command = [self.__ffmpeg_path]
|
|
141
147
|
return self
|
|
142
148
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ffmpeg-for-python
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Wrapper para o binário FFmpeg
|
|
5
5
|
Author: PauloCesar-dev404
|
|
6
6
|
Author-email: paulocesar0073dev404@gmail.com
|
|
7
7
|
License: MIT
|
|
8
|
-
Project-URL: Código Fonte, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.
|
|
9
|
-
Project-URL: lib, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.
|
|
8
|
+
Project-URL: Código Fonte, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.4.tar.gz
|
|
9
|
+
Project-URL: lib, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.4-py3-none-any.whl
|
|
10
10
|
Project-URL: GitHub, https://github.com/PauloCesar-dev404/ffmpeg-for-python
|
|
11
11
|
Project-URL: Bugs/Melhorias, https://github.com/PauloCesar-dev404/ffmpeg-for-python/issues
|
|
12
12
|
Project-URL: Documentação, https://github.com/PauloCesar-dev404/ffmpeg-for-python/wiki
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{ffmpeg_for_python-0.3.2 → ffmpeg_for_python-0.3.4}/ffmpeg_for_python.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|