Opened 6 weeks ago

#6525 new enhancement

Still image file format codecs are tricky to filter out of -codecs output

Reported by: tangent Owned by:
Priority: normal Component: ffmpeg
Version: 3.2.4 Keywords: codecs, help, output
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I am interested in constructing a short command that reliably filters ffmpeg -codecs output to show only the list of lossless video encoders. So far, I have come up with this:

$ ffmpeg -codecs 2> /dev/null | grep '^..EV..S ' | grep -Ev 'image|bitmap'

The second grep command filters out a bunch of codecs I'm not interested in like bmp and pcx because they are not "video" codecs in the way I understand the term.

There is something of a gray area here, which I will deal with below.

I propose that these encoders have their V tag in the DEVILS scheme replaced by either I or M:

  • I means an "image" codec, and implies that you can only encode one frame at a time with this codec, and that each frame will have a separate image header. I believe bmp is in this class, for example. To make a single-file movie with this encoder, you must put it into a container like AVI, MKV, or MPEG-TS.

I propose that a still image file format like jpeg-ls keeps its V tag because it is often used within an A/V container format: avi + jpeg-ls = Lossless MJPEG, so jpeg-ls is a "video" codec to me. I'm not aware of anyone using avi + bmp, by contrast.

A thought experiment you can use to decide this issue is to ask whether you are likely to find this encoder used as the argument to an -f flag or a -c:v flag. We expect bmp to be used with -f for a "pile of frames" output, but jpeg-ls to be used with -c:v and some container format with -f to produce a single-file movie.

  • M means a format like gif or apng that allows multiple frames with timing information per file, so that you don't need the container if you don't need associated audio or other streams.

If that idea is rejected, at least give some other way to reliably filter these codecs out of the ffmpeg -codecs output. I'd like to see you settle on either bitmap or image and apply that term uniformly to all of the still image file formats I'm talking about here.

Change History (0)

Note: See TracTickets for help on using tickets.