[Libav-user] partial decoding of mp4 files

Sam Halliday sam.halliday at gmail.com
Wed May 17 14:32:34 EEST 2017

 Hi all,

Is there a way to get hold of low level information, i.e. partial
decodings, of an mp4 file? Since this is all I need for my analysis, I
hope it would be more efficient than decoding the entire video:

1. key frames (skipping motion compensation frames) as decoded images
2. p-frame motion vectors... I know h264 gets a bit more complex with
full inter-frame but just forward motion estimation is fine.
3. the fourier space from AAC (or anything that would resemble the
DTFT... I realise this is a bit more ill-defined, it's not as

It looks like libavcodec is the closest thing to what I'm looking for:


I'm not a C developer, so I'm not very proficient at understanding the
documentation. (I'm looking to do something on the JVM and I'm
experienced with JNI / JNA / etc, but I think I can translate the C
once I find exactly what I need to do.)

Would I be right in saying that I need to call avcodec_send_packet() ?
Then I'm lost. How would I be able to detect what kind of packet this
is, e.g. to determine if it is key or p-frame, and then be able to
uncompress it into a JPEG or motion vectors (dropping the residue).

Best regards,

More information about the Libav-user mailing list