Need to convert image url to a Base_64 data url with wordpress function..

In your post you wrote : “which will show an image like below”, I assume that your shortcode return an img tag and you have to find your URL here, tell me if I’m wrong.

Using DOMDocument http://php.net/manual/fr/class.domdocument.php to parse your img tag is a good idea.

$img = do_shortcode('[user_meta_avatar_pic]'); // Here your get your img tag

// Use DOMDocument to parse your img tag
$dom = new DOMDocument();
$dom->loadHTML($img);
$img_url = base64_encode($dom->getElementsByTagName('img')->item(0)->getAttribute('src')); // Encode the extracted src from your img tag

You can also use regex, I have no idea about performances comparison beetween a regex and DOMDocument.