1) "之前 = 之(pron)+ 前",the antonym of it is "之后=之+后”
you can understand it as "before something happened" and "before some time passed". as well.
2)以前“ normal just used as " before some time " , the relative term of it is " 以后”
ex:
it's better wash your hands before eating
吃饭之前,最好先洗手。or 吃饭以前,最好先洗手。
all the thing i have told you was truth.
之前我跟你讲的都是真话。or 以前我跟你讲的都是真话。
but something different in some situation as below
1) long time ago... / long long time ago... : 很久以前... / 很久很久以前...
before starting with a fale story, normally the term " 以前“ is used to
emphasis some far-off times and mystery feeling.
2) if you should use "before" or "after" together, it's better use them in symmetric way.
ex. 之前..., 之后... or 以前..., 以后...