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

Allow audio files to be processed as events #87

Open
isaacna opened this issue Aug 16, 2021 · 5 comments
Open

Allow audio files to be processed as events #87

isaacna opened this issue Aug 16, 2021 · 5 comments
Labels
bug Something isn't working enhancement New feature or request
Projects

Comments

@isaacna
Copy link
Collaborator

isaacna commented Aug 16, 2021

Describe the Bug

Not sure if I should count this as a feature or bug, but currently, if the file passed to get_static_thumbnail has no fetchable thumbnail (a .wav audio file), the method and event gather pipeline will error out with

[ERROR: runner:  66 2021-08-16 00:06:27,588] Unexpected error: ValueError('Could not find a format to read the specified file in any-mode mode')
Traceback (most recent call last):
  File "/Users/Isaac/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prefect/engine/runner.py", line 48, in inner
    new_state = method(self, state, *args, **kwargs)
  File "/Users/Isaac/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prefect/engine/task_runner.py", line 860, in get_task_run_state
    logger=self.logger,
  File "/Users/Isaac/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prefect/utilities/executors.py", line 298, in run_task_with_timeout
    return task.run(*args, **kwargs)  # type: ignore
  File "/Users/Isaac/Desktop/cdp-backend/cdp_backend/pipeline/event_gather_pipeline.py", line 747, in get_video_and_generate_thumbnails
    tmp_video_path, session_content_hash
  File "/Users/Isaac/Desktop/cdp-backend/cdp_backend/utils/file_utils.py", line 208, in get_static_thumbnail
    reader = imageio.get_reader(video_path)
  File "/Users/Isaac/.pyenv/versions/3.7.9/lib/python3.7/site-packages/imageio/core/functions.py", line 182, in get_reader
    "Could not find a format to read the specified file in %s mode" % modename
ValueError: Could not find a format to read the specified file in any-mode mode

I think to generalize the event gather as much as possible, we should account for events that are just audio files (in addition to video files). This may require some minor refactoring in the pipeline as well if we want to avoid redundancy with the audio splitters.

Expected Behavior

Allow events that are just audio to be processed in the event gather pipeline.

Reproduction

Run an event gather flow with the event linked to a URI of audio instead of video

@isaacna isaacna added the bug Something isn't working label Aug 16, 2021
@evamaxfield
Copy link
Member

Hmmm. I think how we handle this error is a bug... but I don't think we have ever had the feature planned for "just handling audio" we definitely could do that though. It would be a larger project though.

In a related vain, I have always thought it would be neato to have as part of the pipeline a function that publishes the audio file to some sort of podcast service or something.

@evamaxfield evamaxfield added the enhancement New feature or request label Aug 16, 2021
@isaacna
Copy link
Collaborator Author

isaacna commented Aug 17, 2021

Would the basic function be any different than just the video pipeline with just no thumbnails? I found this bug bc I used to run the event gather pipeline on it when that was in development, pre thumbnail generation.

And yeah the podcast service could be a cool thing to add in the future!

@evamaxfield
Copy link
Member

I think for now, we can't support the "audio only pipeline" simply because we dont have anything on the front end to support just audio events. cc @tohuynh

We can spec out an audio only pipeline + front end in the future. Another option, prior to a "podcast transfer" would be to add a component to the front end for simply playing the audio not the video and make it be fancy like some websites where you can turn off your mobile display and the audio keeps playing. Idk if thats possible but I think that would be a short term solution for adding an audio only pipeline.

@evamaxfield
Copy link
Member

again this is for down the road (3.1 or later) but I will add an issue to the front end repo to get the idea out there

@isaacna
Copy link
Collaborator Author

isaacna commented Aug 17, 2021

Ah gotcha yeah I didn't think about the frontend limitations. But yeah having some type of cool audio UI component would be really cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
No open projects
v3.0
Backlog
Development

No branches or pull requests

2 participants