Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2621 closed enhancement (fixed)

ffprobe should output formatted information about detection reliability

Reported by: ahthovaikied Owned by:
Priority: wish Component: ffprobe
Version: git-master Keywords: ffprobe format probe score
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

Sometimes ffprobe misdetects text files as mp3, but it outputs a log message about a possible misdetection:

$ ffprobe text_file.log 
ffprobe version N-53746-gec34963 Copyright (c) 2007-2013 the FFmpeg developers
  built on Jun  1 2013 22:57:16 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-x11grab --disable-encoder=vorbis --disable-encoder=aac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfdk-aac --enable-librtmp --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopus --disable-runtime-cpudetect --disable-ffserver --disable-debug --cpu=corei7
  libavutil      52. 34.100 / 52. 34.100
  libavcodec     55. 13.100 / 55. 13.100
  libavformat    55.  8.102 / 55.  8.102
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 74.101 /  3. 74.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[mp3 @ 0x19df260] Format mp3 detected only with low score of 1, misdetection possible!
[mp3 @ 0x19df260] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'text_file.log':
  Duration: 00:00:00.29, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Audio: mp1, 48000 Hz, stereo, s16p, 128 kb/s

However when making ffprobe output formatted data (ie. JSON), the information about the low detection reliability is not present:

$ ffprobe -loglevel quiet -print_format json -show_format text_file.log 
{
    "format": {
        "filename": "text_file.log",
        "nb_streams": 1,
        "format_name": "mp3",
        "format_long_name": "MP2/3 (MPEG audio layer 2/3)",
        "start_time": "0.000000",
        "duration": "0.293375",
        "size": "4694",
        "bit_rate": "128000"
    }
}

The addition of a field in the formatted output with a value about the detection reliability would be great and solve that problem.
It would be especially useful for scripts and programs that rely on ffprobe to analyze files, and therefore do not read or parse the ffprobe logging output.

Change History (3)

comment:1 by Carl Eugen Hoyos, 11 years ago

Priority: normalwish

comment:2 by Stefano Sabatini, 11 years ago

Analyzed by developer: set
Keywords: format probe score added
Reproduced by developer: set
Resolution: fixed
Status: newclosed

Fixed in:

commit 291ad12ea2d1f9297d4ed22d54f4f8fa232e43dc
Author: Stefano Sabatini <stefasab@gmail.com>
Date:   Thu Aug 29 00:28:26 2013 +0200

    ffprobe: show probe_score in the format section
    
    Should address trac ticket #2621.

comment:3 by ahthovaikied, 11 years ago

Thank you

Note: See TracTickets for help on using tickets.