From: Romain Beauxis <romain.beauxis@gmail.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH v10 2/8] tests: Add stream dump test API util. Date: Fri, 4 Apr 2025 15:55:28 -0500 Message-ID: <CABWZ6OTSyWjDEvpt1mY8hAGvu1zhKnp5SXv6WG-QbvXhFe9Efw@mail.gmail.com> (raw) In-Reply-To: <20250404204057.GV4991@pb2> Le ven. 4 avr. 2025 à 15:41, Michael Niedermayer <michael@niedermayer.cc> a écrit : > > On Wed, Apr 02, 2025 at 01:29:34PM -0500, Romain Beauxis wrote: > > --- > > tests/Makefile | 1 + > > tests/api/Makefile | 2 +- > > tests/api/api-dump-stream-meta-test.c | 175 ++++++++++++++++++++++++++ > > 3 files changed, 177 insertions(+), 1 deletion(-) > > create mode 100644 tests/api/api-dump-stream-meta-test.c > > > > diff --git a/tests/Makefile b/tests/Makefile > > index f9f5fc07f3..1f7e5003c2 100644 > > --- a/tests/Makefile > > +++ b/tests/Makefile > > @@ -277,6 +277,7 @@ $(FATE_FFPROBE) $(FATE_FFMPEG_FFPROBE) $(FATE_SAMPLES_FFPROBE) $(FATE_SAMPLES_FF > > $(FATE_SAMPLES_FASTSTART): tools/qt-faststart$(EXESUF) > > $(FATE_SAMPLES_DUMP_DATA) $(FATE_SAMPLES_DUMP_DATA-yes): tools/venc_data_dump$(EXESUF) > > $(FATE_SAMPLES_SCALE_SLICE): tools/scale_slice_test$(EXESUF) > > +$(FATE_SAMPLES_DUMP_STREAM_META): tests/api/api-dump-stream-meta-test$(EXESUF) > > > > ifdef SAMPLES > > FATE += $(FATE_EXTERN) > > diff --git a/tests/api/Makefile b/tests/api/Makefile > > index c96e636756..a2cb06a729 100644 > > --- a/tests/api/Makefile > > +++ b/tests/api/Makefile > > @@ -1,7 +1,7 @@ > > APITESTPROGS-$(call ENCDEC, FLAC, FLAC) += api-flac > > APITESTPROGS-$(call DEMDEC, H264, H264) += api-h264 > > APITESTPROGS-$(call DEMDEC, H264, H264) += api-h264-slice > > -APITESTPROGS-yes += api-seek > > +APITESTPROGS-yes += api-seek api-dump-stream-meta > > APITESTPROGS-$(call DEMDEC, H263, H263) += api-band > > APITESTPROGS-$(HAVE_THREADS) += api-threadmessage > > APITESTPROGS += $(APITESTPROGS-yes) > > diff --git a/tests/api/api-dump-stream-meta-test.c b/tests/api/api-dump-stream-meta-test.c > > new file mode 100644 > > index 0000000000..906d355fe3 > > --- /dev/null > > +++ b/tests/api/api-dump-stream-meta-test.c > > @@ -0,0 +1,175 @@ > > +/* > > + * Copyright (c) 2025 Romain Beauxis > > + * > > + * Permission is hereby granted, free of charge, to any person obtaining a copy > > + * of this software and associated documentation files (the "Software"), to deal > > + * in the Software without restriction, including without limitation the rights > > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > > + * copies of the Software, and to permit persons to whom the Software is > > + * furnished to do so, subject to the following conditions: > > + * > > + * The above copyright notice and this permission notice shall be included in > > + * all copies or substantial portions of the Software. > > + * > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > > + * THE SOFTWARE. > > + */ > > + > > +/** > > + * Dump stream metadata > > + */ > > + > > +#include "libavcodec/avcodec.h" > > +#include "libavformat/avformat.h" > > +#include "libavutil/timestamp.h" > > + > > +static int dump_stream_meta(const char *input_filename) { > > + const AVCodec *codec = NULL; > > + AVPacket *pkt = NULL; > > + AVFrame *fr = NULL; > > + AVFormatContext *fmt_ctx = NULL; > > + AVCodecContext *ctx = NULL; > > + AVCodecParameters *origin_par = NULL; > > + AVStream *st; > > + int stream_idx = 0; > > + int result; > > + char *metadata; > > + > > + result = avformat_open_input(&fmt_ctx, input_filename, NULL, NULL); > > + if (result < 0) { > > + av_log(NULL, AV_LOG_ERROR, "Can't open file\n"); > > + return result; > > + } > > + > > + result = avformat_find_stream_info(fmt_ctx, NULL); > > + if (result < 0) { > > + av_log(NULL, AV_LOG_ERROR, "Can't get stream info\n"); > > + goto end; > > + } > > + > > > + if (fmt_ctx->nb_streams > 1) { > > + av_log(NULL, AV_LOG_ERROR, "More than one stream found in input!\n"); > > + goto end; > > + } > > 2 stray tab in indent This is fixed in the updated patchset here: https://github.com/toots/FFmpeg/pull/2/commits/e2324bb56c147cba2dc2d8aad19cb64afb6ea08b > [...] > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > The real ebay dictionary, page 2 > "100% positive feedback" - "All either got their money back or didnt complain" > "Best seller ever, very honest" - "Seller refunded buyer after failed scam" > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2025-04-04 20:55 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-04-02 18:29 [FFmpeg-devel] [PATCH v10 0/8] Properly decode ogg metadata in ogg/{vorbis, flac, opus} chained bitstreams Romain Beauxis 2025-04-02 18:29 ` [FFmpeg-devel] [PATCH v10 1/8] libavcodec/decode.c: intercept `AV_PKT_DATA_METADATA_UPDATE` packet extra data, attach them to the next decoded frame with the same PTS Romain Beauxis 2025-04-04 20:39 ` Michael Niedermayer 2025-04-04 20:56 ` Romain Beauxis 2025-04-04 21:24 ` Michael Niedermayer 2025-04-02 18:29 ` [FFmpeg-devel] [PATCH v10 2/8] tests: Add stream dump test API util Romain Beauxis 2025-04-04 20:40 ` Michael Niedermayer 2025-04-04 20:55 ` Romain Beauxis [this message] 2025-04-02 18:29 ` [FFmpeg-devel] [PATCH v10 3/8] tests: Add chained ogg/vorbis stream dump test Romain Beauxis 2025-04-04 20:44 ` Michael Niedermayer 2025-04-04 20:53 ` Romain Beauxis 2025-04-04 21:00 ` Michael Niedermayer 2025-04-04 21:01 ` Romain Beauxis 2025-04-02 18:29 ` [FFmpeg-devel] [PATCH v10 4/8] libavformat/oggdec.h, libavformat/oggparsevorbis.c: Factor out vorbis metadata update mechanism Romain Beauxis 2025-04-02 18:29 ` [FFmpeg-devel] [PATCH v10 5/8] libavformat/oggparseflac.c: Parse ogg/flac comments in new ogg packets, add them to ogg stream new_metadata Romain Beauxis 2025-04-02 18:29 ` [FFmpeg-devel] [PATCH v10 6/8] tests: Add chained ogg/flac stream dump test Romain Beauxis 2025-04-04 20:45 ` Michael Niedermayer 2025-04-04 20:52 ` Romain Beauxis 2025-04-02 18:29 ` [FFmpeg-devel] [PATCH v10 7/8] libavformat/oggparseopus.c: Parse comments from secondary chained streams header packet Romain Beauxis 2025-04-02 18:29 ` [FFmpeg-devel] [PATCH v10 8/8] tests: Add chained ogg/opus stream dump test Romain Beauxis 2025-04-04 20:47 ` Michael Niedermayer 2025-04-04 20:53 ` Romain Beauxis
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=CABWZ6OTSyWjDEvpt1mY8hAGvu1zhKnp5SXv6WG-QbvXhFe9Efw@mail.gmail.com \ --to=romain.beauxis@gmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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