Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#10737 closed enhancement (wontfix)

Include ffprobe functionality in ffmpeg command-line program

Reported by: bubbleguuum Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by bubbleguuum)

It would be nice if the ffmpeg command-line program included ffprobe functionality (enabled optionally with configure).

Let me explain.

If for some reason you are using statically linked ffmpeg and ffprobe binaries, you end up with 2 large binaries that are almost identical.

If you use these in a docker image, it increases the image size.
On Android, it is also interesting to reduce size as much as possible when using custom statically linked ffmpeg binaries.

Ideally, a single ffmpeg binary that can also do ffprobe is a nice solution.

As a proof of concept, I have attached a patch to the FFmpeg v6.1 source that do this:

  • if ffmpeg is invoked with --ffprobe as first argument, it behaves as ffprobe
  • Unix only: if ffprobe is a symbolic link pointing to ffmpeg, ffmpeg behaves as ffprobe

Attachments (1)

ffprobe_in_ffmpeg_6.1.patch (168.6 KB ) - added by bubbleguuum 12 months ago.

Download all attachments as: .zip

Change History (8)

by bubbleguuum, 12 months ago

Attachment: ffprobe_in_ffmpeg_6.1.patch added

comment:1 by bubbleguuum, 12 months ago

Description: modified (diff)

comment:2 by bubbleguuum, 12 months ago

Summary: Include ffprobe functionality in ffprobe command-line programInclude ffprobe functionality in ffmpeg command-line program

comment:3 by quinkblack, 12 months ago

I know it's doable, but why use static link at the first place?
It's like a hack for unknown purpose. Shared library is for share as the name suggests.

comment:4 by bubbleguuum, 12 months ago

It's true that static builds are rather niche but they can have their use.
It is especially practical on Android to bundle a FFmpeg static binary with an app (usually custom, for smaller size).
And on Android you want to limit the APK size, thus integrating ffprobe and ffmpeg functionality in a single binary makes sense.
A single static binary can also be useful in Docker images (easier to add to the image, especially if custom built).
It's also practical for Windows programs bundling FFmpeg (needing ffmpeg + ffprobe).

Though I understand why you'd want to not add this functionality in the main source, and as shown by the patch I attached, it is trivial to do for users that need it.

comment:5 by bubbleguuum, 12 months ago

Other arguments in favor of static builds:

  • on Android, you do not have to deal with possible problems of dynamic loading of .so across varied Android versions
  • on Windows and macOS, FFmpeg is often made available as static binaries. When ffprobe is included you get a large binary that is almost identical to ffmpeg.
  • even on Linux they can have their use if you want a portable FFmpeg that works across distros
Last edited 12 months ago by bubbleguuum (previous) (diff)

comment:6 by Marton Balint, 12 months ago

Resolution: wontfix
Status: newclosed

I don't think this is going to happen in the official repository, ffmpeg and ffprobe (and ffplay) have clearly different purposes. So your patch is one of those cases when you will have to maintain it on your own, out of the official tree.

comment:7 by bubbleguuum, 12 months ago

Understood, thank you for the reply.

Note: See TracTickets for help on using tickets.