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

failed to generate code when uploading a screen recording #301

Open
brettyoung6678 opened this issue Apr 10, 2024 · 7 comments
Open

failed to generate code when uploading a screen recording #301

brettyoung6678 opened this issue Apr 10, 2024 · 7 comments

Comments

@brettyoung6678
Copy link

1、it will suceed when uploading a screenshot.
2、it will fail when uploading a screen recording.
the log from chrome console is as follows:
image
the log from backend service is as follows:
image

thanks for your help.

@abi
Copy link
Owner

abi commented Apr 10, 2024

@brettyoung6678 how large is your screen recording? And which browser are you using?

That information will be helpful to me in debugging this issue.

@brettyoung6678
Copy link
Author

browser : chrome version :123.0.6312.123(64 bit)
screen recording: 12,545KB
image

i can not upload here because of the size limitation of github. i can provide a s3 link if you need.

thanks a lot, @abi

@abi
Copy link
Owner

abi commented Apr 12, 2024

No need for the actual screen recording file. I just wanted to see how large the file was.

I'll check on my end if that should be okay.

One thing you could do is make the file smaller (just use some online compression site) and try it. I think it should work.

@hei2077
Copy link

hei2077 commented Apr 16, 2024

Same issue here. When generating screenshots, everything works fine, but whether it's screen recording or uploading local screen files, it fails to generate. The front-end indicates an error in generating the code.

@hei2077
Copy link

hei2077 commented Apr 16, 2024

I reviewed the backend logs and found that the system failed to process the video when uploading video files and attempting to generate code. Although the WebSocket connection was successfully established, and the server logs indicated that the code generation process had begun, an error occurred during the video file processing stage. The system tried to parse the video using the MoviePy library but encountered an IndexError with the message "list index out of range". The specific stack trace indicates that this error occurred while trying to read the video file's duration. Here is an excerpt from the error log:

Exception in ASGI application
OSError: MoviePy error: failed to read the duration of file C:\Users\mywinusername\AppData\Local\Temp\tmpfk6jogim.webm.
Here are the file infos returned by ffmpeg:

At the bottom of the error log, there is also an entry stating "C:\Users\mywinusername\AppData\Local\Temp\tmpfk6jogim.webm: Permission denied," indicating that access to this file was denied.

@brettyoung6678
Copy link
Author

No need for the actual screen recording file. I just wanted to see how large the file was.

I'll check on my end if that should be okay.

One thing you could do is make the file smaller (just use some online compression site) and try it. I think it should work.

Yes, you are right. i can work when i compress the file into a smaller one. thanks a lot.

@abi
Copy link
Owner

abi commented Apr 16, 2024

@brettyoung6678 Awesome, I'll try to make it work for larger files as well.

@hei2077 thanks for looking at all the logs. There's a problem browser recorded webm videos not including the duration which might be causing this problem. I have to fix this in s2c codebase but can you try recording the video using a different app or taking the recorded video and converting it to MP4. That might fix your problem. The problem could also be with the permissions of the temp directory. Could you try Googling and seeing if there's a fix for this. I'm using the Python tempfile lib: https://docs.python.org/3/library/tempfile.html to store the video before processing.

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

No branches or pull requests

3 participants