Skip to content

Commit 6cdb59c

Browse files
committed
clean up
1 parent 0033391 commit 6cdb59c

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

pympeg/_filter.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ def run(caller, display_command=True):
664664
args=command,
665665
shell=True,
666666
stdout=PIPE,
667-
stderr=STDOUT,
667+
stderr=PIPE,
668668
universal_newlines=True,
669669
encoding='utf-8'
670670
)
@@ -676,7 +676,11 @@ def run(caller, display_command=True):
676676

677677
if code:
678678
progress.clear()
679-
FFmpegException('ffmpeg', "", code)
679+
raise FFmpegException(
680+
'ffmpeg',
681+
''.join(process.stderr.readlines()[-10: ]),
682+
'Error code :: %s' % code
683+
)
680684

681685

682686
@stream()

pympeg/_node.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -268,19 +268,19 @@ def __getitem__(self, item):
268268

269269
class GlobalNode:
270270
"""
271-
GlobalNode helps in creating some argument based ffmpeg construct that
272-
cannot be created using the FilterNode, this takes in the name of the function
273-
and its parameter as the string
274-
275-
Attributes
276-
----------
277-
_args : str
278-
the complete command
279-
_inputs : list
280-
input labels for the command
281-
_outputs : list
282-
output labels for the command
283-
"""
271+
GlobalNode helps in creating some argument based ffmpeg construct that
272+
cannot be created using the FilterNode, this takes in the name of the function
273+
and its parameter as the string
274+
275+
Attributes
276+
----------
277+
_args : str
278+
the complete command
279+
_inputs : list
280+
input labels for the command
281+
_outputs : list
282+
output labels for the command
283+
"""
284284

285285
def __init__(self, inputs=None, args=None, outputs=None):
286286
self._args = args

pympeg/_probe.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88

99
def probe(filename, cmd='ffprobe', timeout=None):
1010
"""Runs the ffprobe on the given file and outputs in json format """
11+
1112
args = [cmd, '-show_format', '-show_streams', '-of', 'json']
1213
args += [filename]
1314

14-
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
15+
p = subprocess.Popen(
16+
args,
17+
stdout=subprocess.PIPE,
18+
stderr=subprocess.PIPE
19+
)
1520

1621
communicate_kwargs = {}
1722
if timeout is not None:

0 commit comments

Comments
 (0)