[FFmpeg-devel] [PATCH] mov.c log qt ref extenal essence metadata

emcodem emcodem at ffastrans.com
Sat Mar 6 10:29:42 EET 2021


---
 libavformat/mov.c | 8 ++++++++
 1 file changed, 8 insertions(+)

In quicktime reference files, exposing the parsed info for external essences location can be very handy for users

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1c07cff6b5..e9625c0cf9 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4275,6 +4275,14 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) {
         MOVDref *dref = &sc->drefs[sc->dref_id - 1];
+        
+        av_dict_set(&st->metadata, "dref_path", dref->path, 0);
+        av_dict_set(&st->metadata, "dref_dir", dref->dir, 0);
+        av_dict_set(&st->metadata, "dref_filename", dref->filename, 0);
+        av_dict_set(&st->metadata, "dref_volume", dref->volume, 0);
+        av_dict_set_int(&st->metadata, "dref_nlvl_from", dref->nlvl_from, 0);
+        av_dict_set_int(&st->metadata, "nlvl_to", dref->nlvl_to, 0);
+        
         if (c->enable_drefs) {
             if (mov_open_dref(c, &sc->pb, c->fc->url, dref) < 0)
                 av_log(c->fc, AV_LOG_ERROR,
-- 
2.25.1



More information about the ffmpeg-devel mailing list