Effort free video editing!
Write named markers as chapters by default
WyattBlue896b00448760
diff --git a/docs/src/docs/v3.md b/docs/src/docs/v3.mdindex 2f90a52b..3b87296f 100644--- a/docs/src/docs/v3.md+++ b/docs/src/docs/v3.md@@ -150,7 +150,7 @@ From the command line, `--marker` sets them in the input's time, and auto-editor| `shotcut` | timeline markers | name, color, span || `kdenlive` | timeline guides, with a category per color | name, color, span |-A media export writes named markers as chapters with `--chapters`: a span's own length, or for a point, up to the next chapter.+A media export writes named markers as chapters: a span's own length, or for a point, up to the next chapter. `--no-chapters` leaves them out.```json"markers": [diff --git a/src/cli.nim b/src/cli.nimindex 83e9d06c..ab60f2a2 100644--- a/src/cli.nim+++ b/src/cli.nim@@ -43,9 +43,9 @@ type CliOption* = enumcoVideoSpeed, coPremiere, coResolve, coFinalCutPro, coShotcut, coKdenlive, coExport,coFrameRate, coSampleRate, coResolution, coBackground, coYtDlpLocation,coOutputFormat, coYtDlpExtras, coProgress, coQuiet, coPreview, coVn, coAn, coSn,- coDn, coFaststart, coNoFaststart, coFragmented, coNoFragmented, coChapters, coVcodec,- coVideoBitrate, coCrf, coGop, coVprofile, coPreset, coPixFmt, coScale, coFont, coNoSeek,- coNoPartialLossless, coAcodec, coLayout, coAudioBitrate, coMixAudioStreams,+ coDn, coFaststart, coNoFaststart, coFragmented, coNoFragmented, coChapters,+ coNoChapters, coVcodec, coVideoBitrate, coCrf, coGop, coVprofile, coPreset, coPixFmt,+ coScale, coFont, coNoSeek, coNoPartialLossless, coAcodec, coLayout, coAudioBitrate, coMixAudioStreams,coAudioNormalize, coOpen, coNoOpen, coKey, coShowVersion, coWebCodecs, coWhentype OptDef* = object@@ -266,7 +266,9 @@ Examples:OptDef(names: "--no-fragmented", c: cCon, kind: Flag, datum: coNoFragmented,help: "Do not use fragmented mp4/mov for better compatibility (default)"),OptDef(names: "--chapters", c: cCon, kind: Flag, datum: coChapters,- help: "Write each named marker as a chapter, running for its span or else up to the next one"),+ help: "Write each named marker as a chapter, running for its span or else up to the next one (default)"),+ OptDef(names: "--no-chapters", c: cCon, kind: Flag, datum: coNoChapters,+ help: "Do not write named markers as chapters"),OptDef(names: "-c:v, -vcodec, --video-codec", c: cVid, datum: coVcodec,metavar: "ENCODER", help: "Set video codec for output media"),@@ -472,8 +474,8 @@ macro genCmdCases*(keyIdent: untyped): untyped =const argsFlagOptions = {coPreview, coVn, coAn, coSn, coDn, coFaststart, coNoFaststart, coFragmented,- coNoFragmented, coChapters, coNoSeek, coNoPartialLossless, coMixAudioStreams, coOpen,- coNoOpen, coWebCodecs,+ coNoFragmented, coChapters, coNoChapters, coNoSeek, coNoPartialLossless,+ coMixAudioStreams, coOpen, coNoOpen, coWebCodecs,}func flagTarget(opt: CliOption): string {.compileTime.} =diff --git a/src/render/format.nim b/src/render/format.nimindex 323fec0e..51d04bc1 100644--- a/src/render/format.nim+++ b/src/render/format.nim@@ -387,7 +387,7 @@ proc makeMedia*(args: mainArgs, inputVideo: VideoSettings, audio: AudioSettings,discard av_dict_copy(addr outStrm.metadata, strm.metadata, 0)imageStreams.add((outStrm, addr strm.attached_pic))- if args.chapters:+ if not args.noChapters:# A named marker starts a chapter that runs for its span or, being a# point, up to the next chapter: players expect chapters end to end.var named = tl.markers.filterIt(it.name != "")