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

Got stuck when using ffmpeg to covert mp3 to wav with gr.Audio inputs #8424

Closed
1 task done
vicfullstack opened this issue May 31, 2024 · 4 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working pending clarification
Milestone

Comments

@vicfullstack
Copy link

Describe the bug

I deployed gradio 4.32.0 in Debian 11/12 server. I used gr.Audio as input. When I upload a mp3 file, it got stuck and consumed all the server's resource which result in the hanging of server.
inputs=[gr.Audio(sources=["upload", "microphone"], value="samples/sample_audio.mp3", type="filepath")],
It seems when I upload mp3 file, it will convert into wav automatically by ffmpeg, but the command of ffmpeg running in the background will keep running:
ffmpeg -y -i xxx.mp3 -acodec pcm_s16le -vn -f wav -

When I am running gradio 4.32.0 in my MacOS 14.5, it works well.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

Screenshot

image

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 4.32.0
gradio_client version: 0.17.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.3.0
fastapi: 0.111.0
ffmpy: 0.3.2
gradio-client==0.17.0 is not installed.
httpx: 0.27.0
huggingface-hub: 0.23.2
importlib-resources: 6.4.0
jinja2: 3.1.4
markupsafe: 2.1.5
matplotlib: 3.9.0
numpy: 1.26.4
orjson: 3.10.3
packaging: 24.0
pandas: 2.2.2
pillow: 10.3.0
pydantic: 2.7.2
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.4.6
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.3
typing-extensions: 4.12.0
urllib3: 2.2.1
uvicorn: 0.30.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.5.0
httpx: 0.27.0
huggingface-hub: 0.23.2
packaging: 24.0
typing-extensions: 4.12.0
websockets: 11.0.3

Severity

Blocking usage of gradio

@vicfullstack vicfullstack added the bug Something isn't working label May 31, 2024
@hannahblair hannahblair self-assigned this Jun 24, 2024
@hannahblair
Copy link
Collaborator

@abidlabs can you or someone else take a look into this one please? :)

@abidlabs abidlabs assigned abidlabs and unassigned hannahblair Aug 6, 2024
@thiswillbeyourgithub
Copy link
Contributor

This might be related to #7378 (comment)

@abidlabs
Copy link
Member

abidlabs commented Aug 9, 2024

@vicfullstack this is difficult for us to repro as it only seems to happen on certain environments. When I tested this on a Mac, I didn't see any errors, as you mentioned. A couple of suggestions:

  1. Can you make sure you are using the latest version of ffmpeg on your Debian environment?
  2. You can specify the format parameter in gr.Audio to prevent it from converting it to a wav files. Simply set format=".mp3" and it should stay in the same format.

Can you see if either of these work for you?

@abidlabs
Copy link
Member

Hi folks, I just merged in a PR that I think should solve this. If you'd like to try it out, please install Gradio from this fork: #8843 (instructions are in the PR body). If you are still experiencing this bug, I'll reopen the issue.

@abidlabs abidlabs closed this as not planned Won't fix, can't repro, duplicate, stale Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending clarification
Projects
None yet
Development

No branches or pull requests

4 participants