Files
shaka-packager/include/packager/cea_caption.h
Xavier Laffargue 51e25b56ee feat: DASH - Add signaling for CEA-608/708 captions (#1549)
This change introduces support for signaling CEA-608 and CEA-708 closed
captions in DASH. (Equivalent of
https://github.com/shaka-project/shaka-packager/pull/1532)

It reuses the existing --closed_captions command-line flag. Note that
some options (name, autoselect, and default) are not used for DASH.


```
--closed_captions 'channel=CC1,lang=fra;channel=CC2,lang=eng;channel=SERVICE1,lang=eng'
```


For Dash this adds an Accessibility tag in each video AdaptationSet.

Example output : 
```
<AdaptationSet id="1" contentType="video" ....>
      <Accessibility schemeIdUri="urn:scte:dash:cc:cea-608:2015" value="CC1=fra"/>
      <Accessibility schemeIdUri="urn:scte:dash:cc:cea-608:2015" value="CC2=eng"/>
      <Accessibility schemeIdUri="urn:scte:dash:cc:cea-708:2015" value="1=lang:eng"/> 
```

HLS changes :
* We force the language to 2 characters to be consistent with the
language of the audio files, for example.
* closed_captions is now in packaging_params
2026-03-11 10:55:52 -07:00

31 lines
803 B
C++

// Copyright 2024 Google LLC. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#ifndef PACKAGER_PUBLIC_CEA_CAPTION_H_
#define PACKAGER_PUBLIC_CEA_CAPTION_H_
#include <string>
namespace shaka {
/// CEA caption description.
struct CeaCaption {
/// The display name of the caption.
std::string name;
/// The language of the caption.
std::string language;
/// The channel of the caption, e.g. "CC1", "SERVICE2".
std::string channel;
/// True if this is the default caption.
bool is_default = false;
/// True if this caption should be autoselected.
bool autoselect = true;
};
} // namespace shaka
#endif // PACKAGER_PUBLIC_CEA_CAPTION_H_