[FFmpeg-cvslog] ffprobe: expose AVAmbientViewingEnvironment side data in AVFrames

Jan Ekström git at videolan.org
Fri Jan 13 21:36:45 EET 2023


ffmpeg | branch: master | Jan Ekström <jeebjp at gmail.com> | Tue Jan 10 21:42:23 2023 +0200| [be76a9bd327bb49b1c10f44871253eddf6fc5100] | committer: Jan Ekström

ffprobe: expose AVAmbientViewingEnvironment side data in AVFrames

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=be76a9bd327bb49b1c10f44871253eddf6fc5100
---

 fftools/ffprobe.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index c18aee9846..b9310a2d25 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -33,6 +33,7 @@
 #include "libavformat/version.h"
 #include "libavcodec/avcodec.h"
 #include "libavcodec/version.h"
+#include "libavutil/ambient_viewing_environment.h"
 #include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
@@ -2268,6 +2269,17 @@ static void print_dynamic_hdr_vivid(WriterContext *w, const AVDynamicHDRVivid *m
     }
 }
 
+static void print_ambient_viewing_environment(WriterContext *w,
+                                              const AVAmbientViewingEnvironment *env)
+{
+    if (!env)
+        return;
+
+    print_q("ambient_illuminance", env->ambient_illuminance, '/');
+    print_q("ambient_light_x",     env->ambient_light_x,     '/');
+    print_q("ambient_light_y",     env->ambient_light_y,     '/');
+}
+
 static void print_pkt_side_data(WriterContext *w,
                                 AVCodecParameters *par,
                                 const AVPacketSideData *side_data,
@@ -2704,6 +2716,9 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
             } else if (sd->type == AV_FRAME_DATA_DYNAMIC_HDR_VIVID) {
                 AVDynamicHDRVivid *metadata = (AVDynamicHDRVivid *)sd->data;
                 print_dynamic_hdr_vivid(w, metadata);
+            } else if (sd->type == AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT) {
+                print_ambient_viewing_environment(
+                    w, (const AVAmbientViewingEnvironment *)sd->data);
             }
             writer_print_section_footer(w);
         }



More information about the ffmpeg-cvslog mailing list