* [FFmpeg-devel] [PR] fftools/ffprobe: add codec_attr for streams (PR #21412)
@ 2026-01-08 14:23 VannHarl via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: VannHarl via ffmpeg-devel @ 2026-01-08 14:23 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: VannHarl
PR #21412 opened by VannHarl
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21412
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21412.patch
Adds the "codec attribute" string to output for stremas.
It is the same codec attributes written into HLS/DASH manifests.
Use: ffprobe -show_streams <input>
or: ffprobe -show_entries stream=codec_attr <input>
>From 7646ea94e76973cd9244418dbf18adf652425d89 Mon Sep 17 00:00:00 2001
From: Vann Harl <vannharl@arcor.de>
Date: Thu, 8 Jan 2026 15:22:10 +0100
Subject: [PATCH] fftools/ffprobe: add codec_attr for streams
Adds the "codec attribute" string to output for stremas.
It is the same codec attributes written into HLS/DASH manifests.
Use: ffprobe -show_streams <input>
or: ffprobe -show_entries stream=codec_attr <input>
---
fftools/Makefile | 2 ++
fftools/ffprobe.c | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/fftools/Makefile b/fftools/Makefile
index 01b16fa8f4..b20a586e2c 100644
--- a/fftools/Makefile
+++ b/fftools/Makefile
@@ -50,6 +50,8 @@ OBJS-ffprobe += \
fftools/textformat/tw_avio.o \
fftools/textformat/tw_buffer.o \
fftools/textformat/tw_stdout.o \
+ libavformat/codecstring.o \
+ libavformat/nal.o \
OBJS-ffmpeg += $(COMPAT_OBJS:%=compat/%)
OBJS-ffplay += fftools/ffplay_renderer.o
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 67111bc31f..f3439ad69c 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -31,6 +31,7 @@
#include "libavformat/avformat.h"
#include "libavformat/version.h"
+#include "libavformat/internal.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/version.h"
#include "libavutil/ambient_viewing_environment.h"
@@ -1796,6 +1797,13 @@ static int show_stream(AVTextFormatContext *tfc, AVFormatContext *fmt_ctx, int s
}
}
+ av_bprint_clear(&pbuf);
+ if (ff_make_codec_str(fmt_ctx, stream->codecpar, &stream->avg_frame_rate, &pbuf) == 0) {
+ print_str("codec_attr", pbuf.str);
+ } else {
+ print_str_opt("codec_attr", "unknown");
+ }
+
if (!do_bitexact && (profile = avcodec_profile_name(par->codec_id, par->profile)))
print_str("profile", profile);
else {
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-08 14:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-08 14:23 [FFmpeg-devel] [PR] fftools/ffprobe: add codec_attr for streams (PR #21412) VannHarl via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git