-
Also, @Alexander , thank you for your time. It is very appreciated. Sometimes a little guidance will send me on the path I need to find my solution.
For now, I'm taking the tmp file and pushing it through ffmpeg as a copy and then reading duration from copy. Unlinking the copy.
This works. Since copy function of ffmpeg has little overhead, I doubt this will be an issue under heavy load.