Introducing Scheduled Channel (a.k.a Pre-recorded Live or File Live) #1461
Replies: 9 comments 18 replies
-
Thank you @getroot for this new and powerful feature! I tried setting up a basic file for playback as specified in the documentation and it works 😀 Transcoding will be important because most offline files are not encoded optimally for streaming - an issue that shows for sure if you bypass the transcoder. I think it would be good to expand the Conditional transcoding options to include BFrame and Keyframe interval options - i.e. transcode only if BFrames are detected or keyframe interval is above N seconds. Then one application could handle both live and scheduled streams without doing unneeded transcoding on the live content. I will test further as soon as possible! |
Beta Was this translation helpful? Give feedback.
-
I notice this error in the log if there is no duration of 1000 or more specified for a Program Item:
That is OK but your documentation suggests that omitting the duration will stream the entire file. Perhaps that and/or specifying "0" as the duration. |
Beta Was this translation helpful? Give feedback.
-
If you remove or rename a single file that is scheduled, or there are no playable files in the program, the stream gets 'stuck' in a live state and the OME log repeats this every second:
Perhaps if there are no valid program items, the stream should stop? |
Beta Was this translation helpful? Give feedback.
-
Is there more information available on the supported codecs, containers and parameters for scheduled playback? It seems to have trouble decoding certain clips, and doesn't seem to support advanced codecs like HEVC in my initial testing. Here is a sample H264 file that for some reason does not want to stream smoothly over Scheduled (with the transcoder enabled as you recommended). Does it stream smoothly on your side? test.movAnd an HEVC file that should stream fine into OME but the video track is not recognized by the Scheduled provider: hevc.mov |
Beta Was this translation helpful? Give feedback.
-
I added live input (stream://) and FallbackProgram functions. Live input is available in the following formats:
This will tap (mirroring) data from other streams and output it again from the current Scheduled Channel.
This function is a scheduling channel, but it can be used for applications such as creating a permanent stream as follows.
This channel normally plays default/app/input, but when live input is stopped, it plays the file in FallbackProgram. This will last forever until the .sch file is deleted. One trick was to set the origin program's schedule time to 2000 so that this stream would play unconditionally. Then, please give us a lot of feedback. This has quite complex logic and since it has just been developed, there may be a number of issues. And you may experience some buffering when going from file to live. This is unavoidable due to the nature of the function and low latency. If this is inconvenient, buffering issues can disappear if you add a little delay in advance by setting PartHoldBack in LLHLS to 5 or more. It is a choice between delay and buffering. |
Beta Was this translation helpful? Give feedback.
-
Can those scheduled streams be consumed by all providers just like any normal incoming stream, for example for accessing it through OVT publisher for a Origin-Edge style configuration? |
Beta Was this translation helpful? Give feedback.
-
The example below is a minimal example setup to transmit a file instead when the input is off-air using Scheduled Stream. The stream set in this way is no different from the stream input from other providers, and can naturally be transmitted to OVT Publisher. Additionally, Scheduled Stream can use streams from any provider. There is nothing different in Server.xml. Just configure the And you need to configure video/audio encoding. If set to bypass, the file and live profiles are different, so the video may be broken when switching. Server.xml
stream.schCreate stream.sch in the folder you set and configure it as follows.
|
Beta Was this translation helpful? Give feedback.
-
Hi @getroot, this feature is amazing! And working better than ever with the latest improvements. I have a feature request that would be quite useful: would you consider allowing a directory to be used as a program item? The idea being that we could point OME at a directory e.g. "cat_videos" and it would simply play through the items in the folder alphabetically, allowing dynamic addition / removal of new items without changing the stream.sch config. |
Beta Was this translation helpful? Give feedback.
-
I tried creating a persistent live channel exactly as suggested in a previous comment and I found that it works great when I use OBS and RTMP as the source of the stream (meaning
|
Beta Was this translation helpful? Give feedback.
-
A feature that allows you to create a live channel by scheduling pre-recorded files has been added to OvenMediaEngine. Other services or software call this Pre-recorded Live or File Live, but OvenMediaEngine plans to expand the function to organize live channels as a source, so we named it Scheduled Channel.
I'd appreciate your feedback if you have a moment. Thank you for your support! This is currently in beta version, and we plan to officially update it once we integrate live sources and complete the implementation for FallbackProgram in the future.
This feature can be used after version 0.16.1 or with the master branch.
Getting Started
To use this feature, activate Schedule Provider as follows.
MediaRootDir
Root path where media files are located
ScheduleFileDir
Root path where the schedule file is located
Schedule Files
Scheduled Channel creates/updates/deletes streams by creating/editing/deleting files with the .sch extension in the ScheduleFileDir path. Schedule files (.sch) use the following XML format. When a
<Stream Name>.sch
file is created in ScheduleFileDir, OvenMediaEngine analyzes the file and creates a Schedule Channel with<Stream Name>
. If the contents of<Stream Name>.sch
are changed, the Schedule Channel is updated, and if the file is deleted, the stream is deleted.Stream (required)
This is the stream information that the Channel needs to create.
Stream.Name (optional)
It's the stream's name. This is a reference value extracted from the file name for usage. It's recommended to set it same for consistency, although it's for reference purposes.
Stream.BypassTranscoder (optional, default: false)
Set to true if transcoding is not desired.
Stream.VideoTrack (optional, default: true)
Determines whether to use the video track. If VideoTrack is set to true and there's no video track in the Item, an error will occur.
Stream.AudioTrack (optional, default: true)
Determines whether to use the audio track. If AudioTrack is set to true and there's no audio track in the Item, an error will occur.
FallbackProgram (optional)
Defines the default Item to be broadcasted in the absence of a scheduled Program at the current time or in case of errors in the Item.
Program (optional)
Schedules a program. The
name
is an optional reference value. If not set, a random name will be assigned. Set the start time in ISO8601 format in thescheduled
attribute. Decide whether to repeat theItems
when its playback ends.Program.Item (optional)
Configures the media source to broadcast.
The
url
points to the location of the media source. If it starts with 'file://', it refers to a file within the MediaRootDir directory. If it starts with 'stream://', it refers to another stream within the same OvenMediaEngine.For 'file' cases, the
start
attribute can be set in milliseconds to indicate where in the file playback should start.duration
indicates the playback time of that item in milliseconds. After the duration ends, it moves to the next item.Both 'start' and 'duration' are optional. If not set,
start
defaults to 0, andduration
defaults to the file's duration; if not specified, the media file will be played until its full duration.REST API
Schedule Channel provides the following APIs.
Request a list of all Scheduled Channels.
Create a Scheduled channel.
Request Body Example
Update the schedule.
<Stream>
cannot be PATCHed.Request Body Example
Obtain Scheduled Channel information and stat. It also provides information about the currently playing program and item.
Delete the Scheduled Channel.
Beta Was this translation helpful? Give feedback.
All reactions