首页 > 解决方案 > dashsink mpd 段列表给出 404 错误,如何从绝对路径更改为相对路径?

问题描述

下面给出了我的 dashsink 管道,但它生成的 mpd 文件将 mpd-root-path 属性中提供的 baseurl 和绝对路径附加到段列表中。有什么建议么?

gst-launch-1.0 -v --gst-debug-no-color=1 dashsink name=dashsink mpd-baseurl=http://localhost mpd-root-path=/var/www/localhost/media/kls2iesj mpd-filename=live.mpd target-duration=10 min-buffer-time=2 minimum-update-period=5 dynamic=false use-segment-list=true muxer=ts dvbsrc modulation=5 adapter=0 frequency=147000000 delsys=dvb-c-b ! queue ! tsdemux ! mpegvideoparse ! decodebin ! x264enc bitrate=1200 key-int-max=60 ! video/x-h264,stream-format=byte-stream,profile=main ! dashsink.video_0

生成的mpd文件

<?xml version="1.0"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-main:2011" type="dynamic" availabilityStartTime="2021-03-09T06:57:33Z" publishTime="2021-03-09T06:57:33Z" mediaPresentationDuration="P0Y0M0DT0H0M0.10S" minimumUpdatePeriod="P0Y0M0DT0H0M0.5S" minBufferTime="P0Y0M0DT0H0M0.2S"><BaseURL>http://localhost</BaseURL><Period id="period_00" bitstreamSwitching="false"><AdaptationSet id="1" contentType="video" subsegmentStartsWithSAP="0" bitstreamSwitching="false"><Representation id="video_0" bandwidth="972977" width="720" height="480" mimeType="video/mp2t" codecs="avc1"><SegmentList duration="10"><SegmentURL media="/var/www/localhost/media/kls2iesj/video_0_00000.ts"/></SegmentList></Representation></AdaptationSet></Period></MPD>

当使用 mplayer 播放此文件时,它为段文件提供 404,因为它附加了完整的绝对路径 baseurl。: mplayer file:///var/www/localhost/media/kls2iesj/live.mpd 甚至 mplayer http://localhost/media/kls2iesj/live.mpd.

[dash @ 0x7ff3e9f832a0]Opening 'http://localhost/var/www/localhost/media/kls2iesj/video_0_00000.ts' for reading

标签: gstreamer

解决方案


推荐阅读