Recording A/V .mov file with SMPTE timecode

Hello, I used following technical note to develop app that record mov file with SMPTE timecode. https://developer.apple.com/library/archive/technotes/tn2310/_index.html

As result, a timecode track is present within .mov file (other tracks are audio and video)

Unfortunately, QuickTime Player doesn't display timecode information. Analyser tools like mediainfo or online service as https://media-analyzer.pro/app show that timecode track has null duration (and so no "time code of last frame"

example n° of TC track : Other ID : 3 Type : Time code Format : QuickTime TC Frame rate : 60.000 FPS Time code of first frame : 17:39:59:00 Time code, stripped : Yes Title : Core Media Time Code Encoded date : 2024-09-10 15:39:46 UTC Tagged date : 2024-09-10 15:39:59 UTC

example 2 of Timecode track : 0000569562Quicktime Timecode #0 00007f6b8a'trak' Track atom #1 00007f6b92'tkhd' Track header atom #2 size 92 (0x5C) type 'tkhd' (hex 74 6B 68 64) version 0 flags 15 (0xF) creation_time 0xE30618C2, '2024-09-10 15:39:46' modification_time 0xE30618CF, '2024-09-10 15:39:59' track_ID 3 reserved 0 duration 0 reserved [0, 0]

In each case, duration is considered as null even if the record's duration is more than 20s.

STEPS TO REPRODUCE Use AVAssetWriter for video and audio. Create AVAssetWrite for timecode and associate it with video track. Just before stopping record, a sample buffer containing SMPTE is generated and added. All track are marked as finished before stopping the record with finishWritingWithCompletionHandler.

Answered by ftristani in 806798022

Need to use appropriate timescale for timecode sample buffer duration and patch timecode sample buffer presentation timestamp with first presentation timestamp of video track.

Accepted Answer

Need to use appropriate timescale for timecode sample buffer duration and patch timecode sample buffer presentation timestamp with first presentation timestamp of video track.

Recording A/V .mov file with SMPTE timecode
 
 
Q