summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-mpegdash.spec286
-rw-r--r--sources1
3 files changed, 288 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..4767cdf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/mpegdash-0.3.1.tar.gz
diff --git a/python-mpegdash.spec b/python-mpegdash.spec
new file mode 100644
index 0000000..e29fe45
--- /dev/null
+++ b/python-mpegdash.spec
@@ -0,0 +1,286 @@
+%global _empty_manifest_terminate_build 0
+Name: python-mpegdash
+Version: 0.3.1
+Release: 1
+Summary: MPEG-DASH MPD(Media Presentation Description) Parser
+License: MIT
+URL: https://github.com/sangwonl/python-mpegdash
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0b/ef/da88735b0284b3dd0125ddb67048a7dfa54005da9e61afdc62b664e7571c/mpegdash-0.3.1.tar.gz
+BuildArch: noarch
+
+Requires: python3-future
+
+%description
+
+# python-mpegdash
+
+MPEG-DASH MPD (Media Presentation Description) Parser compatible with Python 2.6+ and Python 3.
+
+[![Build Status](https://img.shields.io/github/workflow/status/sangwonl/python-mpegdash/Build%20Status?label=Python%202.7%2B%20builds)](https://github.com/sangwonl/python-mpegdash/actions?query=workflow%3A%22Build+Status%22)
+[![License](https://img.shields.io/github/license/sangwonl/python-mpegdash?style=flat)](https://github.com/sangwonl/python-mpegdash/blob/master/LICENSE)
+
+* * *
+
+## Installation
+
+```bash
+$ pip install mpegdash
+```
+
+* * *
+
+## Test
+
+```bash
+$ python -m unittest discover
+$ python3 -m unittest discover
+```
+
+* * *
+
+## Usage
+
+```py
+from mpegdash.parser import MPEGDASHParser
+
+# Parse from file path
+mpd_path = './tests/mpd-samples/sample-001.mpd'
+mpd = MPEGDASHParser.parse(mpd_path)
+
+# Parse from url
+mpd_url = 'http://yt-dash-mse-test.commondatastorage.googleapis.com/media/motion-20120802-manifest.mpd'
+mpd = MPEGDASHParser.parse(mpd_url)
+
+# Parse from string
+mpd_string = '''
+<MPD xmlns="urn:mpeg:DASH:schema:MPD:2011" mediaPresentationDuration="PT0H1M52.43S" minBufferTime="PT1.5S"
+profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" type="static">
+ <Period duration="PT0H1M52.43S" start="PT0S">
+ <AdaptationSet>
+ <ContentComponent contentType="video" id="1" />
+ <Representation bandwidth="4190760" codecs="avc1.640028" height="1080" id="1" mimeType="video/mp4" width="1920">
+ <BaseURL>motion-20120802-89.mp4</BaseURL>
+ <SegmentBase indexRange="674-981">
+ <Initialization range="0-673" />
+ </SegmentBase>
+ </Representation>
+ </AdaptationSet>
+ </Period>
+</MPD>
+'''
+mpd = MPEGDASHParser.parse(mpd_string)
+
+# Write to xml file
+MPEGDASHParser.write(mpd, './tests/mpd-samples/output.mpd')
+```
+
+* * *
+
+## License
+
+This project is released under the MIT license.
+Please read and agree to the license before use, it can be found in the [LICENSE](LICENSE) file.
+
+
+
+
+%package -n python3-mpegdash
+Summary: MPEG-DASH MPD(Media Presentation Description) Parser
+Provides: python-mpegdash
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-mpegdash
+
+# python-mpegdash
+
+MPEG-DASH MPD (Media Presentation Description) Parser compatible with Python 2.6+ and Python 3.
+
+[![Build Status](https://img.shields.io/github/workflow/status/sangwonl/python-mpegdash/Build%20Status?label=Python%202.7%2B%20builds)](https://github.com/sangwonl/python-mpegdash/actions?query=workflow%3A%22Build+Status%22)
+[![License](https://img.shields.io/github/license/sangwonl/python-mpegdash?style=flat)](https://github.com/sangwonl/python-mpegdash/blob/master/LICENSE)
+
+* * *
+
+## Installation
+
+```bash
+$ pip install mpegdash
+```
+
+* * *
+
+## Test
+
+```bash
+$ python -m unittest discover
+$ python3 -m unittest discover
+```
+
+* * *
+
+## Usage
+
+```py
+from mpegdash.parser import MPEGDASHParser
+
+# Parse from file path
+mpd_path = './tests/mpd-samples/sample-001.mpd'
+mpd = MPEGDASHParser.parse(mpd_path)
+
+# Parse from url
+mpd_url = 'http://yt-dash-mse-test.commondatastorage.googleapis.com/media/motion-20120802-manifest.mpd'
+mpd = MPEGDASHParser.parse(mpd_url)
+
+# Parse from string
+mpd_string = '''
+<MPD xmlns="urn:mpeg:DASH:schema:MPD:2011" mediaPresentationDuration="PT0H1M52.43S" minBufferTime="PT1.5S"
+profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" type="static">
+ <Period duration="PT0H1M52.43S" start="PT0S">
+ <AdaptationSet>
+ <ContentComponent contentType="video" id="1" />
+ <Representation bandwidth="4190760" codecs="avc1.640028" height="1080" id="1" mimeType="video/mp4" width="1920">
+ <BaseURL>motion-20120802-89.mp4</BaseURL>
+ <SegmentBase indexRange="674-981">
+ <Initialization range="0-673" />
+ </SegmentBase>
+ </Representation>
+ </AdaptationSet>
+ </Period>
+</MPD>
+'''
+mpd = MPEGDASHParser.parse(mpd_string)
+
+# Write to xml file
+MPEGDASHParser.write(mpd, './tests/mpd-samples/output.mpd')
+```
+
+* * *
+
+## License
+
+This project is released under the MIT license.
+Please read and agree to the license before use, it can be found in the [LICENSE](LICENSE) file.
+
+
+
+
+%package help
+Summary: Development documents and examples for mpegdash
+Provides: python3-mpegdash-doc
+%description help
+
+# python-mpegdash
+
+MPEG-DASH MPD (Media Presentation Description) Parser compatible with Python 2.6+ and Python 3.
+
+[![Build Status](https://img.shields.io/github/workflow/status/sangwonl/python-mpegdash/Build%20Status?label=Python%202.7%2B%20builds)](https://github.com/sangwonl/python-mpegdash/actions?query=workflow%3A%22Build+Status%22)
+[![License](https://img.shields.io/github/license/sangwonl/python-mpegdash?style=flat)](https://github.com/sangwonl/python-mpegdash/blob/master/LICENSE)
+
+* * *
+
+## Installation
+
+```bash
+$ pip install mpegdash
+```
+
+* * *
+
+## Test
+
+```bash
+$ python -m unittest discover
+$ python3 -m unittest discover
+```
+
+* * *
+
+## Usage
+
+```py
+from mpegdash.parser import MPEGDASHParser
+
+# Parse from file path
+mpd_path = './tests/mpd-samples/sample-001.mpd'
+mpd = MPEGDASHParser.parse(mpd_path)
+
+# Parse from url
+mpd_url = 'http://yt-dash-mse-test.commondatastorage.googleapis.com/media/motion-20120802-manifest.mpd'
+mpd = MPEGDASHParser.parse(mpd_url)
+
+# Parse from string
+mpd_string = '''
+<MPD xmlns="urn:mpeg:DASH:schema:MPD:2011" mediaPresentationDuration="PT0H1M52.43S" minBufferTime="PT1.5S"
+profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" type="static">
+ <Period duration="PT0H1M52.43S" start="PT0S">
+ <AdaptationSet>
+ <ContentComponent contentType="video" id="1" />
+ <Representation bandwidth="4190760" codecs="avc1.640028" height="1080" id="1" mimeType="video/mp4" width="1920">
+ <BaseURL>motion-20120802-89.mp4</BaseURL>
+ <SegmentBase indexRange="674-981">
+ <Initialization range="0-673" />
+ </SegmentBase>
+ </Representation>
+ </AdaptationSet>
+ </Period>
+</MPD>
+'''
+mpd = MPEGDASHParser.parse(mpd_string)
+
+# Write to xml file
+MPEGDASHParser.write(mpd, './tests/mpd-samples/output.mpd')
+```
+
+* * *
+
+## License
+
+This project is released under the MIT license.
+Please read and agree to the license before use, it can be found in the [LICENSE](LICENSE) file.
+
+
+
+
+%prep
+%autosetup -n mpegdash-0.3.1
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-mpegdash -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 0.3.1-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..dfda84c
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+0c74a908536264a28380ec8a56267b89 mpegdash-0.3.1.tar.gz