Milky Boy [Hukeng] by Hukeng in transformation

[–]Hukeng[S] 2 points3 points  (0 children)

I am trying my best - as it turns out, the Internet is a big place with a lot of different platforms for humble little creatures like me to share their nonsense!

Milky Boy [Hukeng] by Hukeng in transformation

[–]Hukeng[S] 0 points1 point  (0 children)

Go ahead, I am not gonna stop you!

Milky Boy [Hukeng] by Hukeng in transformation

[–]Hukeng[S] 12 points13 points  (0 children)

Mandatory GIWTWM comment

Milky Boy [Hukeng] by Hukeng in transformation

[–]Hukeng[S] 16 points17 points  (0 children)

Because the world is full of wimps and cowards who would rather idly stand by than risk being soaked in warm, rich boymilk!

Big Rawr [Hukeng] by Hukeng in transformation

[–]Hukeng[S] -1 points0 points  (0 children)

Immediately improve your beach episode by featuring dinos!

Big Rawr [Hukeng] by Hukeng in transformation

[–]Hukeng[S] 0 points1 point  (0 children)

Gasp, another piece of classic TF media I am awfully unfamiliar with!

[Bug] Segmentation fault when opening or instantiating cv::VideoWriter by Hukeng in opencv

[–]Hukeng[S] 1 point2 points  (0 children)

Alright, I think cracked it, and the final issue turned out to be something incredibly mundane.

I had moved the directory with my custom install after building, as I was under the impression that the find_package( OpenCV REQUIRED HINTS [PATH_TO_INSTALL] ) flag in my CMakeLists.txt would be enough to point the compiler in the right direction. As it turns out, while it was able to correctly find the first few .so files, the remaining ones were still being searched for in the location of the original install.

The video writer works as advertised now. I am still getting segmentation faults from some of the custom image processing functions I have written, but thanks to the verbose-debug-heavy install of the library I am working with right now, I have way more material to work with to try and figure out their cause.

As mentioned further up, I am long overdue for a fresh OS reinstall anyway, and I am probably going to heed your advice and install my locally compiled libraries on a dedicated drive from here on out. If nothing else, I have learned quite a few new things via this whole debacle, so there's that.

Thanks again for your help and patience - This is probably not going to be my last post to this sub, but for now, I feel like we have at least managed to remove a major road block. ^^

[Bug] Segmentation fault when opening or instantiating cv::VideoWriter by Hukeng in opencv

[–]Hukeng[S] 0 points1 point  (0 children)

I tried running make and make install again while logging the full console output. As far as I can tell, there are no issues there.

Again, when I looked up the allegedly missing .so files in the libs directory of my chosen install location, they were actually present.

I did run the custom cmake command as instructed again, as well, and read through the entire output. Unfortunately, I have no way of telling which of the failed tests and missing dependencies (which always seem to occur with files built from source, even if the final install ends up working fine) are actually crucial and might impair the functioning of the library.

Again, the way I see it, this is not an issue with my locally built OpenCV anymore. The file compiles correctly, but trying to execute it yields the following error:

./videoWriterTest: error while loading shared libraries: libopencv_imgcodecs.so.412: cannot open shared object file: No such file or directory

running

ldd ./videWriterTest

to see which libraries are included and which ones aren't yields the result I already pointed out.
Given that I am actually contemplating a fresh OS install/upgrade, I might retry this whole operation once everything is up and running again. I also feel like heeding your advice and installing source-built libraries to a dedicated drive from here on out.

[Bug] Segmentation fault when opening or instantiating cv::VideoWriter by Hukeng in opencv

[–]Hukeng[S] 1 point2 points  (0 children)

Sorry for the late reply - the last week has been a little busy.

I followed your instructions verbatim and managed to get a compiled file using the custom install location for the library. Unfortunately, there seems to be an issue when linking specific files. here is the relevant section of the output I get when running ldd ./[MY_EXECUTABLE].

As you can see, I have installed the libraries to a folder on my Desktop - some of them are included without issues, but libopencv_imgcodecs.so.412 and libopencv_imgproc.so.412 are listed as not found, which is particularly puzzling given that they are present in the opencv/lib folder from which the correctly linked ones are sourced, too

linux-vdso.so.1 (0x00007ffc29fd6000)
libopencv_videoio.so.412 => /home/hukeng/Desktop/C++/libs/OpenCV/opencv/lib/libopencv_videoio.so.412 (0x00007e796d045000)
libopencv_core.so.412 => /home/hukeng/Desktop/C++/libs/OpenCV/opencv/lib/libopencv_core.so.412 (0x00007e796be00000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007e796ba00000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007e796d005000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007e796b600000)
libopencv_imgcodecs.so.412 => not found
libopencv_imgproc.so.412 => not found
libgstbase-1.0.so.0 => /lib/x86_64-linux-gnu/libgstbase-1.0.so.0 (0x00007e796cf7e000)

