Does ffmpeg supported KLV metadata?

I'm unsure if UAV metadata 601.5 is the same as KLV, but FFmpeg can demux KLV metadata since commit 69a042e from 28 Oct 2013:

  • mpegts: demux synchronous SMPTE 336M Key-Length-Value (KLV) metadata

This fixes ticket #2579: Data stream from UAV video reported as "Unknown" type and without codec_id set, so you may find other relevant information there too.


FFMPEG does not natively support MISB KLV metadata or have demuxers or decoders for KLV metadata of these types at this time.

However, FFMPEG can be used to extract data elementary streams from containers like MPEG Transport Stream (TS) per ISO 13818-1. Such capability works for UDP streams and local MPEG TS Files. See the examples at end of response. The examples simply extract the data from the stream, they do not parse them. Parsing could easily be accomplished in real time by piping the output or post processing using many languages including C and Python.

It would be helpful to know specifically which containers you are trying to extract data from. In lieu of such information I have assumed MPEG TS in my response and examples. I would like to also point out that the current standard for "UAS Local Dataset" is now ST0601.8 at the time of this response.

I have personally tested the following examples with FFMPEG 2.5.4 on Mac OS X 10.9.5.

The following examples can be modified such that the output is sent to stdout by replacing the <outfile> with '-'.

Extract Data Stream From MPEG-TS File at Line Speed and Save to Binary File:

ffmpeg -i <MPEGTS_infile> -map d -codec copy -f data <binary_outfile>

Extract Data Stream From MPEG-TS File at Frame Rate and Save to Binary File:

ffmpeg -re -i <MPEGTS_infile> -map d -codec copy -f data <binary_outfile>

Extract Data Stream From MPEG-TS UDP Stream at Stream Rate and Save to Binary File:

ffmpeg -i udp://@<address:port> -map d -codec copy -f data <binary_outfile>

Extract Data Stream From MPEG-TS UDP Stream at Stream Rate and Direct to STDOUT:

ffmpeg -i udp://@<address:port> -map d -codec copy -f data -

Stream Video, Audio and Data Streams from MPEG-TS file Over UDP at Frame Rate:

ffmpeg -re -i <MPEGTS_infile> -map 0 -c copy -f mpegts udp://<address:port>