by duskwuff · 3y ago · 0 comments
If you're trying to parse metadata, ffprobe has a set of options for structured output to stdout. Parsing this will be dramatically easier than whatever you're doing.
ffprobe -print_format json -show_format -show_streams example.mp4
(There's more -show_stuff options, but they're probably more detailed than you want. Run ffprobe --help for details.)But we all wanted to know, does it stdout or stderr? :-D
(It prints help to stdout, and a bunch of junk to stderr)
$ ffprobe --help 2>/dev/null
Simple multimedia streams analyzer
usage: ffprobe [OPTIONS] INPUT_FILE
$ ffprobe --help >/dev/null
ffprobe version 6.0 Copyright (c) 2007-2023 the FFmpeg developers
built with Apple clang version 14.0.0 (clang-1400.0.29.202)but no, you have to mess with stderr because the programs natural output without using the flags is an error apparently.