This came to mind as well great suggestion.
I haven’t used MythTV in years but I remember it being quite decent at commercial detection. Sometimes it missed the boundary between show and commercial by 1-2s, but otherwise was great.
(I bet they check for volume changes as one of the algorithms)