mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #2730 from pypeclub/bugfix/OP-2646_Webpublisher-ExtractReview-fails
WebPublisher: Fix for proper parsing of ffmpeg output arguments
This commit is contained in:
commit
51c28d497a
3 changed files with 31 additions and 4 deletions
|
|
@ -694,13 +694,13 @@ class ExtractReview(pyblish.api.InstancePlugin):
|
|||
audio_args_dentifiers = ["-af", "-filter:a"]
|
||||
for arg in tuple(output_args):
|
||||
for identifier in video_args_dentifiers:
|
||||
if identifier in arg:
|
||||
if arg.startswith("{} ".format(identifier)):
|
||||
output_args.remove(arg)
|
||||
arg = arg.replace(identifier, "").strip()
|
||||
video_filters.append(arg)
|
||||
|
||||
for identifier in audio_args_dentifiers:
|
||||
if identifier in arg:
|
||||
if arg.startswith("{} ".format(identifier)):
|
||||
output_args.remove(arg)
|
||||
arg = arg.replace(identifier, "").strip()
|
||||
audio_filters.append(arg)
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@ Structure:
|
|||
|
||||
How to run:
|
||||
----------
|
||||
- single test class could be run by PyCharm and its pytest runner directly
|
||||
- OR
|
||||
- use Openpype command 'runtests' from command line (`.venv` in ${OPENPYPE_ROOT} must be activated to use configured Python!)
|
||||
-- `${OPENPYPE_ROOT}/python start.py runtests`
|
||||
|
||||
|
|
|
|||
29
tests/unit/openpype/plugins/publish/test_extract_review.py
Normal file
29
tests/unit/openpype/plugins/publish/test_extract_review.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
from openpype.plugins.publish.extract_review import ExtractReview
|
||||
|
||||
|
||||
def test_fix_ffmpeg_full_args_filters():
|
||||
"""Tests because of wrong resolution of audio filters."""
|
||||
plugin = ExtractReview()
|
||||
output_arg = "c:/test-afbdc"
|
||||
ret = plugin.ffmpeg_full_args([], [], [], [output_arg])
|
||||
assert len(ret) == 2, "Parsed wrong"
|
||||
assert ret[-1] == output_arg
|
||||
|
||||
ret = plugin.ffmpeg_full_args([], [], ["adeclick"], [output_arg])
|
||||
assert len(ret) == 4, "Parsed wrong"
|
||||
assert ret[-1] == output_arg
|
||||
assert ret[-2] == '"adeclick"'
|
||||
assert ret[-3] == "-filter:a"
|
||||
|
||||
ret = plugin.ffmpeg_full_args([], [], [], [output_arg, "-af adeclick"])
|
||||
assert len(ret) == 4, "Parsed wrong"
|
||||
assert ret[-1] == output_arg
|
||||
assert ret[-2] == '"adeclick"'
|
||||
assert ret[-3] == "-filter:a"
|
||||
|
||||
ret = plugin.ffmpeg_full_args([], [], ["adeclick"],
|
||||
[output_arg, "-af adeclick"])
|
||||
assert len(ret) == 4, "Parsed wrong"
|
||||
assert ret[-1] == output_arg
|
||||
assert ret[-2] == '"adeclick,adeclick"' # TODO fix this duplication
|
||||
assert ret[-3] == "-filter:a"
|
||||
Loading…
Add table
Add a link
Reference in a new issue