Opened 2 years ago

Closed 23 months ago

#9562 closed defect (fixed)

ffprobe non-option brackets

Reported by: Dan Jacobson Owned by:
Priority: minor Component: documentation
Version: git-master Keywords:
Cc: Dan Jacobson Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

$ ffprobe 
usage: ffprobe [OPTIONS] [INPUT_FILE]

You have to specify one input file.

OK, then the above, and man page, should say

Not: ffprobe [OPTIONS] [INPUT_FILE]
But: ffprobe [OPTIONS] <INPUT_FILE>

Change History (5)

comment:1 by cornholio, 2 years ago

As per https://github.com/FFmpeg/FFmpeg/commit/83e1a1de8833845224948e5d002355c03dd117d5, no idea why this was pushed, an input is not required. You can pipe stdin without specifying anything.

$ cat foo.mp4 | ffprobe

Is completely valid.

comment:2 by Balling, 2 years ago

To comment 1: this is unwise. You must always eliminate the "cat |" BS structure, because it adds a new process.

https://stackoverflow.com/questions/11710552/useless-use-of-cat

There is even a wikipedia article on this wrong way to use stuff: https://en.wikipedia.org/wiki/Cat_(Unix)#Useless_use_of_cat

Besides there is an input, ffmpeg requires -i parameters, but ffplay does not! | is a pipe which is an input. Lets not dicsuss how all this 💩 hets handled in the shell...

Last edited 2 years ago by Balling (previous) (diff)

in reply to:  2 ; comment:3 by cornholio, 2 years ago

Was going to add a disclaimer about useless use of cat but figured no one would notice. pff.

ffprobe doesn't require -i though

in reply to:  3 comment:4 by Stefano Sabatini, 23 months ago

Replying to cornholio:

Was going to add a disclaimer about useless use of cat but figured no one would notice. pff.

ffprobe doesn't require -i though

Double checked the code and I confirm that the -i option is mandatory, although you can use -i - to simulate that behavior:

$ cat test.mpeg | ./ffprobe 
ffprobe version N-106634-gbb6ef6d314 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --enable-openssl
  libavutil      57. 24.101 / 57. 24.101
  libavcodec     59. 26.100 / 59. 26.100
  libavformat    59. 22.100 / 59. 22.100
  libavdevice    59.  6.100 / 59.  6.100
  libavfilter     8. 33.100 /  8. 33.100
  libswscale      6.  6.100 /  6.  6.100
  libswresample   4.  6.100 /  4.  6.100
Simple multimedia streams analyzer
usage: ffprobe [OPTIONS] [INPUT_FILE]

You have to specify one input file.
Use -h to get full help or, even better, run 'man ffprobe'.
$ cat test.mpeg | ./ffprobe -i -
[...]
Input #0, mpeg, from 'pipe:':
  Duration: N/A, start: 0.518189, bitrate: 105017 kb/s
  Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p(tv), 160x120 [SAR 1:1 DAR 4:3], 104857 kb/s, 25 fps, 25 tbr, 90k tbn
  Stream #0:1[0x1c0]: Audio: mp2, 22050 Hz, mono, s16p, 160 kb/s

Also, this was the behavior since the first commit, so I think the committed change is correct.

comment:5 by Stefano Sabatini, 23 months ago

Resolution: fixed
Status: newclosed

Marking this as resolved, thanks for the report.

Note: See TracTickets for help on using tickets.