Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial-at-gmail.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] Macroblocks modes extraction
Date: Fri, 4 Jul 2025 09:36:08 -0300
Message-ID: <94b598f4-280f-4892-82af-4685bbe118a6@gmail.com> (raw)
In-Reply-To: <67c3bd5d-4570-48d3-9957-60f788adfcb2@regaud-chapuy.fr>


[-- Attachment #1.1.1: Type: text/plain, Size: 2042 bytes --]

On 7/2/2025 7:57 AM, Timothee wrote:
> Hello,
> 
> I am working on a modification toextract per-macroblock prediction modes 
> (H.264 for now). The goal is to make this information available to 
> vf_codecview and print it in a log file (for now).
> 
> This are what I have added:
> 
> 1.
> 
>     A new H264MBInfostruct holding the prediction modes.

Isn't this what libavutil/video_enc_params.h is for? Or if needed, what 
it could be extended to handle?

> 
> 2.
> 
>     An AVBufferRef *mb_info_refis added to the H264Picturestruct to
>     store this data for each picture.
> 
> 3.
> 
>     This buffer is allocated with av_buffer_allocz()in
>     alloc_picture()and its reference is released with
>     av_buffer_unref()in ff_h264_unref_picture().
> 
> 4.
> 
>     A new function, ff_h264_collect_mb_info(), is called after
>     macroblock decoding to populate the buffer.
> 
> 5.
> 
>     In output_frame(), a new side data (AV_FRAME_DATA_H264_MB_INFO)
>     buffer is allocated, and the contents of srcp->mb_info_ref->dataare
>     copied into it.
> 
> 6. A new function to log the result in vf_codecview.c
> 
> This implementation results in a segmentation fault. I guess it is a 
> race condition, but I am struggling to fix it.
> 
> The patch provided should result in the same error when running `./ 
> ffmpeg -loglevel debug -i input.mp4 -vf codecview=show_modes=1 -f null -`
> 
> Are side data the right thing to use in this context ? Is there a better 
> approach to do it ?
> 
> I am new to FFmpeg and, in general, to large open-source projects, but I 
> am willing to learn so please do not hesitate to correct me.
> 
> Thank you for your guidance.
> 
> Timothée
> 
> 
> _______________________________________________
> 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".


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

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

  parent reply	other threads:[~2025-07-04 12:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-02 10:57 Timothee
2025-07-04 11:05 ` Michael Niedermayer
2025-07-04 13:04   ` Timothée
2025-07-04 12:36 ` James Almer [this message]
2025-07-04 13:22   ` Timothée

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=94b598f4-280f-4892-82af-4685bbe118a6@gmail.com \
    --to=jamrial-at-gmail.com@ffmpeg.org \
    --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