Yes, this can be done with OBS Raw (OBS -> Raw) and a GetMediaInputStatus request. Paste the code below into the Raw subaction and replace the inputName with the name of your media source. This request will populate a %obsRaw.mediaDuration% variable that gives the media duration in milliseconds. You can then use that variable within the Delay subaction.
Note: For the variable to populate, the media source needs to be visible. Use a Set Source Visibility State subaction to make it visible, add a delay of 100ms and then use the Raw subaction. (Example: see here)
{
"requestType": "GetMediaInputStatus",
"requestData": {
"inputName": "Your Media Source"
}
}