Steve Baker
New Member
So I need to stream the output of a large/complex OpenGL application using libobs.
My plan (possibly naive) is to stick some kind of libobs initialization code into my initialization. Then to maybe make some kind of an OBS API call every frame (maybe just before or just after my SwapBuffers call) and have everything magically stream someplace.
Given the lack of documentation - or any example programs that would give me "the big picture" here, I'm working to understand whether this is even The Right Thing or not...so;
1) I take an existing glfw program that renders a spinning cube.
2) I create my OpenGL rendering context, I make it current.
3) I do an obs_startup("en-US").
4) I populate an obs_video_info structure (using "libobs-opengl") and pass it into obs_reset_video().
5) I loop around rendering my spinning cube and swapping the buffers to display it.
6) At the end, I do obs_shutdown(), then close my window and exit.
I presume that I'll be able to figure out what I put inside the loop to grab video and stream it...but because I like to work carefully, I compile and run my program "as is" and run it...expecting good OBS initialisation, then a spinning cube (but no streaming until I write more code).
Both obs_* calls seem to work OK and return no errors. I can see "libobs-opengl" being dlopen'ed successfully...but unfortunately, the next time I do an OpenGL buffer swap, the program crashes somewhere deep inside OpenGL...if I remove the obs_* calls, it all works OK - if I comment out the buffer swap, it runs to completion (but of course displays nothing) and exits cleanly.
So evidently the OBS stuff is somehow actively DOING SOMETHING to OpenGL in the initialization/reset stuff. Given my 'big picture' concept - I can't guess what that might be.
Any ideas?
My plan (possibly naive) is to stick some kind of libobs initialization code into my initialization. Then to maybe make some kind of an OBS API call every frame (maybe just before or just after my SwapBuffers call) and have everything magically stream someplace.
Given the lack of documentation - or any example programs that would give me "the big picture" here, I'm working to understand whether this is even The Right Thing or not...so;
1) I take an existing glfw program that renders a spinning cube.
2) I create my OpenGL rendering context, I make it current.
3) I do an obs_startup("en-US").
4) I populate an obs_video_info structure (using "libobs-opengl") and pass it into obs_reset_video().
5) I loop around rendering my spinning cube and swapping the buffers to display it.
6) At the end, I do obs_shutdown(), then close my window and exit.
I presume that I'll be able to figure out what I put inside the loop to grab video and stream it...but because I like to work carefully, I compile and run my program "as is" and run it...expecting good OBS initialisation, then a spinning cube (but no streaming until I write more code).
Both obs_* calls seem to work OK and return no errors. I can see "libobs-opengl" being dlopen'ed successfully...but unfortunately, the next time I do an OpenGL buffer swap, the program crashes somewhere deep inside OpenGL...if I remove the obs_* calls, it all works OK - if I comment out the buffer swap, it runs to completion (but of course displays nothing) and exits cleanly.
So evidently the OBS stuff is somehow actively DOING SOMETHING to OpenGL in the initialization/reset stuff. Given my 'big picture' concept - I can't guess what that might be.
Any ideas?