#1026164 ffprobe: "-of json" doesn't report anything

Package:
ffmpeg
Source:
ffmpeg
Description:
Tools for transcoding, streaming and playing of multimedia files
Submitter:
Matthias Urlichs
Date:
2023-11-14 17:09:03 UTC
Severity:
normal
#1026164#5
Date:
2022-12-15 15:05:03 UTC
From:
To:
$ ffprobe -of json ./01.ogg >/tmp/ff.stdout 2>/tmp/ff.stderr
$ cat /tmp/ff.stderr
ffprobe version 5.1.2-1 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-3)
  configuration: --prefix=/usr --extra-version=1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, ogg, from './01.ogg':
  Duration: 00:02:36.45, start: 0.000000, bitrate: 141 kb/s
  Stream #0:0: Audio: vorbis, 44100 Hz, stereo, fltp, 160 kb/s
$ cat /tmp/ff.stdout
{

}

I'm fairly sure that this is not the intended behavior.

Upstream says that this works for them.
https://trac.ffmpeg.org/ticket/10104

#1026164#10
Date:
2023-11-12 19:17:03 UTC
From:
To:
$ ffprobe -hide_banner -of json Critical.ogg
{
Input #0, ogg, from 'Critical.ogg':
  Duration: 00:00:00.63, start: 0.000000, bitrate: 129 kb/s
  Stream #0:0: Audio: vorbis, 48000 Hz, mono, fltp, 86 kb/s

}
$ ffprobe -hide_banner -of json Critical.ogg 2>/dev/null
{

}

So it looks like `2>/dev/null` 'hides' the output.
I don't know if without it, is valid json though.
Using 'xml' as output_format gives an interesting result ...

#1026164#15
Date:
2023-11-12 19:56:22 UTC
From:
To:
Hi,

Looking at the docs, you can use -of or -print_format like follows for a nice json file.

ffprobe -v quiet -of json -show_format -show_streams "Critical.ogg" > "Critical.ogg.json"

Your needs may require some changes.

Regards

Phil

#1026164#20
Date:
2023-11-14 17:01:52 UTC
From:
To:
That gives a much nicer/better and much more valid result. Thanks!