[Libav-user] partial decoding of mp4 files

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] partial decoding of mp4 files

Sam Halliday
 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
important)

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

  https://www.ffmpeg.org/doxygen/3.2/group__lavc__encdec.html
  https://www.ffmpeg.org/doxygen/3.2/group__lavc__decoding.html

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,
Sam
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: partial decoding of mp4 files

Carl Eugen Hoyos-2
2017-05-17 13:32 GMT+02:00 Sam Halliday <[hidden email]>:

> 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

See the -skip_frame option.

I believe motion vectors are produced as part of decoding and that
cannot be optimized easily.

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: partial decoding of mp4 files

Sam Halliday
Thanks Carl,

Is that for the CLI? I was thinking more for the programmatic access,
where is the skip frame option there? Is the API still limited it what
it can obtain for motion vectors?

Best regards,
Sam

On 17 May 2017 at 12:54, Carl Eugen Hoyos <[hidden email]> wrote:

> 2017-05-17 13:32 GMT+02:00 Sam Halliday <[hidden email]>:
>
>> 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
>
> See the -skip_frame option.
>
> I believe motion vectors are produced as part of decoding and that
> cannot be optimized easily.
>
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/libav-user
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: partial decoding of mp4 files

Carl Eugen Hoyos-2
2017-05-18 21:13 GMT+02:00 Sam Halliday <[hidden email]>:

> Is that for the CLI?

The exact same option exists for the cli (you can use it to test
if the option is what you need) and the library.

Please do not top-post here, Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user