Accessing vmeta_frame data arriving in ffmpeg

Hi. We have an existing app that relies upon FFMPEG for video stream demuxing and decoding. It sees the parrot: Duration: 00:02:35.39, start: 0.000000, bitrate: 60574 kb/s
Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 59997 kb/s, 59.95 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)

  • Metadata:*
  •  creation_time   : 2020-10-02T17:14:45.000000Z*
    
  •  handler_name    : DefaultVideo*
    
  • Stream #0:1(eng): Data: none (mett / 0x7474656D), 54 kb/s (default)*
  • Metadata:*
  •  creation_time   : 2020-10-02T17:14:45.000000Z*
    
  •  handler_name    : ParrotVideoMetadata*
    
  • Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 384 kb/s (default)*
  • Metadata:*
  •  creation_time   : 2020-10-02T17:14:45.000000Z*
    
  •  handler_name    : DefaultAudio*
    
  • Stream #0:3: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 320x180 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc*

My question is What is the most efficient way for me to access the vmeta_frame structure, so I can operate on it with libvideo-metadata to get out the metadata of interest?

I have used this libvideo-metadata with pdraw_be - and it works perfectly - but it seems to me that since I already see the metadata frames, I should be able to access the vmeta_frames directly.

Thank you in advance for your help.

Mike Abernathy

   while (av_read_frame (afc, p) >= 0)
   {

      if (p->stream_index == metadatastream)
      {
			printf("metadata packet of size %d\n", p->size);

			struct vmeta_buffer buf;
			
			vmeta_buffer_set_cdata(&buf, p->data, p->size,0);

			struct vmeta_frame meta;
			vmeta_frame_read(&buf, &meta, NULL);
			
			struct vmeta_location loc;
			vmeta_frame_get_location(&meta, &loc);
			
			printf("location latitude %f longitude %f altitude %f\n", loc.latitude, loc.longitude, loc.altitude);

That is exactly what I needed.

Thank you very, very much!

Mike Abernathy


This is our LandForm Studio app running on a Mac. It is an Augmented Reality display that overlays street lines, street names and place marks on the drone video in real-time. Thank you again for your help.

3 Likes

This appears to work just fine for MP4 files with Parrot metadata in the data stream as above. But, for an RTSP connection (which FFMPEG supports), I believe we are just getting video packets, and the metadata is instead stuffed into some RTP header extensions. How do we access them in FFMPEG after the “av_read_frame” ?