mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-07-22 22:40:47 -04:00
test a real-ish mpd
This commit is contained in:
parent
e8fdf84db8
commit
133726e942
8 changed files with 71 additions and 3 deletions
Binary file not shown.
|
@ -7,10 +7,12 @@
|
||||||
videos are from
|
videos are from
|
||||||
http://techslides.com/sample-webm-ogg-and-mp4-video-files-for-html5
|
http://techslides.com/sample-webm-ogg-and-mp4-video-files-for-html5
|
||||||
-->
|
-->
|
||||||
<video autoplay="" muted="" id="bgvid" loop="">
|
<video autoplay="" muted="" id="vid1" loop="">
|
||||||
<source src="small.webm" type="video/webm">
|
<source src="small.webm" type="video/webm">
|
||||||
<source src="small.mp4" type="video/mp4">
|
<source src="small.mp4" type="video/mp4">
|
||||||
<source src="1880000" type="video/vnd.mpeg.dash.mpd">
|
</video>
|
||||||
|
<video autoplay="" muted="" id="vid2" loop="">
|
||||||
|
<source src="small.mpd">
|
||||||
</video>
|
</video>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
13
tests/htdocs/site6/readme-mpd.md
Normal file
13
tests/htdocs/site6/readme-mpd.md
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Steps taken to create DASH.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ brew reinstall -v ffmpeg --with-libvpx
|
||||||
|
$ ffmpeg -i small.webm -c:v vp9 -f webm -dash 1 -an -vf scale=280:160 -b:v 100k -dash 1 small-video_280x160_100k.webm
|
||||||
|
$ ffmpeg -i small.webm -c:v vp9 -f webm -dash 1 -an -vf scale=140:80 -b:v 25k -dash 1 small-video_140x80_25k.webm
|
||||||
|
$ ffmpeg -i small.webm -acodec copy -vn -dash 1 small-audio.webm
|
||||||
|
$ ffmpeg -f webm_dash_manifest -i small-video_280x160_100k.webm -f webm_dash_manifest -i small-video_140x80_25k.webm -f webm_dash_manifest -i small-audio.webm -c copy -map 0 -map 1 -map 2 -f webm_dash_manifest -adaptation_sets "id=0,streams=0,1 id=1,streams=2" small.mpd
|
||||||
|
```
|
||||||
|
|
||||||
|
Don't know if the output is really correct, but youtube-dl downloads the
|
||||||
|
small.mpd, small-audio.web and small-video_280x160_100k.webm. Browser doesn't
|
||||||
|
download anything though, not even small.mpd.
|
BIN
tests/htdocs/site6/small-audio.webm
Normal file
BIN
tests/htdocs/site6/small-audio.webm
Normal file
Binary file not shown.
BIN
tests/htdocs/site6/small-video_140x80_25k.webm
Normal file
BIN
tests/htdocs/site6/small-video_140x80_25k.webm
Normal file
Binary file not shown.
BIN
tests/htdocs/site6/small-video_280x160_100k.webm
Normal file
BIN
tests/htdocs/site6/small-video_280x160_100k.webm
Normal file
Binary file not shown.
34
tests/htdocs/site6/small.mpd
Normal file
34
tests/htdocs/site6/small.mpd
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<MPD
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="urn:mpeg:DASH:schema:MPD:2011"
|
||||||
|
xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011"
|
||||||
|
type="static"
|
||||||
|
mediaPresentationDuration="PT5.58S"
|
||||||
|
minBufferTime="PT1S"
|
||||||
|
profiles="urn:webm:dash:profile:webm-on-demand:2012">
|
||||||
|
<Period id="0" start="PT0S" duration="PT5.58S" >
|
||||||
|
<AdaptationSet id="0" mimeType="video/webm" codecs="vp9" bitstreamSwitching="true" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||||
|
<Representation id="0" bandwidth="110196" width="280" height="160">
|
||||||
|
<BaseURL>small-video_280x160_100k.webm</BaseURL>
|
||||||
|
<SegmentBase indexRange="92680-92727">
|
||||||
|
<Initialization range="0-628" />
|
||||||
|
</SegmentBase>
|
||||||
|
</Representation>
|
||||||
|
<Representation id="1" bandwidth="33389" width="140" height="80">
|
||||||
|
<BaseURL>small-video_140x80_25k.webm</BaseURL>
|
||||||
|
<SegmentBase indexRange="28316-28362">
|
||||||
|
<Initialization range="0-627" />
|
||||||
|
</SegmentBase>
|
||||||
|
</Representation>
|
||||||
|
</AdaptationSet>
|
||||||
|
<AdaptationSet id="1" mimeType="audio/webm" codecs="vorbis" lang="eng" audioSamplingRate="48000" bitstreamSwitching="true" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
|
||||||
|
<Representation id="2" bandwidth="113515">
|
||||||
|
<BaseURL>small-audio.webm</BaseURL>
|
||||||
|
<SegmentBase indexRange="101066-101113">
|
||||||
|
<Initialization range="0-4714" />
|
||||||
|
</SegmentBase>
|
||||||
|
</Representation>
|
||||||
|
</AdaptationSet>
|
||||||
|
</Period>
|
||||||
|
</MPD>
|
|
@ -48,6 +48,10 @@ WARCPROX_META_420 = {
|
||||||
@pytest.fixture(scope='module')
|
@pytest.fixture(scope='module')
|
||||||
def httpd(request):
|
def httpd(request):
|
||||||
class RequestHandler(http.server.SimpleHTTPRequestHandler):
|
class RequestHandler(http.server.SimpleHTTPRequestHandler):
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
self.extensions_map['.mpd'] = 'video/vnd.mpeg.dash.mpd'
|
||||||
|
http.server.SimpleHTTPRequestHandler.__init__(self, *args, **kwargs)
|
||||||
|
|
||||||
def do_GET(self):
|
def do_GET(self):
|
||||||
if self.path == '/420':
|
if self.path == '/420':
|
||||||
self.send_response(420, 'Reached limit')
|
self.send_response(420, 'Reached limit')
|
||||||
|
@ -59,6 +63,7 @@ def httpd(request):
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write(payload)
|
self.wfile.write(payload)
|
||||||
else:
|
else:
|
||||||
|
import pdb; pdb.set_trace()
|
||||||
super().do_GET()
|
super().do_GET()
|
||||||
|
|
||||||
# SimpleHTTPRequestHandler always uses CWD so we have to chdir
|
# SimpleHTTPRequestHandler always uses CWD so we have to chdir
|
||||||
|
@ -155,7 +160,7 @@ def test_page_videos(httpd):
|
||||||
with brozzler.Browser(chrome_exe=chrome_exe) as browser:
|
with brozzler.Browser(chrome_exe=chrome_exe) as browser:
|
||||||
worker.brozzle_page(browser, site, page)
|
worker.brozzle_page(browser, site, page)
|
||||||
assert page.videos
|
assert page.videos
|
||||||
assert len(page.videos) == 2
|
assert len(page.videos) == 4
|
||||||
assert page.videos[0] == {
|
assert page.videos[0] == {
|
||||||
'blame': 'youtube-dl',
|
'blame': 'youtube-dl',
|
||||||
'response_code': 200,
|
'response_code': 200,
|
||||||
|
@ -164,6 +169,20 @@ def test_page_videos(httpd):
|
||||||
'url': 'http://localhost:%s/site6/small.mp4' % httpd.server_port,
|
'url': 'http://localhost:%s/site6/small.mp4' % httpd.server_port,
|
||||||
}
|
}
|
||||||
assert page.videos[1] == {
|
assert page.videos[1] == {
|
||||||
|
'blame': 'youtube-dl',
|
||||||
|
'content-length': 92728,
|
||||||
|
'content-type': 'video/webm',
|
||||||
|
'response_code': 200,
|
||||||
|
'url': 'http://localhost:%s/site6/small-video_280x160_100k.webm' % httpd.server_port
|
||||||
|
}
|
||||||
|
assert page.videos[2] == {
|
||||||
|
'blame': 'youtube-dl',
|
||||||
|
'content-length': 101114,
|
||||||
|
'content-type': 'video/webm',
|
||||||
|
'response_code': 200,
|
||||||
|
'url': 'http://localhost:%s/site6/small-audio.webm' % httpd.server_port
|
||||||
|
}
|
||||||
|
assert page.videos[3] == {
|
||||||
'blame': 'browser',
|
'blame': 'browser',
|
||||||
# 'response_code': 206,
|
# 'response_code': 206,
|
||||||
# 'content-range': 'bytes 0-229454/229455',
|
# 'content-range': 'bytes 0-229454/229455',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue