Search online for a "bitrate calculator" and there are many, enter the specs of your video and it will tell you what bitrate to encode at for it to fit the disc. I will typically use a rate a little lower as a safety margin. A 25GB Blu-ray can easily hold 2-3 hours of video depending on bitrate used. While the max is about 40, you can get great results at 20-25 for longer movies when encoding with H.264, so don't worry about that.
Thanks
Jeff Pulera
Safe Harbor Computers