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

Unable to Upload Video via Frontend in Docker - "Uh oh, we cannot process this video" Error #361

Closed
NgdHung31 opened this issue Oct 7, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@NgdHung31
Copy link

NgdHung31 commented Oct 7, 2024

First off, thank you for creating this awesome project! I'm really enjoying using it.

I've encountered an issue when trying to upload my own video through the frontend. While I can successfully use my video by placing it in the demo/data/gallery folder and starting the container, I run into a problem when trying to upload it directly.

Specifically, after selecting "Upload" in the frontend, I receive the following error message:

Uh oh, we cannot process this video. Please upload another video, and make sure that the video’s file size is less than 70Mb.

I've double-checked the file size, and it is definitely under the 70MB limit. I'm wondering if this is a known issue or if anyone else has experienced something similar.

Any help or guidance would be greatly appreciated!

@raedle
Copy link
Contributor

raedle commented Oct 7, 2024

Thank you for reaching out and sharing your experience with us. We're glad to hear that you're enjoying our project!

Regarding the issue you've encountered, does this happen with all uploaded videos? Could you please check the terminal where you ran the command for any error messages (e.g., are there any ffmpeg errors)?

Thanks again for bringing this to our attention, and we look forward to hearing back from you!

@NgdHung31
Copy link
Author

Hi again,
Thanks for the quick reply!

I've done some further testing and can confirm that this happens with all videos I try to upload, even those around 1MB in size.
The terminal output when I attempt to upload a video is consistently:

backend-1  |  <my ip and my date, time> "POST /graphql HTTP/1.1" 400 24 "http://localhost:7262/" "Mozilla/5.0 (X11; Linux x86_64)

As mentioned before, I've tried using the provided sample videos and they work fine, so I believe ffmpeg is functioning correctly.

Interestingly, after looking through the source code, I don't think the issue lies within the 3 file processing conditions in useUploadVideo.ts (format, size, and count checks).

Based on my observations, it seems like the problem might be in the data flow between the frontend and backend. Perhaps there's an error in how the video data is being sent, or the backend is unable to receive/process the uploaded video data correctly.

I can provide more information about my Docker environment if needed. Any further guidance would be greatly appreciated!

Thanks!

raedle added a commit that referenced this issue Oct 8, 2024
Summary:

The Strawberry GraphQL library recently disabled multipart requests by default. This resulted in a video upload request returning "Unsupported content type" instead of uploading the video, processing it, and returning the video path.

This issue was raised in #361. A forward fix is to add `multipart_uploads_enabled=True` to the endpoint view.

Test Plan:

Tested locally with cURL and upload succeeds

*Request*

```
curl http://localhost:7263/graphql \
  -F operations='{ "query": "mutation($file: Upload!){ uploadVideo(file: $file) { path } }", "variables": { "file": null } }' \
  -F map='{ "file": ["variables.file"] }' \
  -F [email protected]
```

*Response*

```
{"data": {"uploadVideo": {"path": "uploads/<HASH>.mp4"}}}
```
@raedle
Copy link
Contributor

raedle commented Oct 8, 2024

We took a look on a fresh conda env install, and the issue is reproducible. The underlying issue was a breaking change introduced by a dependency. A forward fix is submitted in PR #364

raedle added a commit that referenced this issue Oct 8, 2024
Summary:

The Strawberry GraphQL library recently disabled multipart requests by default. This resulted in a video upload request returning "Unsupported content type" instead of uploading the video, processing it, and returning the video path.

This issue was raised in #361. A forward fix is to add `multipart_uploads_enabled=True` to the endpoint view.

Test Plan:

Tested locally with cURL and upload succeeds

*Request*

```
curl http://localhost:7263/graphql \
  -F operations='{ "query": "mutation($file: Upload!){ uploadVideo(file: $file) { path } }", "variables": { "file": null } }' \
  -F map='{ "file": ["variables.file"] }' \
  -F [email protected]
```

*Response*

```
{"data": {"uploadVideo": {"path": "uploads/<HASH>.mp4"}}}
```
raedle added a commit that referenced this issue Oct 8, 2024
[sam2][demo][1/x] Fix file upload

Summary:

The Strawberry GraphQL library recently disabled multipart requests by default. This resulted in a video upload request returning "Unsupported content type" instead of uploading the video, processing it, and returning the video path.

This issue was raised in #361. A forward fix is to add `multipart_uploads_enabled=True` to the endpoint view.

Test Plan:

Tested locally with cURL and upload succeeds

*Request*

```
curl http://localhost:7263/graphql \
  -F operations='{ "query": "mutation($file: Upload!){ uploadVideo(file: $file) { path } }", "variables": { "file": null } }' \
  -F map='{ "file": ["variables.file"] }' \
  -F [email protected]
```

*Response*

```
{"data": {"uploadVideo": {"path": "uploads/<HASH>.mp4"}}}
```
@raedle raedle self-assigned this Oct 8, 2024
@raedle raedle added the bug Something isn't working label Oct 8, 2024
@NgdHung31
Copy link
Author

That's fantastic, thank you so much for the quick investigation and fix! I'll check out PR #364 and test it out in my environment. I really appreciate your responsiveness and dedication to this project.

NicoJorgensen1 pushed a commit to NicoJorgensen1/sam2 that referenced this issue Oct 11, 2024
Summary:

The Strawberry GraphQL library recently disabled multipart requests by default. This resulted in a video upload request returning "Unsupported content type" instead of uploading the video, processing it, and returning the video path.

This issue was raised in facebookresearch#361. A forward fix is to add `multipart_uploads_enabled=True` to the endpoint view.

Test Plan:

Tested locally with cURL and upload succeeds

*Request*

```
curl http://localhost:7263/graphql \
  -F operations='{ "query": "mutation($file: Upload!){ uploadVideo(file: $file) { path } }", "variables": { "file": null } }' \
  -F map='{ "file": ["variables.file"] }' \
  -F [email protected]
```

*Response*

```
{"data": {"uploadVideo": {"path": "uploads/<HASH>.mp4"}}}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants