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

Output flips vertically every frame when using buffer and video loaders #13

Open
o-dawgie opened this issue Mar 18, 2021 · 1 comment
Open

Comments

@o-dawgie
Copy link

I'm trying to apply a shader that uses a buffer to my webcam in real time, but I'm having quite a few issues getting it to work. When I run the command:

./shady -i /hdd/Downloads/shaders/video-feedback-flow/image.glsl -ofmt rgb24 -g 640x480 -f 60 | ffplay -f rawvideo -pixel_format rgb24 -video_size 640x480 -framerate 60 -

everything works almost as expected, but at some point along the line, the image gets flipped vertically every frame, which makes the output pretty much unusable. I tried using a video file as input instead of my webcam just in case it was a problem with that, but I got the same result. I also tested outputting to a file with

./shady -i /hdd/Downloads/shaders/video-feedback-flow/image.glsl -ofmt rgb24 -g 640x480 -f 60 -n 300 -o /hdd/Downloads/shaders/video-feedback-flow/test.bin

and playing it back with ffplay, but this had the same result. Finally I tried rendering to an mp4 with

./shady -i /hdd/Downloads/shaders/video-feedback-flow/image.glsl -ofmt rgb24 -g 640x480 -f 60 | ffmpeg -f rawvideo -pixel_format rgb24 -video_size 640x480 -framerate 60 -t 5 -i - /hdd/Downloads/shaders/video-feedback-flow/test2.mp4

but nothing changed that time either. As far as I can tell, this only seems to happen when a shader is using both the video loader and the buffer loader, and each one works fine when used without the other. I'm not particularly knowledgeable about this type of stuff so there's a decent chance I just made a mistake somewhere, but I couldn't figure it out so hopefully someone else will be able to track down the problem.

If it would be helpful, I could attach the files for the shaders I used and/or an example recording of the problem, but to keep this short I'm leaving them off for now. Let me know if you need more information.

@polyfloyd
Copy link
Owner

Yes, please attach your shader source.

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

2 participants