[FFmpeg-devel] Extracting individual macroblocks H.264

Michael Niedermayer michaelni at gmx.at
Tue Feb 19 16:43:32 CET 2013

On Tue, Feb 19, 2013 at 10:15:02AM -0500, Marty Sullivan wrote:
> I am looking to write a program that will extract individual macroblocks
> and motion vectors from an H.264 encoded video.
> I've been able to extract the vectors but when it comes to matching them to
> a specific macroblock and getting the data for that macroblock I am having
> trouble. When I just pull blocks from an AVFrame, it doesn't seem to match
> properly.
> Some structs I've been looking at seem useful (H264Context and its
> MotionEstContext) but I'm not quite sure how to use them. If I have an
> AVCodec & AVCodecContext and *know* they are decoding an H.264 video
> stream, how would I get these structures and how would I use them to
> extract macroblocks?
> Some advice or sample code would be phenomenal! Thanks!

look at the motion vector & macroblock vissualization code
(also try -vismv 7 -debug 16384)

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130219/a45583c4/attachment.asc>

More information about the ffmpeg-devel mailing list