Eyevinn / mp4ff

Library and tools for parsing and writing MP4 files including video, audio and subtitles. The focus is on fragmented files. Includes mp4ff-info, mp4ff-encrypt, mp4ff-decrypt and other tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to package AVC into MP4

ipcdev opened this issue · comments

commented

How to package AVC into MP4

commented

How to package AVC/HEVC into mp4

@ipcdev There is currently no such example code in this library.

However, it should be rather easy to write such code for generating fragmented/segmented MP4 files using this library.

An AVC stream consists of one or more NALUs (Network Adaptation Layer Units) per frame, and the MP4 files have one frame per sample in the file. Beyond the NALUs you need timestamps to get the right framerate/timing.

You first need to make an init segment as in examples/initcreator.
Then you need to make "media segments". The code in examples/segmenter takes a progressive mp4 file and creates such segments by pulling out allt samples and then writing them with the metadata boxes needed.

I hope this helps.