4 ms·
This feels like an easy one. Not quite the same, but I really dislike programs which log status updates and more fundamental output to the same place. IIRC, f
by oasisbob 3y ago
This feels like an easy one.
Not quite the same, but I really dislike programs which log status updates and more fundamental output to the same place.
IIRC, ffmpeg is like this with everything going to stderr, making metadata parsing more difficult than it needs to be.
- duskwuff 3y ago> IIRC, ffmpeg is like this with everything going to stderr, making metadata parsing more difficult than it needs to be. 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.)
- mdaniel 3y ago> 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)
- werid 3y agosometimes you just want to quickly look at ffprobe's natural output but the file have a lot of metadata or subtitles or whatever, and the stuff you want to look at is printed up on top, so the natural way is to pipe it to less or a file. but no, you have to mess with stderr because the programs natural output without using the flags is an error apparently.
- somat 3y agoIn ffmpegs defense it is designed that the video stream can go on stdout. I guess it could log to stdout if you specify an explicit file and stderr when you want the video on stdout. But sometimes being consistent is better than being convenient.