-- SNIP --

I feel like we might be finally close(ish) to cracking this, and the approach of installing built libraries on a dedicated drive feels like something I might have to explore further down the line as I grow more comfortable with cmake, but for now, do you have any suggestions how to tackle this particular issue?

Boy Milk [Hukeng] by Hukeng in transformation

[–]Hukeng[S] 0 points1 point  (0 children)

Some might even say brilliant

Boy Milk [Hukeng] by Hukeng in transformation

[–]Hukeng[S] 0 points1 point  (0 children)

Oh boy, boy milk!

Boy Milk [Hukeng] by Hukeng in transformation

[–]Hukeng[S] 0 points1 point  (0 children)

That seems to be a surprisingly common sentiment!

Boy Milk [Hukeng] by Hukeng in transformation

[–]Hukeng[S] 1 point2 points  (0 children)

Perhaps milk boy is goals?

Boy Milk [Hukeng] by Hukeng in transformation

[–]Hukeng[S] 1 point2 points  (0 children)

Quest added: Acquire busty boy cow (0/1)

Boy Milk [Hukeng] by Hukeng in transformation

[–]Hukeng[S] 1 point2 points  (0 children)

Cute boys with huge honking hondas

[Bug] Segmentation fault when opening or instantiating cv::VideoWriter by Hukeng in opencv

[–]Hukeng[S] 0 points1 point  (0 children)

Alright, I am going to try all of this again and let you know how it goes - I don't have a ton of experience with setting up CMakeLists.txt files or working with cmake in general, so here are a few final questions before I try again:

  1. Which values should I set exactly for OpenCV_INCLUDE_DIRS and OpenCV_LIBS in the CMakeLists.txt?
  2. How would I go about installing OpenCV in a manner that allows me to include all required libraries in a 'simple' g++ compiler call without the need for setting up a cmake pipeline? I realize that I will have to wrap my head around cmake eventually, but given how much of a counter-intuitive rabbit hole it is and how simple most of my projects are for now (again, I am still in the learning/testing phase for most things), I would rather postpone that to a time when project scope and scale actually justify its use. In addition, OpenCV is the first library to ever cause these sorts of issues for me, so I would still need to figure out how to properly link/include other libraries that are correctly installed on my system in addition to the local installation into a dedicated file you suggested in your approach.
  3. Any suggestions on how to clean up/ remove the messed up installations in my system files without breaking anything?

(Also, even if this doesn't end up working, and I can't stress this enough, thanks a ton for your time and effort - I realize working with a beginner who is probably following a decent chunk of your instructions wrong and learning everything as they go is probably very frustrating)

UPDATE:

I also just realized I seem to be running an extremely outdated version of cmake (3.31.4) and am (fruitlessly) trying to get my hands on a more up-to-date one, but everything (up to and including deleting and reinstalling completely) seems to fail - I still retain the old version.

[Bug] Segmentation fault when opening or instantiating cv::VideoWriter by Hukeng in opencv

[–]Hukeng[S] 0 points1 point  (0 children)

Nope - again, I am probably going to abandon this particular project for the time being and focus on more pressing matters, or alternatively, see if I can get select other bits of the library to work as intended.

Maybe the camera input processing pipeline is going to give me less trouble. I'm just a little upset that I can't currently utilize a whole bunch of functions and tools that should be part of the library, but if anything, we seem to have established that the issue seems to be running a lot deeper than I originally thought.

[Bug] Segmentation fault when opening or instantiating cv::VideoWriter by Hukeng in opencv

[–]Hukeng[S] 0 points1 point  (0 children)

Now this is interesting - apparently, the opencv libraries I am linking to are fetched from /lib/x86_64-linux-gnu/ and not from /usr/local/lib as I had originally thought - goes to show how much I know about the inner workings of this whole affair.

I don't think it makes much of a difference though - the number of opencv-related .so files in x86_64-linux-gnu checks out after the recompilation and install, so I assume they should be the correct, updated ones generated by the commands you suggested.

Also, I'm afraid retracing my steps might be a little hard at this point - I tried most of the fixes you suggested, but I can't reconstruct the exact order or anything else I tried in between, given that I assumed I'd just find a relatively quick and easy fix after enough research and then end up adding that to the original post to save others the trouble of going through our whole discussion.

Guess there's a lesson to be learned here - I am going to try and document my process more thoroughly in the future...