I've been so frustrated that FFprobe functionality is not part of FFmpeg.
My app extracts screenshots from videos to create a beautiful gallery of videos. But even though I include FFmpeg already, I need a 50mb FFprobe executable to be bundled with my app just so that I can determine the width, height, duration, and fps of a video file!
What is it that FFprobe does that FFmpeg couldn't do with a few extra pieces of exposed API?
ffmpeg and ffprobe are built against the exact same set of libraries, so they could certainly be combined into a single program if the ffmpeg maintainers chose to do so.
Two possible options to reduce the size of your application:
(1) Instead of using ffprobe, just call "ffmpeg -i <filename>" without specifying an output file, then parse stderr:
This is admittedly messy compared to parsing structured ffprobe output, but it does contain all the information you mentioned (assuming duration in centiseconds is sufficiently precise for your application).
(2) Link both ffmpeg and ffprobe dynamically, in which case they'll share all but a few hundred kilobytes of on-disk code.
For example, consider ffmpeg and ffprobe as installed from package repositories on a variety of systems:
ffmpeg 4.4.2 installed by MacPorts on macOS Monterey (x86_64):
$ du -hA /opt/local/bin/ff{mpeg,probe}
339K /opt/local/bin/ffmpeg
260K /opt/local/bin/ffprobe
$ diff -s <(otool -L /opt/local/bin/ffmpeg) <(otool -L /opt/local/bin/ffprobe)
1c1
< /opt/local/bin/ffmpeg:
---
> /opt/local/bin/ffprobe:
72d71
< /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
ffmpeg 5.1.2 installed from RPM Fusion on Fedora 37 (x86_64):
My app extracts screenshots from videos to create a beautiful gallery of videos. But even though I include FFmpeg already, I need a 50mb FFprobe executable to be bundled with my app just so that I can determine the width, height, duration, and fps of a video file!
What is it that FFprobe does that FFmpeg couldn't do with a few extra pieces of exposed API?
https://videohubapp.com/ - https://github.com/whyboris/Video-Hub-App
https://github.com/whyboris/Video-Hub-App/blob/772b25bbd4b41...