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

Raise WasmUnsupportedError for ffmpeg usage on Lite #9130

Merged
merged 9 commits into from
Aug 20, 2024
5 changes: 5 additions & 0 deletions .changeset/puny-bats-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": patch
---

feat:Raise WasmUnsupportedError for ffmpeg usage on Lite
10 changes: 10 additions & 0 deletions gradio/components/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,11 @@ def example_value(self) -> Any:

@staticmethod
def get_video_duration_ffprobe(filename: str):
if wasm_utils.IS_WASM:
raise wasm_utils.WasmUnsupportedError(
"ffprobe is not supported in the Wasm mode."
)

result = subprocess.run(
[
"ffprobe",
Expand Down Expand Up @@ -452,6 +457,11 @@ def get_video_duration_ffprobe(filename: str):

@staticmethod
async def async_convert_mp4_to_ts(mp4_file, ts_file):
if wasm_utils.IS_WASM:
raise wasm_utils.WasmUnsupportedError(
"Streaming is not supported in the Wasm mode."
)

ff = FFmpeg( # type: ignore
inputs={mp4_file: None},
outputs={
Expand Down
Loading