Read chapters from an mp4 file?

39 views Asked by At

I export an mp4 file with chapters from Final Cut Pro. The chapters undoubtedly export, I can see them when I open the file in QuickTime.

The mp4 is then stored in an s3 bucket and streamed via Cloudfront to a custom video player I built in React.

I want to render the chapters in the video player. I realize I can do this with a separate .vtt file, but I'm wondering if I can somehow get the chapters from the mp4 metadata? It's not obvious to me...but the information is obviously stored somewhere in the file because QuickTime is reading it. Can't I read it somehow, too?

Thanks in advance. Also, I'm not looking for a third-party video player solution. If I can't read the chapters from an mp4 file somehow, I'll just resort to a .vtt file.

I tried:

const command = await s3.send(
       new GetObjectCommand({
         Bucket: bucket,
         Key: `file.mp4`,
       })
     );

and

const command = await s3.send(
       new HeadObjectCommand({
         Bucket: bucket,
         Key: `file.mp4`,
       })
     );

hoping that the chapters would show up in the metadata somewhere, but I'm not seeing it.

0

There are 0 answers