dcpesses / node-dash-proxy Goto Github PK
View Code? Open in Web Editor NEWNode script to parse DASH manifests and download / mirror its segments
Node script to parse DASH manifests and download / mirror its segments
Unfortunately, when I tested it against DRM-encrypted streams generated or served from an Azure Media Server instance, I found the parser had a lot of trouble trying to download segments from each manifest. Additionally, I encountered similar errors when I tested it against non-encrypted AMS streams, but the number of errors were far fewer.
Sample log:
$ node ./dashproxy.js -v -o output-drm -d 'https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/manifest(format=mpd-time-csf)'
โ
[2017-03-16 15:28:59.730] [INFO] dash-proxy - Running dash proxy for stream https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/manifest(format=mpd-time-csf). Output goes in output-drm
[2017-03-16 15:28:59.881] [DEBUG] dash-proxy - Creating output directory
[2017-03-16 15:28:59.882] [DEBUG] dash-proxy - Saving source MPD file
[2017-03-16 15:28:59.905] [DEBUG] dash-proxy - mpd=<Element Period at 1>
[2017-03-16 15:28:59.905] [DEBUG] dash-proxy - Found 1 periods, choosing the 1st one
[2017-03-16 15:28:59.905] [DEBUG] dash-proxy - Found representation with id 1_V_video_1
[2017-03-16 15:28:59.905] [INFO] dash-proxy - Starting a downloader for Representation (period=0 adaptation-set=0 representation=0)
[2017-03-16 15:28:59.906] [DEBUG] dash-proxy - subdir = null
[2017-03-16 15:28:59.907] [DEBUG] dash-proxy - Created dir:
[2017-03-16 15:28:59.908] [DEBUG] dash-proxy - creating folder path output-drm/QualityLevels(3499855)/
[2017-03-16 15:28:59.908] [INFO] dash-proxy - requesting QualityLevels(3499855)/Fragments(video=i,format=mpd-time-csf)
[2017-03-16 15:28:59.910] [INFO] dash-proxy - requesting QualityLevels(3499855)/Fragments(video=,format=mpd-time-csf)
[2017-03-16 15:28:59.910] [INFO] dash-proxy - requesting QualityLevels(3499855)/Fragments(video=20000000,format=mpd-time-csf)
[2017-03-16 15:28:59.911] [DEBUG] dash-proxy - Found representation with id 1_V_video_2
[2017-03-16 15:28:59.911] [INFO] dash-proxy - Starting a downloader for Representation (period=0 adaptation-set=0 representation=1)
[2017-03-16 15:28:59.911] [DEBUG] dash-proxy - subdir = null
[2017-03-16 15:28:59.911] [DEBUG] dash-proxy - Created dir:
[2017-03-16 15:28:59.911] [DEBUG] dash-proxy - creating folder path output-drm/QualityLevels(1931720)/
[2017-03-16 15:28:59.911] [INFO] dash-proxy - requesting QualityLevels(1931720)/Fragments(video=i,format=mpd-time-csf)
[2017-03-16 15:28:59.912] [INFO] dash-proxy - requesting QualityLevels(1931720)/Fragments(video=,format=mpd-time-csf)
[2017-03-16 15:28:59.912] [INFO] dash-proxy - requesting QualityLevels(1931720)/Fragments(video=20000000,format=mpd-time-csf)
[2017-03-16 15:28:59.912] [DEBUG] dash-proxy - Found representation with id 1_V_video_3
[2017-03-16 15:28:59.912] [INFO] dash-proxy - Starting a downloader for Representation (period=0 adaptation-set=0 representation=2)
[2017-03-16 15:28:59.912] [DEBUG] dash-proxy - subdir = null
[2017-03-16 15:28:59.912] [DEBUG] dash-proxy - Created dir:
[2017-03-16 15:28:59.913] [DEBUG] dash-proxy - creating folder path output-drm/QualityLevels(1250700)/
[2017-03-16 15:28:59.913] [INFO] dash-proxy - requesting QualityLevels(1250700)/Fragments(video=i,format=mpd-time-csf)
[2017-03-16 15:28:59.913] [INFO] dash-proxy - requesting QualityLevels(1250700)/Fragments(video=,format=mpd-time-csf)
[2017-03-16 15:28:59.915] [INFO] dash-proxy - requesting QualityLevels(1250700)/Fragments(video=20000000,format=mpd-time-csf)
[2017-03-16 15:28:59.915] [DEBUG] dash-proxy - Found representation with id 1_V_video_4
[2017-03-16 15:28:59.915] [INFO] dash-proxy - Starting a downloader for Representation (period=0 adaptation-set=0 representation=3)
[2017-03-16 15:28:59.915] [DEBUG] dash-proxy - subdir = null
[2017-03-16 15:28:59.915] [DEBUG] dash-proxy - Created dir:
[2017-03-16 15:28:59.915] [DEBUG] dash-proxy - creating folder path output-drm/QualityLevels(804981)/
[2017-03-16 15:28:59.916] [INFO] dash-proxy - requesting QualityLevels(804981)/Fragments(video=i,format=mpd-time-csf)
[2017-03-16 15:28:59.916] [INFO] dash-proxy - requesting QualityLevels(804981)/Fragments(video=,format=mpd-time-csf)
[2017-03-16 15:28:59.916] [INFO] dash-proxy - requesting QualityLevels(804981)/Fragments(video=20000000,format=mpd-time-csf)
[2017-03-16 15:28:59.917] [DEBUG] dash-proxy - Found representation with id 1_V_video_5
[2017-03-16 15:28:59.917] [INFO] dash-proxy - Starting a downloader for Representation (period=0 adaptation-set=0 representation=4)
[2017-03-16 15:28:59.917] [DEBUG] dash-proxy - subdir = null
[2017-03-16 15:28:59.917] [DEBUG] dash-proxy - Created dir:
[2017-03-16 15:28:59.918] [DEBUG] dash-proxy - creating folder path output-drm/QualityLevels(353556)/
[2017-03-16 15:28:59.918] [INFO] dash-proxy - requesting QualityLevels(353556)/Fragments(video=i,format=mpd-time-csf)
[2017-03-16 15:28:59.919] [INFO] dash-proxy - requesting QualityLevels(353556)/Fragments(video=,format=mpd-time-csf)
[2017-03-16 15:28:59.919] [INFO] dash-proxy - requesting QualityLevels(353556)/Fragments(video=20000000,format=mpd-time-csf)
[2017-03-16 15:28:59.919] [DEBUG] dash-proxy - Found representation with id 5_A_aac_UND_2_63_1
[2017-03-16 15:28:59.919] [INFO] dash-proxy - Starting a downloader for Representation (period=0 adaptation-set=1 representation=0)
[2017-03-16 15:28:59.920] [DEBUG] dash-proxy - subdir = null
[2017-03-16 15:28:59.920] [DEBUG] dash-proxy - Created dir:
[2017-03-16 15:28:59.920] [DEBUG] dash-proxy - creating folder path output-drm/QualityLevels(63999)/
[2017-03-16 15:28:59.920] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=i,format=mpd-time-csf)
[2017-03-16 15:28:59.921] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=,format=mpd-time-csf)
[2017-03-16 15:28:59.921] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=20053333,format=mpd-time-csf)
[2017-03-16 15:28:59.921] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=40106667,format=mpd-time-csf)
[2017-03-16 15:28:59.921] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=60160000,format=mpd-time-csf)
[2017-03-16 15:28:59.921] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=80213334,format=mpd-time-csf)
[2017-03-16 15:28:59.922] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=100266667,format=mpd-time-csf)
[2017-03-16 15:28:59.922] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=120320001,format=mpd-time-csf)
[2017-03-16 15:28:59.922] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=140373334,format=mpd-time-csf)
[2017-03-16 15:28:59.923] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=160426668,format=mpd-time-csf)
[2017-03-16 15:28:59.923] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=180480001,format=mpd-time-csf)
[2017-03-16 15:28:59.923] [INFO] dash-proxy - requesting QualityLevels(63999)/Fragments(aac_UND_2_63=200533335,format=mpd-time-csf)
[2017-03-16 15:28:59.924] [INFO] dash-proxy - Writing the updated MPD file
[2017-03-16 15:28:59.926] [INFO] dash-proxy - VOD MPD. Nothing more to do. Stopping...
[2017-03-16 15:28:59.947] [INFO] dash-proxy - manifest.1.mpd saved.
[2017-03-16 15:28:59.947] [INFO] dash-proxy - Write operation complete.
[2017-03-16 15:29:00.024] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(63999)/Fragments(aac_UND_2_63=200533335,format=mpd-time-csf); server returned 404
[2017-03-16 15:29:00.035] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(63999)/Fragments(aac_UND_2_63=180480001,format=mpd-time-csf); server returned 404
[2017-03-16 15:29:00.036] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(3499855)/Fragments(video=,format=mpd-time-csf); server returned 400
[2017-03-16 15:29:00.037] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(1931720)/Fragments(video=,format=mpd-time-csf); server returned 400
[2017-03-16 15:29:00.037] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(804981)/Fragments(video=,format=mpd-time-csf); server returned 400
[2017-03-16 15:29:00.040] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(1250700)/Fragments(video=,format=mpd-time-csf); server returned 400
[2017-03-16 15:29:00.048] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(63999)/Fragments(aac_UND_2_63=140373334,format=mpd-time-csf); server returned 404
[2017-03-16 15:29:00.049] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(63999)/Fragments(aac_UND_2_63=100266667,format=mpd-time-csf); server returned 404
[2017-03-16 15:29:00.050] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(63999)/Fragments(aac_UND_2_63=160426668,format=mpd-time-csf); server returned 404
[2017-03-16 15:29:00.052] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(63999)/Fragments(aac_UND_2_63=,format=mpd-time-csf); server returned 400
[2017-03-16 15:29:00.052] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(63999)/Fragments(aac_UND_2_63=120320001,format=mpd-time-csf); server returned 404
[2017-03-16 15:29:00.057] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(353556)/Fragments(video=,format=mpd-time-csf); server returned 400
[2017-03-16 15:29:00.072] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(63999)/Fragments(aac_UND_2_63=40106667,format=mpd-time-csf); server returned 404
[2017-03-16 15:29:00.083] [ERROR] dash-proxy - cannot download https://drmencodingmediaserver.streaming.mediaservices.windows.net/22877e25-6501-4296-862a-84660d0fb84a/ba5f0d3a-b218-8c9d-0db1-91c27d99b499.ism/QualityLevels(63999)/Fragments(aac_UND_2_63=80213334,format=mpd-time-csf); server returned 404
[2017-03-16 15:29:00.104] [DEBUG] dash-proxy - Writing QualityLevels(353556)/Fragments(video=i,format=mpd-time-csf)
[2017-03-16 15:29:00.123] [DEBUG] dash-proxy - Writing QualityLevels(63999)/Fragments(aac_UND_2_63=i,format=mpd-time-csf)
[2017-03-16 15:29:00.130] [DEBUG] dash-proxy - Writing QualityLevels(63999)/Fragments(aac_UND_2_63=20053333,format=mpd-time-csf)
[2017-03-16 15:29:00.138] [DEBUG] dash-proxy - Writing QualityLevels(804981)/Fragments(video=i,format=mpd-time-csf)
[2017-03-16 15:29:00.148] [DEBUG] dash-proxy - Writing QualityLevels(63999)/Fragments(aac_UND_2_63=60160000,format=mpd-time-csf)
[2017-03-16 15:29:00.310] [DEBUG] dash-proxy - Writing QualityLevels(1931720)/Fragments(video=i,format=mpd-time-csf)
[2017-03-16 15:29:00.325] [DEBUG] dash-proxy - Writing QualityLevels(1250700)/Fragments(video=i,format=mpd-time-csf)
[2017-03-16 15:29:00.380] [DEBUG] dash-proxy - Writing QualityLevels(804981)/Fragments(video=20000000,format=mpd-time-csf)
[2017-03-16 15:29:00.467] [DEBUG] dash-proxy - Writing QualityLevels(3499855)/Fragments(video=i,format=mpd-time-csf)
[2017-03-16 15:29:00.502] [DEBUG] dash-proxy - Writing QualityLevels(353556)/Fragments(video=20000000,format=mpd-time-csf)
[2017-03-16 15:29:01.213] [DEBUG] dash-proxy - Writing QualityLevels(1250700)/Fragments(video=20000000,format=mpd-time-csf)
[2017-03-16 15:29:01.873] [DEBUG] dash-proxy - Writing QualityLevels(1931720)/Fragments(video=20000000,format=mpd-time-csf)
[2017-03-16 15:29:02.568] [DEBUG] dash-proxy - Writing QualityLevels(3499855)/Fragments(video=20000000,format=mpd-time-csf)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.