Opened 7 years ago

Closed 7 years ago

#6525 closed enhancement (invalid)

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

Reported by: Warren Young Owned by:
Priority: wish Component: avcodec
Version: unspecified Keywords:
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 (1)

in reply to:  description comment:1 by Carl Eugen Hoyos, 7 years ago

Component: ffmpegavcodec
Keywords: codecs help output removed
Priority: normalwish
Resolution: invalid
Status: newclosed
Version: 3.2.4unspecified

Replying to tangent:

  • 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 don't think this makes sense ...

I believe bmp is in this class, for example.

... especially since FFmpeg is supposed to work fine for piped bmp streams.

I don't think this will be implemented (because the distinction you request is impossible) but feel free to send a patch to the development mailing list for discussion.

Note: See TracTickets for help on using tickets.