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 " without specifying an output file, then parse stderr:
$ ffmpeg -i https://download.dolby.com/us/en/test-tones/dolby-atmos-trailer_amaze_1080.mp4 >/dev/null
ffmpeg version 4.4.2 Copyright (c) 2000-2021 the FFmpeg developers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://download.dolby.com/us/en/test-tones/dolby-atmos-trailer_amaze_1080.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.76.100
Duration: 00:01:03.55, start: 0.000000, bitrate: 4537 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 128 kb/s (default)
Metadata:
handler_name : sound handler
vendor_id : [0][0][0][0]
Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 4404 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
Metadata:
handler_name : video handler
vendor_id : [0][0][0][0]
At least one output file must be specified
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 /opt/local/bin/ffprobe:
72d71
ffmpeg 5.1.2 installed from RPM Fusion on Fedora 37 (x86_64):
$ du -h /usr/bin/ff{mpeg,probe}
284K /usr/bin/ffmpeg
176K /usr/bin/ffprobe
$ diff -s
ffmpeg 4.3.5 installed from raspberrypi.org on Debian 11.6 (aarch64):
$ du -h /usr/bin/ff{mpeg,probe}
276K /usr/bin/ffmpeg
176K /usr/bin/ffprobe
$ diff -s
MinGW-w64 ffmpeg 4.4.3 installed by MSYS2 on Windows 10 (x86_64):
$ du -h /mingw64/bin/ff{mpeg,probe}.exe
320K /mingw64/bin/ffmpeg.exe
184K /mingw64/bin/ffprobe.exe
$ diff -s
("Dependencies" is Dependencies.exe from
https://github.com/lucasg/Dependencies)