Can you please try to use the following code and replace the following code with your existing code.
function convert_secs_to_formatedv2 ($atts = [], $content = null, $tag = ''){
$seconds = (int) wpv_do_shortcode($content);
$hours = floor($seconds / 3600);
$seconds -= $hours * 3600;
$minutes = floor($seconds / 60);
$seconds -= $minutes * 60;
$formated = "$hours:$minutes:$seconds"; //24:0:1';
return $formated;
}
add_shortcode('s_f', 'convert_secs_to_formatedv2');
As you can see I've changed the line from:
$seconds = (int)$content;
To:
$seconds = (int) wpv_do_shortcode($content);
Because as you are passing the shortcode to your content, to get the value from shortcode, you need to execute your shortcode and to do that, you need to use wpv_do_shortcode($content);.
If you will pass shortcode as your custom shortcode attribute - the above method will not be applicable.
For that, you need to change the custom shortcode code as given under:
function convert_secs_to_formatedv2 ($atts = [], $content = null, $tag = ''){
$seconds = (int) $atts['seconds'];
$hours = floor($seconds / 3600);
$seconds -= $hours * 3600;
$minutes = floor($seconds / 60);
$seconds -= $minutes * 60;
$formated = "$hours:$minutes:$seconds"; //24:0:1';
return $formated;
}
add_shortcode('s_f', 'convert_secs_to_formatedv2');
and you can call the shortcode as:
[s_f seconds="[types field='video-length'][/types]"]
This way the passed shortcode value will be automatically assigned to the seconds attribute as shown above.
You can go with whatever method that suits you the best as per your requirement.