2 ["type"] = "EditorAction",
3 name = "Export markers as mp4chaps",
4 author = "Johannes Mueller",
6 Exports MP4chaps of all markers except xruns. The markers are stored in the
7 export directory of the session in mp4 chapter marks format. The filename
10 Note that there's always a chapter mark "Intro" at 00:00:00.000 as some
11 players can't live without it. If there are no exportable markers, the file
14 This is a bit more convenient than the export option, as one does not
15 have to wait for the export.
20 function factory (unused_params) return function ()
22 fr = Session:frame_rate()
25 for l in Session:locations():list():iter() do
27 if not l:is_mark() or string.find(name, "^xrun%d*$") then
31 h = math.floor(t / (3600*fr))
33 m = math.floor(r / (60*fr))
35 s = math.floor(r / fr)
37 ms = math.floor(r*1000/fr)
38 table.insert(chaps, string.format("%02d:%02d:%02d.%03d %s\n", h, m, s, ms, name))
42 if next(chaps) == nil then
45 table.insert(chaps, "00:00:00.000 Intro\n")
48 file = io.open(ARDOUR.LuaAPI.build_filename (Session:path(), "export", "mp4chaps.txt"), "w")
49 for i, line in ipairs(chaps) do