Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests of autoprocessing #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

rpanderson
Copy link
Collaborator

Tests autoscrub autoprocess command (by calling the CLI) on example_screencast.mp4, a file previously used for benchmarking and troubleshooting.

  • Check for successful completion of command.
  • Compare filtergraph to known valid ouput.
  • Check duration of processed file.
  • Check loudness statistics of processed file.

@rpanderson
Copy link
Collaborator Author

rpanderson commented May 10, 2020

Using Github Actions to run pytest on ubuntu-latest (actually 18.04.4), which passed.

Notes:

  • The latest FFmpeg on Ubuntu 18.04 is 3.4.4. This results in slightly different processing than FFmpeg 4.x, e.g. duration is 50.19s instead of 48.57s, some loudness values differ by 0.1 dB, and the filtergraph is therefore quite different.
  • I install 4.x using ppa:jonathonf/ffmpeg-4, which currently gets 4.2.2. There are others, e.g. ppa:savoury1/ffmpeg4.
  • This might have to revised when ubuntu-latest installs Ubuntu 20.04, or use snappy.
  • The line endings for the temporary filtergraph written by autoprocess differ on Windows (CRLF) and Linux (LF), so the strict filecmp.cmp call will currently only work for one of these (Linux).

TODO

p = autoscrub._agnostic_Popen(
["autoscrub", "autoprocess", "--debug", input, output]
)
_, stderr = autoscrub._agnostic_communicate(p)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per #2 in which processing continued indefinitely, a timeout is essential here, akin to subprocess.Popen.communicate. @philipstarkey, is this something that could/should be added to autoscrub._agnostic_communicate or should I be using something else. here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I've set a timeout on the test runner, using pytest-timeout.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why, but the test is stalling on Windows at this point (both locally and on Python 2.7 and 3.8).

@rpanderson rpanderson marked this pull request as draft May 10, 2020 07:37
@rpanderson rpanderson changed the title WIP: Add tests of autoprocessing Add tests of autoprocessing May 10, 2020
@rpanderson rpanderson marked this pull request as ready for review May 10, 2020 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant