如何从网页中提取.mpd文件?

问题描述 投票:0回答:1

我想在 VLC Player 中从网页观看 MPEG-DASH 视频。 为此,我需要获取 .mpd 文件(视频清单)。 我从网页(使用浏览器)提取它,但 VLC Player 无法播放该文件。 可能只是格式错误(参见下面的示例)?

我也尝试使用yt-dlp(以前的youtube-dl),但我不明白如何使用这个库获取.mpd文件。 yt-dlp可以下载视频,但我不需要下载它,我只需要获取.mpd文件(在VLC播放器中在线观看)。

示例:

网页: https://yandex.ru/video/preview/1321722922811280403

MPEG-DASH 清单的

url(我从网页中提取): https://vkvd48.mycdn.me/?srcIp=50.7.93.29&pr=40&expires=1695518880837&srcAg=GECKO&fromCache=1&ms=45.136.22.138&type=4&sig=PK_HZnd5k5c&ct=6&urls=45.136.20。 205&clientType=13&appId=512000384397&zs=43&id=4838482053887&offset_p =0

MPEG-DASH 清单的响应:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><MPD xmlns="urn:mpeg:DASH:schema:MPD:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" mediaPresentationDuration="PT8900.900S" minBufferTime="PT0.5S" profiles="urn:webm:dash:profile:webm-on-demand:2012" type="static" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011"><Period duration="PT8900.900S" id="0" start="PT0S"><AdaptationSet bitstreamSwitching="true" codecs="vp9" id="0" maxFrameRate="30" maxHeight="1080" maxWidth="1920" mimeType="video/webm" subsegmentAlignment="true" subsegmentStartsWithSAP="1"><Representation bandwidth="196765" frameRate="30" height="240" id="0" quality="lowest" width="426"><BaseURL>?expires=1695518880837&amp;srcIp=50.7.93.29&amp;pr=40&amp;srcAg=GECKO&amp;ms=45.136.22.138&amp;type=0&amp;sig=PskRZY8L3a8&amp;ct=21&amp;urls=45.136.20.205&amp;clientType=13&amp;appId=512000384397&amp;zs=43&amp;id=4838482053887</BaseURL><SegmentBase indexRange="433-53602"><Initialization range="0-432"/></SegmentBase></Representation><Representation bandwidth="198464" frameRate="30" height="144" id="1" quality="mobile" width="256"><BaseURL>?expires=1695518880837&amp;srcIp=50.7.93.29&amp;pr=40&amp;srcAg=GECKO&amp;ms=45.136.22.138&amp;type=4&amp;sig=PK_HZnd5k5c&amp;ct=21&amp;urls=45.136.20.205&amp;clientType=13&amp;appId=512000384397&amp;zs=43&amp;id=4838482053887</BaseURL><SegmentBase indexRange="433-53668"><Initialization range="0-432"/></SegmentBase></Representation><Representation bandwidth="346644" frameRate="30" height="360" id="2" quality="low" width="640"><BaseURL>?expires=1695518880837&amp;srcIp=50.7.93.29&amp;pr=40&amp;srcAg=GECKO&amp;ms=45.136.22.138&amp;type=1&amp;sig=i1NgBlf1y1U&amp;ct=21&amp;urls=45.136.20.205&amp;clientType=13&amp;appId=512000384397&amp;zs=43&amp;id=4838482053887</BaseURL><SegmentBase indexRange="435-53697"><Initialization range="0-434"/></SegmentBase></Representation><Representation bandwidth="562487" frameRate="30" height="480" id="3" quality="sd" width="852"><BaseURL>?expires=1695518880837&amp;srcIp=50.7.93.29&amp;pr=40&amp;srcAg=GECKO&amp;ms=45.136.22.138&amp;type=2&amp;sig=Trv24x7An-A&amp;ct=21&amp;urls=45.136.20.205&amp;clientType=13&amp;appId=512000384397&amp;zs=43&amp;id=4838482053887</BaseURL><SegmentBase indexRange="435-53734"><Initialization range="0-434"/></SegmentBase></Representation><Representation bandwidth="1067086" frameRate="30" height="720" id="4" quality="hd" width="1280"><BaseURL>?expires=1695518880837&amp;srcIp=50.7.93.29&amp;pr=40&amp;srcAg=GECKO&amp;ms=45.136.22.138&amp;type=3&amp;sig=AvwzGZFjIDI&amp;ct=21&amp;urls=45.136.20.205&amp;clientType=13&amp;appId=512000384397&amp;zs=43&amp;id=4838482053887</BaseURL><SegmentBase indexRange="435-53776"><Initialization range="0-434"/></SegmentBase></Representation><Representation bandwidth="1893372" frameRate="30" height="1080" id="5" quality="full" width="1920"><BaseURL>?expires=1695518880837&amp;srcIp=50.7.93.29&amp;pr=40&amp;srcAg=GECKO&amp;ms=45.136.22.138&amp;type=5&amp;sig=c0eM9FCMf7k&amp;ct=21&amp;urls=45.136.20.205&amp;clientType=13&amp;appId=512000384397&amp;zs=43&amp;id=4838482053887</BaseURL><SegmentBase indexRange="435-53795"><Initialization range="0-434"/></SegmentBase></Representation></AdaptationSet><AdaptationSet audioSamplingRate="48000" bitstreamSwitching="true" codecs="opus" id="1" mimeType="audio/webm" subsegmentAlignment="true" subsegmentStartsWithSAP="1"><Representation bandwidth="32001" id="6"><BaseURL>?expires=1695518880837&amp;srcIp=50.7.93.29&amp;pr=40&amp;srcAg=GECKO&amp;ms=45.136.22.138&amp;type=4&amp;sig=PK_HZnd5k5c&amp;ct=22&amp;urls=45.136.20.205&amp;clientType=13&amp;appId=512000384397&amp;zs=43&amp;id=4838482053887</BaseURL><SegmentBase indexRange="480-78485"><Initialization range="0-479"/></SegmentBase></Representation><Representation bandwidth="128000" id="7"><BaseURL>?expires=1695518880837&amp;srcIp=50.7.93.29&amp;pr=40&amp;srcAg=GECKO&amp;ms=45.136.22.138&amp;type=0&amp;sig=PskRZY8L3a8&amp;ct=22&amp;urls=45.136.20.205&amp;clientType=13&amp;appId=512000384397&amp;zs=43&amp;id=4838482053887</BaseURL><SegmentBase indexRange="480-80024"><Initialization range="0-479"/></SegmentBase></Representation><Representation bandwidth="192000" id="8"><BaseURL>?expires=1695518880837&amp;srcIp=50.7.93.29&amp;pr=40&amp;srcAg=GECKO&amp;ms=45.136.22.138&amp;type=1&amp;sig=i1NgBlf1y1U&amp;ct=22&amp;urls=45.136.20.205&amp;clientType=13&amp;appId=512000384397&amp;zs=43&amp;id=4838482053887</BaseURL><SegmentBase indexRange="480-80210"><Initialization range="0-479"/></SegmentBase></Representation></AdaptationSet></Period></MPD>

当我将此响应保存为 .mpd 文件并尝试在 VLC 播放器中播放它时 - VLC 播放器表示无法播放此文件。还有其他一些玩家。

我还发现了旧的类似问题,但它对我没有帮助。

youtube-dl mpeg-dash yt-dlp mpd
1个回答
0
投票

此 DASH 清单包含对与清单 URL 相关的媒体片段的引用。当您在本地保存清单时,媒体播放器没有完整原始 URL 的信息,也无法获取片段。

您可以尝试在命令行上向 VLC 提供 URL,或者使用能够获取媒体片段并将其重新组装成可以离线观看的媒体文件的应用程序,例如 yt-dlpdash-mpd-cli .

© www.soinside.com 2019 - 2024. All rights reserved.