Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2568 closed defect (invalid)

ffprobe is unreliable when processing random text files

Reported by: ahthovaikied Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: text
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


FFprobe is unreliable when processing small text files that are not media files: it reports random codecs instead of rejecting the files.

For example with a text file containing the lines:

1. Restless
2. Enter
3. Pearls of light
4. Deep Within
5. Gatekeeper
6. Grace
7. Blooded
8. Candles

I get:

$ ./ffprobe -loglevel debug text_file.txt 
ffprobe version N-53047-ge751481 Copyright (c) 2007-2013 the FFmpeg developers
  built on May 14 2013 19:38:50 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-libfaac --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. 31.100 / 52. 31.100
  libavcodec     55.  9.100 / 55.  9.100
  libavformat    55.  7.100 / 55.  7.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 65.100 /  3. 65.100
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[tty @ 0x28fa260] Format tty probed with size=2048 and score=50
[tty @ 0x28fa260] File position before avformat_find_stream_info() is 0
[tty @ 0x28fa260] File position after avformat_find_stream_info() is 106
Input #0, tty, from 'text_file.txt':
  Duration: 00:00:00.04, bitrate: 21 kb/s
    Stream #0:0, 1, 1/25: Video: ansi, pal8, 640x400, 1/25, 25 fps, 25 tbr, 25 tbn, 25 tbc
[AVIOContext @ 0x2902920] Statistics: 106 bytes read, 0 seeks

I tried with ffmpeg:

  • 1.2.1
  • from git today ( outputs N-53047-ge751481).

I'm on Ubuntu 12.04 64bits, the configure options I use for the custom build can be found above.

Change History (6)

comment:1 by ahthovaikied, 11 years ago

Version: unspecifiedgit-master

comment:2 by Elon Musk, 11 years ago

Resolution: invalid
Status: newclosed

That is normal file, and ffmpeg will create watchable video for such files.

comment:3 by Carl Eugen Hoyos, 11 years ago

Component: FFprobeavformat
Keywords: ffprobe removed

comment:4 by ahthovaikied, 11 years ago

Wow, I didn't know that ffmpeg could "play" text files.

A few questions though:

  • why are some text files rejected (as expected), and some others identified as video files (very counter intuitively)?
  • ffprobe is described as "media prober", so what does the fact that ffmpeg can play a text file has anything to do with the nature of this file which is certainly not a video with a 640x400 resolution?


comment:5 by Elon Musk, 11 years ago

Yes, its also a typewriter. You can freely ignore files that are probed as tty files and have codec set to ansi.

comment:6 by ahthovaikied, 11 years ago

Thanks for the tip, I'm using ffprobe to probe thousands of files from Python scripts so that info is definitely useful.

Thanks again and have a nice day :)

Note: See TracTickets for help on using tickets.