Documentation
¶
Index ¶
- Constants
- Variables
- type AssetMap
- type AssetMapChunk
- type AssetMapEntry
- type CompositionMetadataAsset
- type CompositionPlaylist
- type DCP
- func (dcp *DCP) GetAbsoluteAssetPath(id string) (assetPath string, ok bool)
- func (dcp *DCP) GetAssetPath(id string) (assetPath string, ok bool)
- func (dcp *DCP) GetAssetPaths() map[string]string
- func (dcp *DCP) GetCompositionPlaylist(id string) (cpl CompositionPlaylist, err error)
- func (dcp *DCP) GetDCSubtitle(id string) (sub *DCSubtitle, err error)
- func (dcp *DCP) GetPackingList(id string) (pkl PackingList, err error)
- func (dcp *DCP) GetPackingLists() (pkls []PackingList, err error)
- func (dcp *DCP) IsIOP() bool
- func (dcp *DCP) IsSMPTE() bool
- func (dcp *DCP) SplitPackingList(id string, ...) (err error)
- type DCSubtitle
- type DCSubtitleLoadFont
- type Luminance
- type Node
- type PackingList
- type PackingListEntry
- type Reel
- type ReelAsset
- type ReelMarker
- type SubtitleAlignment
- type SubtitleDirection
- type SubtitleEffect
- type SubtitleEvent
- type SubtitleFont
- type SubtitleText
- type VolumeIndex
Constants ¶
View Source
const ( AssetMapNamespaceIOP = "http://www.digicine.com/PROTO-ASDCP-AM-20040311#" AssetMapNamespaceSMPTE = "http://www.smpte-ra.org/schemas/429-9/2007/AM" )
View Source
const ( CompositionPlaylistNamespaceIOP = "http://www.digicine.com/PROTO-ASDCP-CPL-20040511#" CompositionPlaylistNamespaceSMPTE = "http://www.smpte-ra.org/schemas/429-7/2006/CPL" )
View Source
const ( PackingListNamespaceIOP = "http://www.digicine.com/PROTO-ASDCP-PKL-20040311#" PackingListNamespaceSMPTE = "http://www.smpte-ra.org/schemas/429-8/2007/PKL" )
View Source
const ( SubtitleEffectNone = SubtitleEffect(iota) SubtitleEffectBorder SubtitleEffectShadow )
View Source
const ( SubtitleAlignmentBottomLeft = SubtitleAlignment(iota) SubtitleAlignmentBottomCenter SubtitleAlignmentBottomRight SubtitleAlignmentCenterLeft SubtitleAlignmentCenterCenter SubtitleAlignmentCenterRight SubtitleAlignmentTopLeft SubtitleAlignmentTopCenter SubtitleAlignmentTopRight )
View Source
const ( SubtitleDirectionHorizontal = SubtitleDirection(iota) SubtitleDirectionVertical )
View Source
const ( VolumeIndexNamespaceIOP = "http://www.digicine.com/PROTO-ASDCP-VL-20040311#" VolumeIndexNamespaceSMPTE = "http://www.smpte-ra.org/schemas/429-9/2007/AM" )
Variables ¶
View Source
var DefaultSubtitleFont = SubtitleFont{ Color: color.RGBA{ R: 0xFF, G: 0xFF, B: 0xFF, A: 0xFF, }, Size: 42, Effect: SubtitleEffectNone, EffectColor: color.RGBA{ R: 0xFF, G: 0x00, B: 0x00, A: 0xFF, }, AspectRatio: 1, Italic: false, Bold: false, Underline: false, Spacing: 0, }
Functions ¶
This section is empty.
Types ¶
type AssetMap ¶
type AssetMap struct { XMLName xml.Name Id string `xml:"Id"` AnnotationText string `xml:"AnnotationText"` VolumeCount int `xml:"VolumeCount,omitempty"` IssueDate string `xml:"IssueDate"` Issuer string `xml:"Issuer"` Creator string `xml:"Creator"` Assets []AssetMapEntry `xml:"AssetList>Asset"` }
func (AssetMap) GetPackingLists ¶
func (am AssetMap) GetPackingLists() (result []AssetMapEntry)
type AssetMapChunk ¶
type AssetMapEntry ¶
type AssetMapEntry struct { Id string `xml:"Id"` PackingList *string `xml:"PackingList"` Chunks []AssetMapChunk `xml:"ChunkList>Chunk"` }
func (AssetMapEntry) IsPackingList ¶
func (e AssetMapEntry) IsPackingList() bool
type CompositionMetadataAsset ¶
type CompositionMetadataAsset struct { XMLName xml.Name `xml:"CompositionMetadataAsset"` FullContentTitleText string `xml:"FullContentTitleText,omitempty"` ReleaseTerritory string `xml:"ReleaseTerritory,omitempty"` Distributor string `xml:"Distributor,omitempty"` Facility string `xml:"Facility,omitempty"` Luminance *Luminance `xml:"Luminance,omitempty"` MainSoundConfiguration string `xml:"MainSoundConfiguration,omitempty"` MainSoundSampleRate string `xml:"MainSoundSampleRate,omitempty"` MainPictureStoredArea struct { Width int `xml:"Width"` Height int `xml:"Height"` } `xml:"MainPictureStoredArea"` MainPictureActiveArea struct { Width int `xml:"Width"` Height int `xml:"Height"` } `xml:"MainPictureActiveArea"` MainSubtitleLanguageList string `xml:"MainSubtitleLanguageList,omitempty"` }
type CompositionPlaylist ¶
type CompositionPlaylist struct { XMLName xml.Name `xml:"CompositionPlaylist"` Id string `xml:"Id"` AnnotationText string `xml:"AnnotationText"` IssueDate string `xml:"IssueDate"` Issuer string `xml:"Issuer"` Creator string `xml:"Creator"` ContentTitleText string `xml:"ContentTitleText,omitempty"` ContentKind string `xml:"ContentKind"` RatingList []any `xml:"RatingList>Rating"` Reels []Reel `xml:"ReelList>Reel"` Signer any `xml:"Signer"` }
func (CompositionPlaylist) IsIOP ¶
func (cpl CompositionPlaylist) IsIOP() bool
func (CompositionPlaylist) IsSMPTE ¶
func (cpl CompositionPlaylist) IsSMPTE() bool
type DCP ¶
type DCP struct { Path string AssetMapFile string AssetMap AssetMap // contains filtered or unexported fields }
func Open ¶
Open Opens a DCP. Provide path to its directory or its ASSETMAP file, which can also be an URL
func (*DCP) GetAbsoluteAssetPath ¶
func (*DCP) GetAssetPaths ¶
func (*DCP) GetCompositionPlaylist ¶
func (dcp *DCP) GetCompositionPlaylist(id string) (cpl CompositionPlaylist, err error)
func (*DCP) GetDCSubtitle ¶
func (dcp *DCP) GetDCSubtitle(id string) (sub *DCSubtitle, err error)
func (*DCP) GetPackingList ¶
func (dcp *DCP) GetPackingList(id string) (pkl PackingList, err error)
func (*DCP) GetPackingLists ¶
func (dcp *DCP) GetPackingLists() (pkls []PackingList, err error)
type DCSubtitle ¶
type DCSubtitle struct { XMLName xml.Name `xml:"DCSubtitle"` SubtitleId string `xml:"SubtitleID"` MovieTitle string `xml:"MovieTitle,omitempty"` ReelNumber int `xml:"ReelNumber"` Language string `xml:"Language,omitempty"` Offset string `xml:"Offset,attr,omitempty"` LoadFonts []DCSubtitleLoadFont `xml:"LoadFont"` Nodes []Node `xml:",any"` }
func (DCSubtitle) SubtitleEvents ¶
func (s DCSubtitle) SubtitleEvents() (events []SubtitleEvent, err error)
type DCSubtitleLoadFont ¶
type Luminance ¶
type Luminance struct { // Units can be foot-lambert or candela-per-square-metre // 1 foot-lambert = 3.426 candela-per-square-metre Units string `xml:"units,attr"` Value float64 `xml:",chardata"` }
Luminance The screen luminance at which the content was authored. see https://pub.smpte.org/latest/st429-16/index.html#sec-luminance
type Node ¶
type Node struct { XMLName xml.Name Attrs []xml.Attr `xml:",any,attr"` Content []byte `xml:",innerxml"` Nodes []Node `xml:",any"` }
func (*Node) UnmarshalXML ¶
type PackingList ¶
type PackingList struct { XMLName xml.Name `xml:"PackingList"` Id string `xml:"Id"` AnnotationText string `xml:"AnnotationText"` IssueDate string `xml:"IssueDate"` Issuer string `xml:"Issuer"` Creator string `xml:"Creator"` Assets []PackingListEntry `xml:"AssetList>Asset"` }
func (PackingList) GetCompositionPlaylists ¶
func (pkl PackingList) GetCompositionPlaylists(assetMapIdToAssetPath map[string]string) (result []PackingListEntry)
func (PackingList) IsIOP ¶
func (pkl PackingList) IsIOP() bool
func (PackingList) IsSMPTE ¶
func (pkl PackingList) IsSMPTE() bool
type PackingListEntry ¶
type PackingListEntry struct { Id string `xml:"Id"` Hash string `xml:"Hash"` Size int64 `xml:"Size"` Type string `xml:"Type"` OriginalFileName string `xml:"OriginalFileName,omitempty"` AnnotationText *string `xml:"AnnotationText,omitempty"` }
func (PackingListEntry) IsCompositionPlaylist ¶
func (e PackingListEntry) IsCompositionPlaylist(fallbackFileName string) bool
type Reel ¶
type Reel struct { Id string `xml:"Id"` MainPicture *ReelAsset `xml:"AssetList>MainPicture,omitempty"` MainSound *ReelAsset `xml:"AssetList>MainSound,omitempty"` MainSubtitle *ReelAsset `xml:"AssetList>MainSubtitle,omitempty"` ClosedCaption *ReelAsset `xml:"AssetList>ClosedCaption,omitempty"` MainClosedCaption *ReelAsset `xml:"AssetList>MainClosedCaption,omitempty"` MainMarker *ReelMarker `xml:"AssetList>MainMarker,omitempty"` CompositionMetadataAsset *CompositionMetadataAsset `xml:"AssetList>CompositionMetadataAsset,omitempty"` }
type ReelAsset ¶
type ReelAsset struct { XMLName xml.Name Id string `xml:"Id"` Hash string `xml:"Hash"` Language string `xml:"Language,omitempty"` KeyId string `xml:"KeyId,omitempty"` IntrinsicDuration int `xml:"IntrinsicDuration"` EntryPoint int `xml:"EntryPoint"` Duration int `xml:"Duration"` EditRate string `xml:"EditRate,omitempty"` FrameRate string `xml:"FrameRate,omitempty"` ScreenAspectRatio string `xml:"ScreenAspectRatio,omitempty"` Size int64 `xml:"Size"` Type string `xml:"Type"` OriginalFileName string `xml:"OriginalFileName,omitempty"` AnnotationText *string `xml:"AnnotationText,omitempty"` }
type ReelMarker ¶
type ReelMarker struct { Id string `xml:"Id"` IntrinsicDuration int `xml:"IntrinsicDuration"` EntryPoint int `xml:"EntryPoint"` Duration int `xml:"Duration"` EditRate string `xml:"EditRate,omitempty"` MarkerList []struct { Label string `xml:"Label"` Offset int `xml:"Offset"` } `xml:"MarkerList>Marker"` }
type SubtitleAlignment ¶
type SubtitleAlignment int
func SubtitleAlignmentFromVerticalHorizontal ¶
func SubtitleAlignmentFromVerticalHorizontal(v, h int) SubtitleAlignment
SubtitleAlignmentFromVerticalHorizontal v 0 = left, 1 = center, 2 = right h 0 = bottom, 1 = center, 2 = top
type SubtitleDirection ¶
type SubtitleDirection int
type SubtitleEffect ¶
type SubtitleEffect int
type SubtitleEvent ¶
type SubtitleEvent struct {
Start, End time.Duration
FadeIn, FadeOut time.Duration
Alignment SubtitleAlignment
Direction SubtitleDirection
// MarginRight MarginLeft MarginVertical float64 0-1 percentage of margin relative to width/height
MarginRight float64
MarginLeft float64
MarginVertical float64
Text []SubtitleText
}
type SubtitleFont ¶
type SubtitleText ¶
type SubtitleText struct { Font SubtitleFont Text string }
type VolumeIndex ¶
func (VolumeIndex) IsIOP ¶
func (vi VolumeIndex) IsIOP() bool
func (VolumeIndex) IsSMPTE ¶
func (vi VolumeIndex) IsSMPTE() bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.