Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.)


> 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)


sometimes 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: