Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions DASH-MPD.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
<xs:element name="SupplementalProperty" type="DescriptorType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="UTCTiming" type="DescriptorType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="LeapSecondInformation" type="LeapSecondInformationType" minOccurs="0"/>
<xs:element name="ContentSteering" type="ContentSteeringType" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string"/>
Expand Down Expand Up @@ -185,6 +186,7 @@
<xs:attribute name="start" type="xs:duration"/>
<xs:attribute name="duration" type="xs:duration"/>
<xs:attribute name="bitstreamSwitching" type="xs:boolean" default="false"/>
<xs:attribute name="minBufferTime" type="xs:duration"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:complexType name="ImportedMpdType">
Expand Down Expand Up @@ -1189,7 +1191,7 @@
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="SupplementalProperty" type="DescriptorType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="url" type="xs:anyURI" use="required"/>
<xs:attribute name="uri" type="xs:anyURI" use="required"/>
<xs:attribute name="earliestResolutionTimeOffset" type="xs:double" default="60.0"/>
<xs:attribute name="maxDuration" type="xs:unsignedLong" default="2251799813685247"/>
<xs:attribute name="executeOnce" type="xs:boolean" default="false"/>
Expand All @@ -1205,7 +1207,7 @@
<xs:extension base="AlternativeMPDEventType">
<xs:attribute name="returnOffset" type="xs:unsignedLong"/>
<xs:attribute name="clip" type="xs:boolean" default="true"/>
<xs:attribute name="startAtOffset" type="xs:boolean" default="false"/>
<xs:attribute name="startWithOffset" type="xs:boolean" default="false"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Expand Down
215 changes: 215 additions & 0 deletions DASH.abnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
; =============================================================================
; DASH-MPD-values.abnf
;
; Combined ABNF definitions for ISO/IEC 23009-1:2026 (DASH 6th Edition)
; Companion file to DASH-MPD.xsd for automated MPD value validation.
;
; External rules referenced but defined elsewhere:
; host, port - IETF RFC 3986 (as augmented by RFC 6874)
; http-URI, https-URI - IETF RFC 9110 Section 4.2
; =============================================================================


; =============================================================================
; 5.3.11.2 - Preselection Descriptor
; Scheme: urn:mpeg:dash:preselection:2016
; =============================================================================

PRESELECTION-DESCRIPTOR-VALUE = TAG-VALUE "," ID-LIST

ID-LIST = ID-VALUE *( WHITESPACE ID-VALUE )

TAG-VALUE = STRING

ID-VALUE = 1*DIGIT

WHITESPACE = 1*WSP


; =============================================================================
; 5.8.5.2 - MP4 Protection
; Scheme: urn:mpeg:dash:mp4protection:2011
; =============================================================================

MP4-PROTECTION-VALUE = VERSIONED-4CC

VERSIONED-4CC = CCCC [ CCCC-VERSION ]

CCCC = ALPHA ALPHA ALPHA ALPHA

CCCC-VERSION = ":" 1*8HEXDIG


; =============================================================================
; 5.8.5.3 - CA_descriptor
; Scheme: urn:mpeg:dash:13818:1:CA_descriptor:2011
; =============================================================================

CA-DESCRIPTOR-VALUE = LHEX LHEX LHEX LHEX

LHEX = DIGIT / "a" / "b" / "c" / "d" / "e" / "f"


; =============================================================================
; 5.8.5.4 - Frame Packing
; Scheme: urn:mpeg:dash:14496:10:frame_packing_arrangement_type:2011
; urn:mpeg:dash:13818:1:stereo_video_format_type:2011
; =============================================================================

FRAME-PACKING-ARRANGEMENT-TYPE-VALUE = VIDEO-FRAME-PACKING-TYPE

STEREO-VIDEO-FORMAT-TYPE = VIDEO-FRAME-PACKING-TYPE

VIDEO-FRAME-PACKING-TYPE = 1*2DIGIT


; =============================================================================
; 5.8.5.6 - DASH Role Scheme
; Scheme: urn:mpeg:dash:role:2011
; =============================================================================

