[FFmpeg-user] Are there any plans for ffmpeg to write timecode into MP4 container?

Nathan Lewis nlewis at crawford.com
Fri Mar 7 20:09:31 CET 2014


Hello,

I came across a technical note from Apple regarding storing timecode within
the MP4 container.  Are there any plans to implement this as a ffmpeg
feature?  I've pasted some of the info below in case the link disappears.

Regards,

Nathan

https://developer.apple.com/library/mac/technotes/tn2174/_index.html

Technical Note TN2174
Final Cut Pro X - Metadata in MP4

Final Cut Pro X recognizes timecode and certain metadata in MP4 files, as
much as it does in QuickTime Movie (MOV) files. This document describes the
format of timecode and chapter markers stored as a track in MP4 files. It
also discusses how metadata Final Cut Pro X supports are stored in MP4
files as user data items.

Consumer/Prosumer level Camcorders and Still Cameras (DSLRs and DSCs)
require a self-contained media file format to carry captured audio/video
footage and metadata. The QuickTime File Format [1] fills this need very
nicely, however there is an increased level of interest among camera
manufacturers for a specification based-on the standard such as MP4.

This document addresses such interest by defining the format of the
timecode and chapter marker tracks in the MP4 File Format [2], borrowing
relevant definitions from the QuickTime File Format. In addition Apple
recommends using the User Data container for storing non-temporal metadata
in an MP4 file with the keys defined in the 3GPP standard [5]. The document
also defines additional metadata keys intended for use with video editing
applications such as Final Cut Pro X.


MP4 File Format

The MP4 File Format is a multimedia container file format defined as part
of the MPEG-4 standard. The official name of the standard is ISO/IEC
14496-14:2003 [2], often times referred to as MPEG-4 Part 14. It defines
how to store video and audio streams encoded with certain codecs, such as
MPEG-4 Part 2 or MPEG-4 Part 10 (H.264/AVC) and Advanced Audio Coding
(AAC). The MP4 File Format is also used to store subtitle text in the
MPEG-4 Timed Text format (MPEG-4 Part 17 [3]).

The MP4 File Format has general provisions for carrying temporal metadata
using the definitions in the ISO Base Media File Format (MPEG-4 Part 12
[4]), but there is no concrete specification to store timecode information
or chapter markers. There is very limited non-temporal or clip metadata
(only copyright) defined specifically for MP4.


Timecode and Chapter Markers

Apple recommends that developers and manufacturers use the following two
track types to store timecode and chapter markers in an MP4 file:

Timecode Track
Chapter Marker Track
These track types are already available in the QuickTime File Format. The
MP4 File Format design is similar to the QuickTime File Format, therefore
it's natural to borrow these constructs defined in the QuickTime File
Format to support the features in the MP4 File Format. It may, however, be
appropriate to drop legacy QuickTime specific constructs that are awkward
in the context of the ISO specification.


Timecode Track

The timecode track in an MP4 file uses the constructs defined in the
QuickTime File Format, with some minor modifications.

The text formatting information to display the timecode is dropped.
The Null Media Header box (nmhd) box is used instead of the Generic Media
Header box (gmhd).
The rest of the QuickTime Timecode track functionality, such as 64-bit
timecode support, is preserved.

Timecode Media Information
The following sections describe the boxes under the Media box (mdia) that
indicate a timecode track.

Handler Reference Box

The handler type is tmcd in the Handler Reference box (hdlr) under the
Media box (mdia), as defined in the QuickTime File Format Specification
[1]. This indicates that the track contains timecode information.

Media Information Header Box

For a timecode track, the Null Media Header box (nmhd) is used as the media
information header. This is in contrast to the Generic Media Header box
(gmhd) used in the QuickTime Timecode track.

Unlike the QuickTime Timecode track, there is no Timecode Media Information
box (tcmi). The information in this box is about formatting the timecode as
text. Given the timecode is metadata, the formatting information is no
longer considered relevant, and therefore dropped.

Timecode Sample Entry

The timecode track sample entry uses the same structure as the Timecode
Sample Description defined in the QuickTime Movie File Format specification
[1], except for the source reference field. The Timecode Sample Entry
definition is presented in Listing 1 with the same notation used in the MP4
specification [2].


More information about the ffmpeg-user mailing list