gstreamer - 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
解决方案
推荐阅读
- css - 如何调整 ion-item-options 按钮的大小
- azure-devops - 如何使用 azure devops 管道部署到多个主机
- sql - Powershell“Invoke-Sqlcmd2”未与 Windows 帐户凭据连接
- c# - 字典添加创建两个带有翻转键值对的条目
- legend - 如何处理具有太多条目以匹配固定图表高度的分类图例?
- lua - Lua 函数返回 Nil
- python - 试图用 Python 发送 xlsx
- regex - RegEx 仅在匹配第一个模式后才匹配模式
- javascript - 有没有办法将 svg 容器塑造成它的内容?
- ios - SwiftUI:如何将核心数据对象传递给视图?