3

I'm running avprobe to get stream infomation about a video in JSON ...

avprobe -loglevel quiet -show_format -show_streams file.m4v -of json

This is basically the exact same thing as ffprobe or ffmpeg -i (and I get the same error.)

ffprobe -loglevel quiet -show_format -show_streams file.m4v -print_format json

The command works most of the time ... however, on occation I'll have a video that has an odd stream in it that is "unsupported" and I'll get back something like this (abbreviated.)

Unsupported codec with id 94213 for input stream 2
{  "format" : {
    "filename" : "file.m4v",
    "nb_streams" : 3,
    "format_name" : "mov,mp4,m4a,3gp,3g2,mj2" ...

When I run the command I get back JSON + an error in plain text, which makes the result invalid JSON and I have to "clean it up" later.

I'm suppressing errors from the output -loglevel quiet but the error still show up.

How can I tell avprobe/ffprobe to not show this error and hence get back a proper JSON object?


Longer Output Examples

ffprobe, from source, MacOS

ffprobe version 0.9.1-subsplash, Copyright (c) 2007-2012 the FFmpeg developers
  built on Feb  5 2012 01:35:36 with gcc 4.2.1 (Apple Inc. build 5664)
  configuration: --prefix=/Volumes/Ramdisk/sw --as=yasm --extra-version=subsplash --disable-shared --enable-static --disable-ffplay --disable-ffserver --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libfaac --enable-libvorbis --enable-libtheora --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --arch=x86_64 --enable-runtime-cpudetect --enable-nonfree
  libavutil    51. 32. 0 / 51. 32. 0
  libavcodec   53. 42. 4 / 53. 42. 4
  libavformat  53. 24. 2 / 53. 24. 2
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 53. 0 /  2. 53. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file.m4v':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2012-01-01 06:38:43
    encoder         : HandBrake 0.9.5 2011010300
  Duration: 00:30:47.53, start: 0.000000, bitrate: 1558 kb/s
    Chapter #0.0: start -0.066733, end 17.784433
    Metadata:
      title           : Chapter  1

...

    Stream #0:2(und): Subtitle: mov_text (text / 0x74786574)
    Metadata:
      creation_time   : 2012-01-01 06:38:43
      handler_name    : 
Unsupported codec with id 94213 for input stream 2
{

...

avprobe, from source, Ubuntu Linux

avprobe version 10_alpha1-6:10~~git20130307.4be368b-1~quantal1, Copyright (c) 2007-2013 the Libav developers
  built on Mar  7 2013 22:12:44 with gcc 4.7 (Ubuntu/Linaro 4.7.2-2ubuntu1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file.m4v':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2012-01-01 06:38:43
    encoder         : HandBrake 0.9.5 2011010300
  Duration: 00:30:47.53, start: 0.000000, bitrate: 1558 kb/s
    Chapter #0.0: start -0.066733, end 17.784433
    Metadata:
      title           : Chapter  1

...

    Stream #0.2(und): Subtitle: text / 0x74786574
    Metadata:
      creation_time   : 2012-01-01 06:38:43
Unsupported codec with id 94213 for input stream 2
{

...
qubodup
  • 8,687
  • 5
  • 37
  • 45
Justin Jenkins
  • 26,590
  • 6
  • 68
  • 1,285
  • Options go before the input file although it will not make a difference in your case. Please show the complete `ffprobe` console output without `-loglevel quiet` of a file that gives the `Unsupported codec` message. – llogan Apr 10 '13 at 01:12
  • The "full" output is *exactly* the same as a file not having this "problem" ... the only difference is that between the `Metadata:` section and the `JSON` (shown in the post) the error `Unsupported codec with id 94213 for input stream 2` is thrown even though I suppressed errors. – Justin Jenkins Apr 10 '13 at 01:19
  • I'm more interested in the version information which should be present in the full output. – llogan Apr 10 '13 at 01:22
  • Please confirm that using a recent build works as expected. Static builds for Linux, OS X, and Windows are available via links on the [FFmpeg download](http://ffmpeg.org/download.html) page. Use the most recent build available. Or compile from Git head if you prefer [[Ubuntu compile guide](https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide)]. – llogan Apr 10 '13 at 01:38
  • I encountered the same issue with binaries built from the `git` source ... – Justin Jenkins Apr 11 '13 at 04:50
  • I can't duplicate the issue, even with a sample that would usually give such a message in `ffmpeg`. Perhaps you can provide one. – llogan Apr 11 '13 at 07:47
  • The title has a typo: command should be "avprobe" NOT "avprove". Fix that you may expose your question to more people to answer it :) – Devy Aug 08 '13 at 14:01
  • 2
    So @JustinJenkins did you find the solution? Apparently 2 years later I am having same problem http://stackoverflow.com/questions/30590234/ffmpeg-pushed-rtmp-stream-not-working-on-android-iphone – DivinesLight Jun 04 '15 at 10:35

1 Answers1

0

What you are seeing is both the output of STDOUT and STDERR. If you want to filter out the Unsupported codec with id 94213 for input stream 2, you could for example filter out the STDERR output by redirecting it to /dev/null like this in bash:

avprobe -loglevel quiet -show_format -show_streams file.m4v -of json 2>/dev/null

Don Nguyen
  • 176
  • 2
  • 5