Closed NCrusher74 closed 4 years ago
Use AVFormatContext.chapters
.
let formatContext = try AVFormatContext(format: nil, filename: output)
formatContext.chapters = [
AVChapter(id: 0, timeBase: AVRational(num: 1, den: 1000), start: 0, end: 2000, metadata: ["title": "Chapter 1"]),
AVChapter(id: 1, timeBase: AVRational(num: 1, den: 1000), start: 2000, end: 4000, metadata: ["title": "Chapter 2"]),
AVChapter(id: 2, timeBase: AVRational(num: 1, den: 1000), start: 4000, end: 10000, metadata: ["title": "Chapter 3"]),
]
Thank you so much!
I'm sorry, upon experimenting with this, AVChapter
isn't being recognized as a valid identifier. Do I need to import something other than just SwiftFFmpeg
?
The AVChapter
related API was just added yesterday, maybe you need to update the dependency.
Thank you so much!
I'm new to using SwiftFFmpeg and I'm having trouble translating the basic FFmpeg terminal commands for use with SwiftFFMpeg.
What I need to do is very basic and straightforward. Following this process, I want to create chapter metadata, formatted like so:
and then mux it into a file using these command-line arguments:
ffmpeg -i MyVideo.mp4 -i metadata -map_metadata 1 MyVideo_1.mp4
How would I accomplish that?