Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Ramiro Polla <ramiro.polla@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [FEATURE PROPOSAL] Extracting codec-level data to binary files
Date: Thu, 22 May 2025 19:43:19 +0200
Message-ID: <CALweWgBwicEsOuHb6k-H-bktazoDxBCTnOKExFat5YvkWWcKnQ@mail.gmail.com> (raw)
In-Reply-To: <72c56549-68a1-4adc-ad29-80fa2c691dea@mail.infomaniak.com>

On Thu, May 22, 2025 at 7:03 PM Timothée
<timothee.informatique@regaud-chapuy.fr> wrote:
> The 2025-05-22T14:33:22.000+02:00, Ramiro Polla
> <ramiro.polla@gmail.com> wrote :
> > On Thu, May 22, 2025 at 1:59 PM Ronald S. Bultje <rsbultje@gmail.com> wrote:
> >>  On Wed, May 21, 2025 at 9:34 AM Timothée <
> >>  timothee.informatique@regaud-chapuy.fr> wrote:
> >>>   I am interested in expanding ffmpeg's capabilities to extract
> >>>   low-level data from video codecs. Specifically, I'd like to
> >>>   implement functionality that would allow exporting frame data,
> >>>   macroblock information, quantization tables, and similar
> >>>   codec-specific elements to binary files for further analysis.
> >>>   After searching through the documentation and existing features,
> >>>   I haven't found similar functionality, though I may have missed
> >>>   something. Has this been implemented before, or are there
> >>>   related features I should examine?
> >>
> >>   Some older codecs implement minor variants for this, e.g. grep
> >>  for AV_FRAME_DATA_MOTION_VECTORS, which attaches a frame's motion
> >>  vectors to the picture data. I believe there's an example app and
> >>  possibly a filter to overlay MVs on top of the video frame based
> >>  on this concept. You could extend this to cover other (macro)block
> >>  info. There used to be a variant of this for quant-tables also but
> >>  I can't find it, maybe it was removed.
> >
> >  If I recall correctly, we wanted to move away from exporting more
> > of this kind of codec-specific information as picture data.
> > Timothée, this kind of feature depends a lot on the codec that you
> > want to work with. It will also depend on which syntax elements you
> > need from the codec. In FFmpeg, there is the CBS code which
> > describes the bitstream for a few codecs, which might help you. I
> > have a separate project (called FFglitch), which lets you export
> > some elements (such as quantization tables, dct coefficients, and
> > motion vectors) from some codecs (jpeg, mpeg2, mpeg4) to JSON
> > format, and even modify them in the bitstream. In the end, it will
> > depend on what you want to do with the extracted low-level data, and
> > for which codecs. Ramiro
>
> Thank you for your response and for mentioning FFglitch - it looks
> like an excellent project that's very relevant to what I'm trying to
> accomplish.
>
> I have a question about FFglitch's capabilities: is it possible to
> extract quantization parameter (QP) tables using ffedit? I've reviewed
> the documentation but may have missed this functionality if it exists.

You can get the dqt for jpeg and qscale for mpeg-2, but that's about
it for the moment.

> Ideally I would want to extract data for all existing codecs, but I
> know this is impossible. My current focus is on implementing this
> feature for H.264, with plans to extend support to H.265 and AVI
> formats as well. I want to extract this data for scientific use.

I see a few qp fields in libavcodec/cbs_h264.h and
libavcodec/cbs_h265.h. I've never used this functionality before, but
it might help you.

OTOH, if you want to add h264 support to FFglitch I would be very happy :)

Ramiro
_______________________________________________
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".

  reply	other threads:[~2025-05-22 17:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-21 13:34 Timothée
2025-05-22 11:59 ` Ronald S. Bultje
2025-05-22 12:32   ` Ramiro Polla
2025-05-22 17:02     ` Timothée
2025-05-22 17:43       ` Ramiro Polla [this message]
2025-05-22 20:27     ` Ronald S. Bultje
2025-05-23  0:45   ` Michael Niedermayer
2025-05-23  0:57     ` Michael Niedermayer
2025-05-23  9:33       ` Timothée
2025-05-23 11:55         ` Michael Niedermayer
2025-05-26 18:09           ` Timothée
2025-05-26 18:57             ` Ronald S. Bultje
2025-06-06 19:32 ` Tomas Härdin

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=CALweWgBwicEsOuHb6k-H-bktazoDxBCTnOKExFat5YvkWWcKnQ@mail.gmail.com \
    --to=ramiro.polla@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