Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add id3v2 export to HLS output. #3154

Merged
merged 3 commits into from
Jun 24, 2023
Merged

Add id3v2 export to HLS output. #3154

merged 3 commits into from
Jun 24, 2023

Conversation

toots
Copy link
Member

@toots toots commented Jun 17, 2023

This PR implements support for ID3 metadata for HLS output.

From the doc:

Metadata

HLS outputs supports metadata in two ways:

  • Through a timed_id3 metadata logical stream with the mpegts format.
  • Through regular ID3 frames, as requested by the HLS specifications for adts, mp3, ac3 and eac3 formats.
  • There is currently no support for in-stream metadata for the mp4 format.

Metadata parameters are passed through the record methods of the streams' encoders. Here's an example

output.file.hls(
  "/path/to/directory",
  [
   ("aac",
      %ffmpeg(format="adts", %audio(codec="aac")).{
        id3_version = 3
       }),
   ("ts-with-meta",
      %ffmpeg(format="mpegts", %audio(codec="aac")).{
        id3_version = 4
     }),
   ("ts",
      %ffmpeg(format="mpegts", %audio(codec="aac")).{
        id3 = false
      }),
   ("mp3",
      %ffmpeg(format="mp3", %audio(codec="libmp3lame")).{
        replay_id3 = false
      })
  ],
  source
)

Parameters are:

  • id3: Set to false to deactivate metadata on the streams. Defaults to true.
  • id3_version: Set the id3v2 version used to export metadata
  • replay_id3: By default, the latest metadata is inserted at the beginning of each segment to make sure new listeners always get the latest metadata. Set to false to disable it.

Metadata for these formats are activated by default. If you are experiencing any issues with them, you can disable them by setting id3 to false.

Fixes: #3153

@toots toots force-pushed the hls-id3v2 branch 12 times, most recently from 583aff4 to 677a1ea Compare June 22, 2023 17:03
@toots toots marked this pull request as ready for review June 24, 2023 14:35
@toots toots force-pushed the hls-id3v2 branch 2 times, most recently from 8b25f68 to 42a565d Compare June 24, 2023 14:37
@toots toots requested a review from smimram June 24, 2023 14:37
@toots toots merged commit f20d0a8 into main Jun 24, 2023
26 checks passed
@toots toots deleted the hls-id3v2 branch June 24, 2023 22:40
@Russsgithub
Copy link

This is great. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ID3v2 metadata in HLS streams
2 participants