PageSourceSearch

https://www.liquidsoap.info/assets/js/3a8e0a71.cb80b63f.js

js liquidsoap.info collected 2026-10-03 22:40:34 UTC 14,242 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunksite=self.webpackChunksite||[]).push([["21236"],{56968(e,t,n){n.r(t),n.d(t,{metadata:()=>i,default:()=>h,frontMatter:()=>c,contentTitle:()=>r,toc:()=>d,assets:()=>l});var i=JSON.parse('{"id":"reference-extras/source-output","title":"Source / Output","description":"Output an MPEG-DASH playlist.","source":"@site/versioned_docs/version-2.4.5/reference-extras/source-output.md","sourceDirName":"reference-extras","slug":"/reference-extras/source-output","permalink":"/doc-2.4.5/reference-extras/source-output","draft":false,"unlisted":false,"tags":[],"version":"2.4.5","frontMatter":{"title":"Source / Output","description":"Output an MPEG-DASH playlist."}}'),s=n(74848),o=n(28453);let c={title:"Source / Output",description:"Output an MPEG-DASH playlist."},r,l={},d=[{value:"<code>output.file.dash</code>",id:"output.file.dash",level:3}];function a(e){let t={code:"code",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h3,{id:"output.file.dash",children:(0,s.jsx)(t.code,{children:"output.file.dash"})}),"\n",(0,s.jsx)(t.p,{children:"Output an MPEG-DASH playlist."}),"\n",(0,s.jsx)(t.p,{children:"Type:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{children:"(?id : string?, ?fallible : bool, ?codec : string, ?bitrate : int,\n ?start : bool, ?playlist : string, directory : string,\n source(audio=pcm(stereo))) -> unit\n"})}),"\n",(0,s.jsx)(t.p,{children:"Arguments:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"id"})," (of type ",(0,s.jsx)(t.code,{children:"string?"}),", which defaults to ",(0,s.jsx)(t.code,{children:"null"}),"): Force the value of the source ID."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"fallible"})," (of type ",(0,s.jsx)(t.code,{children:"bool"}),", which defaults to ",(0,s.jsx)(t.code,{children:"false"}),"): Allow the child source to fail, in which case the output will be (temporarily) stopped."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"codec"})," (of type ",(0,s.jsx)(t.code,{children:"string"}),", which defaults to ",(0,s.jsx)(t.code,{children:'"libmp3lame"'}),"): Codec to use for audio (following FFmpeg's conventions)."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"bitrate"})," (of type ",(0,s.jsx)(t.code,{children:"int"}),", which defaults to ",(0,s.jsx)(t.code,{children:"128"}),")"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"start"})," (of type ",(0,s.jsx)(t.code,{children:"bool"}),", which defaults to ",(0,s.jsx)(t.code,{children:"true"}),"): Automatically start outputting whenever possible. If true, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"playlist"})," (of type ",(0,s.jsx)(t.code,{children:"string"}),", which defaults to ",(0,s.jsx)(t.code,{children:'"stream.mpd"'}),"): Playlist name"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"directory"})," (of type ",(0,s.jsx)(t.code,{children:"string"}),"): Directory to write to"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"(unlabeled)"})," (of type ",(0,s.jsx)(t.code,{children:"source(audio=pcm(stereo))"}),")"]}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:"Methods:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"buffered"})," (of type ",(0,s.jsx)(t.code,{children:"() -> [string * float]"}),"): Length of buffered data."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"clock"})," (of type ",(0,s.jsx)(t.code,{children:"clock"}),"): The source's clock"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"duration"})," (of type ",(0,s.jsx)(t.code,{children:"() -> float"}),"): Estimation of the duration of the current track."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"elapsed"})," (of type ",(0,s.jsx)(t.code,{children:"() -> float"}),"): Elapsed time in the current track."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"fallible"})," (of type ",(0,s.jsx)(t.code,{children:"bool"}),"): Indicate if a source may fail, i.e. may not be ready to stream."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"generate_frame"}
1)," (of type ",(0,s.jsx)(t.code,{children:"() -> unit"}),"): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such as ",(0,s.jsx)(t.code,{children:"on_frame"}),"!"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"id"})," (of type ",(0,s.jsx)(t.code,{children:"() -> string"}),"): Identifier of the source."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"insert_metadata"})," (of type ",(0,s.jsx)(t.code,{children:"(?new_track : bool, [string * string]) -> unit"}),"): Dynamically insert metadata in a stream. Inserts a new track with the given metadata if ",(0,s.jsx)(t.code,{children:"new_track"})," is ",(0,s.jsx)(t.code,{children:"true"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"is_active"})," (of type ",(0,s.jsx)(t.code,{children:"() -> bool"}),"): ",(0,s.jsx)(t.code,{children:"true"})," if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically, ",(0,s.jsx)(t.code,{children:"true"})," for outputs and sources such as ",(0,s.jsx)(t.code,{children:"input.http"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"is_ready"})," (of type ",(0,s.jsx)(t.code,{children:"() -> bool"}),"): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"is_started"})," (of type ",(0,s.jsx)(t.code,{children:"() -> bool"}),"): ",(0,s.jsx)(t.code,{children:"true"})," if the output or source is started."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"is_up"})," (of type ",(0,s.jsx)(t.code,{children:"() -> bool"}),"): Indicate that the source can be asked to produce some data at any time. This is ",(0,s.jsx)(t.code,{children:"true"})," when the source is currently being used or if it could be used at any time, typically inside a ",(0,s.jsx)(t.code,{children:"switch"})," or ",(0,s.jsx)(t.code,{children:"fallback"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"last_metadata"})," (of type ",(0,s.jsx)(t.code,{children:"() -> [string * string]?"}),"): Return the last metadata from the source."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"log"})," (of type ",(0,s.jsx)(t.code,{children:"{level : (() -> int).{set : (int) -> unit}}"}),"): Get or set the source's log level, from ",(0,s.jsx)(t.code,{children:"1"})," to ",(0,s.jsx)(t.code,{children:"5"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"register_command"})," (of type ",(0,s.jsx)(t.code,{children:"(?usage : string?, description : string, string, ((string) -> string)) -> unit"}),"): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"remaining"})," (of type ",(0,s.jsx)(t.code,{children:"() -> float"}),"): Estimation of remaining time in the current track."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"reopen"})," (of type ",(0,s.jsx)(t.code,{children:"() -> unit"}),"): Reopen the output pipe. The actual reopening happens the next time the output has some data to output."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"reset_last_metadata_on_track"})," (of type ",(0,s.jsx)(t.code,{children:"(() -> bool).{set : (bool) -> unit}"}),"): If ",(0,s.jsx)(t.code,{children:"true"}),", the source's ",(0,s.jsx)(t.code,{children:"last_metadata"})," is reset on each new track. If a metadata is present along with the track mark, then it becomes the new ",(0,s.jsx)(t.code,{children:"last_metadata"}),", otherwise, ",(0,s.jsx)(t.code,{children:"last_metadata becomes "}),"null`."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"seek"})," (of type ",(0,s.jsx)(t.code,{children:"(float) -> float"}),"): Seek forward, in seconds (returns the amount of time effectively seeked)."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"self_sync"}
1)," (of type ",(0,s.jsx)(t.code,{children:"() -> bool"}),"): Is the source currently controlling its own real-time loop."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"self_sync_description"})," (of type ",(0,s.jsx)(t.code,{children:"() -> string"}),"):"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"shutdown"})," (of type ",(0,s.jsx)(t.code,{children:"() -> unit"}),"): Shutdown the output."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"skip"})," (of type ",(0,s.jsx)(t.code,{children:"() -> unit"}),"): Skip to the next track."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"start"})," (of type ",(0,s.jsx)(t.code,{children:"() -> unit"}),"): Ask the source or output to start."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"stop"})," (of type ",(0,s.jsx)(t.code,{children:"() -> unit"}),"): Ask the source or output to stop."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"time"})," (of type ",(0,s.jsx)(t.code,{children:"() -> float"}),"): Get a source's time, based on its assigned clock."]}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:"Callbacks:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"on_frame"})," (of type ",(0,s.jsx)(t.code,{children:"(?before : bool, synchronous : bool, (() -> unit)) -> unit"}),"): Call a given handler on frame. When ",(0,s.jsx)(t.code,{children:"before"})," is ",(0,s.jsx)(t.code,{children:"true"}),", callback is executed before computing the frame and after otherwise"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"on_frame_checksum"})," (of type ",(0,s.jsx)(t.code,{children:"(?before : ((string?) -> unit)?, synchronous : bool,  ((cache : string?, string) -> unit)) -> unit"}),"): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. The ",(0,s.jsx)(t.code,{children:"before"})," callback is called before computing the frame with the checksum of the cached frame (if any, ",(0,s.jsx)(t.code,{children:"null"})," otherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any)."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"on_metadata"})," (of type ",(0,s.jsx)(t.code,{children:"(synchronous : bool, (([string * string]) -> unit)) -> unit"}),"): Call a given handler to execute on each metadata"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"on_position"})," (of type ",(0,s.jsx)(t.code,{children:"(position : {float}, ?remaining : bool, ?allow_partial : bool,  synchronous : bool, ((float, [string * string]) -> unit)) -> unit"}),"): Call a given handler on track position. If ",(0,s.jsx)(t.code,{children:"remaining"})," is ",(0,s.jsx)(t.code,{children:"false"}),", callback is executed when position in track is more or equal to ",(0,s.jsx)(t.code,{children:"position"}),". If ",(0,s.jsx)(t.code,{children:"remaining"})," is ",(0,s.jsx)(t.code,{children:"true"}),", callback is executed when remaining time in the current track is less or equal to ",(0,s.jsx)(t.code,{children:"position"}),". Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. When ",(0,s.jsx)(t.code,{children:"allow_partial"})," is ",(0,s.jsx)(t.code,{children:"true"}),", if the current track ends before the ",(0,s.jsx)(t.code,{children:"offset"})," position is reached, callback is still executed"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"on_reopen"})," (of type ",(0,s.jsx)(t.code,{children:"(synchronous : bool, (() -> unit)) -> unit"}),"): Call a given handler when the output is reopened."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"on_shutdown"})," (of type ",(0,s.jsx)(t.code,{children:"(synchronous : bool, (() -> unit)) -> unit"}),"): Call a given handler to be called when source shuts down"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"on_start"})," (of type ",(0,s.jsx)(t.code,{children:"(synchronous : bool, (() -> unit)) -> unit"}),"): Call a given handler when output starts"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"on_stop"})," (of type ",(0,s.jsx)(t.code,{children:"(synchronous : bool, (() -> unit)) -> unit"}),"): Call a given handler when output stops"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"on_track"})," (of type ",(0,s.jsx)(t.code,{children:"(synchronous : bool, (([string * string]) -> unit)) -> unit"}),"): Call a given handler on track marks"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.code,{children:"on_wake_up"})," (of type ",(0,s.jsx)(t.code,{children:"(synchronous : bool, (() -> unit)) -> unit"}),"): Call a given handler to be called after the source is asked to get ready"]}),"\n"]})]})}function h(e={}){let{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},28453(e,t,n){n.d(t,{R:()=>c,x:()=>r});var i=n(96540);let s={},o=i.createContext(s);function c(e){let t=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.