Using awk
mediainfo file.flv | awk '/Duration/ {print $3*60+$4}'
2383
ffmpeg -i file.flv 2>&1 | awk '/Duration/ {split($2,a,":");print a[1]*3600+a[2]*60+a[3]}'
2383.08
To handle different formats, use this:
cat file
Duration : 39mn 43s
Duration : 39s 43ms
awk '/Duration/ {for (i=3;i<=NF;i++) if ($i~/[0-9]+mn$/) s+=$i*60; else if ($i~/[0-9]+s$/) s+=$i; else if ($i~/[0-9]+ms$/) s+=$i/10; print s;s=0}' file
2383
43.3