ROLE-VALUE = "caption" / "subtitle" / "main" / "alternate"
/ "supplementary"
ROLE-VALUE =/ "commentary" / "dub" / "description" / "sign"
/ "metadata"
ROLE-VALUE =/ "enhanced-audio-intelligibility" / "emergency"
ROLE-VALUE =/ "forced-subtitle" / "easyreader" / "karaoke"


; =============================================================================
; 5.8.5.7 - DASH Multiple Views Scheme (Stereo ID)
; Scheme: urn:mpeg:dash:stereoid:2011
; =============================================================================

STEROID-VALUE = VIEW-INDICATOR *( SP VIEW-INDICATOR )
VIEW-INDICATOR = ("l"/"r") 1*DIGIT


; =============================================================================
; 5.8.5.8 - DASH UTC Timing Schemes
; =============================================================================

; --- urn:mpeg:dash:utc:ntp:2014 / urn:mpeg:dash:utc:sntp:2014 ---

NTP-VALUE = TIME-SERVER *( WS TIME-SERVER )

TIME-SERVER = host [ ":" port ]
; host and port per IETF RFC 3986 / RFC 6874

; --- urn:mpeg:dash:utc:http-head:2014
; urn:mpeg:dash:utc:http-xsdate:2014
; urn:mpeg:dash:utc:http-iso:2014
; urn:mpeg:dash:utc:http-ntp:2014 ---

HTTP-VALUE = httpurl *( WS httpurl )
; httpurl = http-URI / https-URI per IETF RFC 9110

; --- urn:mpeg:dash:utc:direct:2014 ---

DIRECT-VALUE = [ "-" ] 4DIGIT "-" 2DIGIT "-" 2DIGIT
"T" 2DIGIT ":" 2DIGIT ":" 2DIGIT ["." 1*DIGIT]
[ "Z" / ( "+" / "-" ) 2DIGIT ":" 2DIGIT ]


; =============================================================================
; 5.8.5.9 - Audio Receiver Mix
; Scheme: urn:mpeg:dash:audio-receiver-mix:2014
; =============================================================================

AUDIO-RECEIVER-MIX-VALUE = ADAPTATION-SET-ID

ADAPTATION-SET-ID = DECIMAL-DIGITS


; =============================================================================
; 5.8.5.10 - MPD Adaptation Set Linking
; Scheme: urn:mpeg:dash:mpd-as-linking:2015
; =============================================================================

MPD-AS-LINKING-VALUE = MPD-URL [ WSP TIMELINE-OFFSET ]

MPD-URL = httpurl
; http-URI / https-URI per IETF RFC 9110

TIMELINE-OFFSET = "timeOffset=" [ "-" ] DECIMAL-DIGITS


; =============================================================================
; 5.8.5.11 - Sub-Asset Identifier
; Scheme: urn:mpeg:dash:sai:2015
; =============================================================================

SAI-VALUE = *VCHAR


; =============================================================================
; 5.8.5.13 - Quality Ranking Equivalence
; Scheme: urn:mpeg:dash:qr-equivalence:2018
; =============================================================================

QR-EQUIVALENCE-VALUE = AS-ID *( WSP AS-ID )

AS-ID = DECIMAL-DIGITS


; =============================================================================
; 5.8.7 - Supplementary Video (VVC picture-in-picture)
; SupVideoInfo@processingInfo value syntax
; =============================================================================

processingInfo = dataUnitsReplaceable 1*( SP regionId )

dataUnitsReplaceable = "0" / "1"

regionId = 1*DIGIT



; =============================================================================
; Annex H.2.3 - Static Spatial Relationship Description (SRD)
; Scheme: urn:mpeg:dash:srd:2014
; =============================================================================

STATIC-SRD-VALUE = source-id "," object-x "," object-y ","
object-width "," object-height
[ "," total-width
[ "," total-height
[ "," spatial-set-id ] ] ]

source-id = DECIMAL-DIGITS
spatial-set-id = DECIMAL-DIGITS
object-x = DECIMAL-DIGITS
object-y = DECIMAL-DIGITS
object-width = DECIMAL-DIGITS
object-height = DECIMAL-DIGITS
total-width = DECIMAL-DIGITS
total-height = DECIMAL-DIGITS


