Bacillus veleznesis RB.EK7 was recently found as a potent rhizobacterial strain for effective management of black pepper root-knot nematodes. This work aimed to produce, purify, and elucidate the chemical structures of antinematode compounds (ANCs). Concerning cost-effectiveness and environmental issues, this study used organic wastes for the bioproduction of ANCs. Among various substrates, shrimp shells powder was the most suitable carbon/nitrogen source to produce ANCs. The fermentation process for enhancement of antinematode activity was investigated. The targeting ANCs were purified from the fermented culture broth, and their structures were elucidated. Two active compounds were thymine (1) and hexahydropyrrolo [1,2-a]pyrazine-1,4-dione (2). Notably, for the first time, these purified compounds showed potential and moderate anti- J2 nematodes and anti-eggs hatching, respectively. The docking study results indicated that the potent antinematode effect of these compounds may be possibly due to the inhibition of the targeting enzyme acetylcholinesterase. The data of this work suggest that organic waste SSP can be potentially reused for the production of thymine and hexahydropyrrolo [1,2-a] pyrazine-1,4-dione with promising use for the management of black pepper nematodes.