Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to decode frames from MDAT atom extracted from mp4 video

I am new to video codecs and learning video file format specifications. I have read about QUICKTIME file format specifications from here, and MP4 file format (which is almost similar) from here. There are atoms such FTYPE, MOOV, MDAT etc. The MDAT atom contains actual audio and video data. The MOOV atom contains information about how to extract data from MDAT, it gives references to chunks (samples).

I want to extract the video samples in MDAT atom from video file without using any tool such ffmpeg, or juggler etc. I can write my own code for this. The problem is, even if I can locate the video data (samples) in MDAT by using information from MOOV, these samples are compressed. And we need to uncompress these to get frames. My question is can we uncompress the samples extracted from MDAT and get the actual video frames ?

Tools such as xuggler, ffmpeg etc are used to extract frames from video files. But here I want to extract the samples(for video data) from MDAT by writing my own code, but then I want to uncompress those by using some tool. I don't want to write codecs.

Can anyone please help me with this....!

Thanks...

like image 490
Gurinderbeer Singh Avatar asked Oct 30 '22 05:10

Gurinderbeer Singh


1 Answers

ffmpeg is a collection of libraries. libavformat is used to read and write files(what you are doing with your own code), libavcodec can be used on its own to decode samples.

like image 93
szatmary Avatar answered Nov 14 '22 07:11

szatmary