; =============================================================================
; Annex H.2.4 - Dynamic Spatial Relationship Description (SRD)
; Scheme: urn:mpeg:dash:srd:dynamic:2016
; =============================================================================

DYNAMIC-SRD-VALUE = source-id "," coordinate-id [ "," spatial-set-id ]

coordinate-id = STRING


; =============================================================================
; Shared terminal rules
; =============================================================================

DECIMAL-DIGITS = 1*DIGIT

STRING = *VCHAR

; WS is used in the spec as an alias for whitespace between tokens
WS = 1*WSP

; httpurl is a placeholder for http-URI / https-URI from RFC 9110
; Parsers should accept both schemes.
; httpurl = http-URI / https-URI ; defined in IETF RFC 9110 sec. 4.2

; HEXDIG is already defined in RFC 5234 core rules.
; LHEX is the lowercase-only subset used by the CA_descriptor scheme.
2 changes: 1 addition & 1 deletion example_G23.mpd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<BaseURL>http://liveserver.com/live/live1/</BaseURL>
<EventStream timescale="90000" schemeIdUri="urn:mpeg:dash:event:alternativeMPD:replace:2025">
<Event presentationTime="0" duration="2838240000000000" id="42">
<ReplacePresentation url="http://cdn1.example.com/preroll.mpd" maxDuration="1350000" clip="false" executeOnce="true"/>
<ReplacePresentation uri="http://cdn1.example.com/preroll.mpd" maxDuration="1350000" clip="false" executeOnce="true"/>
</Event>
</EventStream>
<AdaptationSet contentType="video" maxHeight="1920" maxWidth="1080" mimeType="video/mp4" par="16:9" segmentAlignment="true" startWithSAP="1">
Expand Down
4 changes: 2 additions & 2 deletions example_G29-1.mpd
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:advanced-linear:2025" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" type="dynamic" minimumUpdatePeriod="PT2S" timeShiftBufferDepth="PT30M" minBufferTime="PT4S" availabilityStartTime="2023-12-25T12:30:00" publishTime="2023-12-25T12:30:00">
<BaseURL>http://cdn1.example.com/</BaseURL>
<Period id="1">
<EventStream timescale="90000" schemeIdUri="urn:mpeg:dash:event:alternativeMPD:replace:2025">
<Event presentationTime="3780000" duration="1350000" id="42">
<ReplacePresentation url="http://cdn1.example.com/ad1.mpd?dur=15" earliestResolutionTimeOffset="378000" maxDuration="1350000" clip="true" executeOnce="true" noJump="2"/>
<ReplacePresentation uri="http://cdn1.example.com/ad1.mpd?dur=15" earliestResolutionTimeOffset="378000" maxDuration="1350000" clip="true" executeOnce="true" noJump="2"/>
</Event>
<RequestParam includeInRequests="altmpd" queryTemplate="prta=$urn:mpeg:dash:state:execution-delta#42$"/>
</EventStream>
Expand Down
38 changes: 38 additions & 0 deletions xml2rtf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# Check if an input file is provided
if [ -z "$1" ]; then
echo "Usage: ./xml2rtf.sh <input_file.xml>"
exit 1
fi

INPUT_FILE="$1"
# Create an output filename (e.g., data.xml -> data.rtf)
OUTPUT_FILE="${INPUT_FILE%.*}.rtf"

# Check if 'highlight' is installed
if ! command -v highlight &> /dev/null; then
echo "Error: 'highlight' is not installed."
echo "Please run: brew install highlight"
exit 1
fi

echo "Converting $INPUT_FILE to $OUTPUT_FILE..."

# 1. xmllint --format: Indents and pretty-prints the XML
# 2. highlight: Converts to RTF with B&W styling
# --syntax=xml: Tells the tool it is processing XML
# --out-format=rtf: Sets output to Rich Text
# --style=bw: Uses the built-in Black & White theme (Bold/Italic only)
# --font="Courier New": Sets a monospaced font
# --font-size=24: Sets font size (approx 12pt in RTF context)

xmllint --format "$INPUT_FILE" | \
highlight --syntax=xml \
--out-format=rtf \
--style=print \
--font="Courier New" \
--font-size=9 \
> "$OUTPUT_FILE"

echo "Done! Saved to $OUTPUT_FILE"
Loading