我尝试使用 ffplay 播放从 Facebook 获得的 Facebook Livestream dash url。但是,我无法播放此直播。
这是我从 Facebook 获得的示例播放列表。
<?xml version="1.0"?>
<MPD
type="dynamic"
xmlns="urn:mpeg:dash:schema:mpd:2011"
xmlns:xsi="http://www.w3.org/2011/XMLSchema-instance"
xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd"
profiles="urn:mpeg:dash:profile:isoff-live:2011"
availabilityStartTime="2020-05-05T17:09:39-07:00"
availabilityEndTime="2020-05-05T19:58:32-07:00"
timeShiftBufferDepth="PT1M23S"
suggestedPresentationDelay="PT2S"
minBufferTime="PT1S"
publishTime="2020-05-05T17:09:39-07:00"
minimumUpdatePeriod="PT1S"
FBMS="true"
PTS="true"
currentServerTimeMs="1588733414813"
firstAvTimeMs="1588723771264"
lastVideoFrameTs="9653205"
loapStreamId="262304018486523"
publishFrameTime="19085">
<Period id="dash-abr5" start="PT0S">
<AdaptationSet
segmentAlignment="true"
maxWidth="1920"
maxHeight="1080"
maxFrameRate="30">
<Representation
id="live-md-v"
mimeType="video/mp4"
codecs="avc1.4d401e"
width="640"
height="360"
frameRate="30"
startWithSAP="1"
bandwidth="550000"
FBQualityClass="sd"
FBQualityLabel="360p">
<SegmentTemplate
presentationTimeOffset="0"
timescale="1000"
initialization="../live-md-v/262304018486523_0-init.m4v?ms=m_CN"
media="../live-md-v/262304018486523_0-$Time$.m4v?ms=m_CN">
<SegmentTimeline>
<S t="9575906" d="8333"/>
<S t="9584239" d="8334"/>
<S t="9592573" d="8333"/>
<S t="9600906" d="8333"/>
<S t="9609239" d="8334"/>
<S t="9617573" d="8333"/>
<S t="9625906" d="8333"/>
<S t="9634239" d="8334"/>
<S t="9642573" d="8333"/>
<S t="9650906" d="8333"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
<Representation
id="live-qd-v"
mimeType="video/mp4"
codecs="avc1.4d401e"
width="256"
height="144"
frameRate="30"
startWithSAP="1"
bandwidth="110000"
FBQualityClass="sd"
FBQualityLabel="144p">
<SegmentTemplate
presentationTimeOffset="0"
timescale="1000"
initialization="../live-qd-v/262304018486523_0-init.m4v?ms=m_CN"
media="../live-qd-v/262304018486523_0-$Time$.m4v?ms=m_CN">
<SegmentTimeline>
<S t="9575906" d="8333"/>
<S t="9584239" d="8334"/>
<S t="9592573" d="8333"/>
<S t="9600906" d="8333"/>
<S t="9609239" d="8334"/>
<S t="9617573" d="8333"/>
<S t="9625906" d="8333"/>
<S t="9634239" d="8334"/>
<S t="9642573" d="8333"/>
<S t="9650906" d="8333"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
<Representation
id="live-ld-v"
mimeType="video/mp4"
codecs="avc1.4d401e"
width="426"
height="240"
frameRate="30"
startWithSAP="1"
bandwidth="275000"
FBQualityClass="sd"
FBQualityLabel="240p">
<SegmentTemplate
presentationTimeOffset="0"
timescale="1000"
initialization="../live-ld-v/262304018486523_0-init.m4v?ms=m_CN"
media="../live-ld-v/262304018486523_0-$Time$.m4v?ms=m_CN">
<SegmentTimeline>
<S t="9575906" d="8333"/>
<S t="9584239" d="8334"/>
<S t="9592573" d="8333"/>
<S t="9600906" d="8333"/>
<S t="9609239" d="8334"/>
<S t="9617573" d="8333"/>
<S t="9625906" d="8333"/>
<S t="9634239" d="8334"/>
<S t="9642573" d="8333"/>
<S t="9650906" d="8333"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
<Representation
id="live-hd-v"
mimeType="video/mp4"
codecs="avc1.4d401e"
width="854"
height="480"
frameRate="30"
startWithSAP="1"
bandwidth="1100000"
FBQualityClass="sd"
FBQualityLabel="480p">
<SegmentTemplate
presentationTimeOffset="0"
timescale="1000"
initialization="../live-hd-v/262304018486523_0-init.m4v?ms=m_CN"
media="../live-hd-v/262304018486523_0-$Time$.m4v?ms=m_CN">
<SegmentTimeline>
<S t="9575906" d="8333"/>
<S t="9584239" d="8334"/>
<S t="9592573" d="8333"/>
<S t="9600906" d="8333"/>
<S t="9609239" d="8334"/>
<S t="9617573" d="8333"/>
<S t="9625906" d="8333"/>
<S t="9634239" d="8334"/>
<S t="9642573" d="8333"/>
<S t="9650906" d="8333"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
<Representation
id="live-hd1-v"
mimeType="video/mp4"
codecs="avc1.4d401e"
width="1280"
height="720"
frameRate="30"
startWithSAP="1"
bandwidth="2200000"
FBQualityClass="hd"
FBQualityLabel="720p">
<SegmentTemplate
presentationTimeOffset="0"
timescale="1000"
initialization="../live-hd1-v/262304018486523_0-init.m4v?ms=m_CN"
media="../live-hd1-v/262304018486523_0-$Time$.m4v?ms=m_CN">
<SegmentTimeline>
<S t="9575906" d="8333"/>
<S t="9584239" d="8334"/>
<S t="9592573" d="8333"/>
<S t="9600906" d="8333"/>
<S t="9609239" d="8334"/>
<S t="9617573" d="8333"/>
<S t="9625906" d="8333"/>
<S t="9634239" d="8334"/>
<S t="9642573" d="8333"/>
<S t="9650906" d="8333"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
<Representation
id="live-hd2-v"
mimeType="video/mp4"
codecs="avc1.4d401e"
width="1920"
height="1080"
frameRate="30"
startWithSAP="1"
bandwidth="3850000"
FBQualityClass="hd"
FBQualityLabel="1080p">
<SegmentTemplate
presentationTimeOffset="0"
timescale="1000"
initialization="../live-hd2-v/262304018486523_0-init.m4v?ms=m_CN"
media="../live-hd2-v/262304018486523_0-$Time$.m4v?ms=m_CN">
<SegmentTimeline>
<S t="9575906" d="8333"/>
<S t="9584239" d="8334"/>
<S t="9592573" d="8333"/>
<S t="9600906" d="8333"/>
<S t="9609239" d="8334"/>
<S t="9617573" d="8333"/>
<S t="9625906" d="8333"/>
<S t="9634239" d="8334"/>
<S t="9642573" d="8333"/>
<S t="9650906" d="8333"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
<Representation
id="live-pst-v"
mimeType="video/mp4"
codecs="avc1.4d401e"
width="1920"
height="1080"
frameRate="30"
startWithSAP="1"
bandwidth="15000000"
FBQualityClass="hd"
FBQualityLabel="1080p (Source)">
<SegmentTemplate
presentationTimeOffset="0"
timescale="1000"
initialization="../live-pst-v/262304018486523_0-init.m4v?ms=m_CN"
media="../live-pst-v/262304018486523_0-$Time$.m4v?ms=m_CN">
<SegmentTimeline>
<S t="9575906" d="8333"/>
<S t="9584239" d="8334"/>
<S t="9592573" d="8333"/>
<S t="9600906" d="8333"/>
<S t="9609239" d="8334"/>
<S t="9617573" d="8333"/>
<S t="9625906" d="8333"/>
<S t="9634239" d="8334"/>
<S t="9642573" d="8333"/>
<S t="9650906" d="8333"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true">
<Representation
id="live-md-a"
mimeType="audio/mp4"
codecs="mp4a.40.2"
audioSamplingRate="48000"
startWithSAP="1"
bandwidth="65698">
<SegmentTemplate
presentationTimeOffset="0"
timescale="1000"
initialization="../live-md-a/262304018486523_0-init.m4a?ms=m_CN"
media="../live-md-a/262304018486523_0-$Time$.m4a?ms=m_CN">
<SegmentTimeline>
<S t="9575906" d="8333"/>
<S t="9584239" d="8334"/>
<S t="9592573" d="8333"/>
<S t="9600906" d="8333"/>
<S t="9609239" d="8334"/>
<S t="9617573" d="8333"/>
<S t="9625906" d="8333"/>
<S t="9634239" d="8334"/>
<S t="9642573" d="8333"/>
<S t="9650906" d="8333"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
</Period>
</MPD>
以下是 ffplay 的输出
ffplay version 4.2.2-1ubuntu1~18.04.york0 Copyright (c) 2003-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version='1ubuntu1~18.04.york0' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
https://video.fhan2-4.fna.fbcdn.net/hvideo-frc3-ftw/_nc_cat-109/v/rTsIPYF6kXwgjvEukHmUC/live-dash/dash-abr5/262304018486523.mpd?_nc_rl=AfAqK1YETG74Qoqr&ms=m_CN&oh=8acc3faf91ca83b70c19b74c233a3864&oe=5EB3A3B3:248: parser error : Specification mandate value for attribute presentationTim
presentationTim
^
https://video.fhan2-4.fna.fbcdn.net/hvideo-frc3-ftw/_nc_cat-109/v/rTsIPYF6kXwgjvEukHmUC/live-dash/dash-abr5/262304018486523.mpd?_nc_rl=AfAqK1YETG74Qoqr&ms=m_CN&oh=8acc3faf91ca83b70c19b74c233a3864&oe=5EB3A3B3:248: parser error : attributes construct error
presentationTim
^
https://video.fhan2-4.fna.fbcdn.net/hvideo-frc3-ftw/_nc_cat-109/v/rTsIPYF6kXwgjvEukHmUC/live-dash/dash-abr5/262304018486523.mpd?_nc_rl=AfAqK1YETG74Qoqr&ms=m_CN&oh=8acc3faf91ca83b70c19b74c233a3864&oe=5EB3A3B3:248: parser error : Couldn't find end of Start Tag SegmentTemplate line 247
presentationTim
^
https://video.fhan2-4.fna.fbcdn.net/hvideo-frc3-ftw/_nc_cat-109/v/rTsIPYF6kXwgjvEukHmUC/live-dash/dash-abr5/262304018486523.mpd?_nc_rl=AfAqK1YETG74Qoqr&ms=m_CN&oh=8acc3faf91ca83b70c19b74c233a3864&oe=5EB3A3B3:248: parser error : Premature end of data in tag Representation line 240
presentationTim
^
https://video.fhan2-4.fna.fbcdn.net/hvideo-frc3-ftw/_nc_cat-109/v/rTsIPYF6kXwgjvEukHmUC/live-dash/dash-abr5/262304018486523.mpd?_nc_rl=AfAqK1YETG74Qoqr&ms=m_CN&oh=8acc3faf91ca83b70c19b74c233a3864&oe=5EB3A3B3:248: parser error : Premature end of data in tag AdaptationSet line 239
presentationTim
^
https://video.fhan2-4.fna.fbcdn.net/hvideo-frc3-ftw/_nc_cat-109/v/rTsIPYF6kXwgjvEukHmUC/live-dash/dash-abr5/262304018486523.mpd?_nc_rl=AfAqK1YETG74Qoqr&ms=m_CN&oh=8acc3faf91ca83b70c19b74c233a3864&oe=5EB3A3B3:248: parser error : Premature end of data in tag Period line 22
presentationTim
^
https://video.fhan2-4.fna.fbcdn.net/hvideo-frc3-ftw/_nc_cat-109/v/rTsIPYF6kXwgjvEukHmUC/live-dash/dash-abr5/262304018486523.mpd?_nc_rl=AfAqK1YETG74Qoqr&ms=m_CN&oh=8acc3faf91ca83b70c19b74c233a3864&oe=5EB3A3B3:248: parser error : Premature end of data in tag MPD line 2
presentationTim
^
[dash @ 0x7fd21c000b80] Unable to parse 'https://video.fhan2-4.fna.fbcdn.net/hvideo-frc3-ftw/_nc_cat-109/v/rTsIPYF6kXwgjvEukHmUC/live-dash/dash-abr5/262304018486523.mpd?_nc_rl=AfAqK1YETG74Qoqr&ms=m_CN&oh=8acc3faf91ca83b70c19b74c233a3864&oe=5EB3A3B3' - missing root node
https://video.fhan2-4.fna.fbcdn.net/hvideo-frc3-ftw/_nc_cat-109/v/rTsIPYF6kXwgjvEukHmUC/live-dash/dash-abr5/262304018486523.mpd?_nc_rl=AfAqK1YETG74Qoqr&ms=m_CN&oh=8acc3faf91ca83b70c19b74c233a3864&oe=5EB3A3B3: Invalid data found when processing input
ffplay 无法解析主播放列表,这很奇怪。我使用最新的 ffmpeg 版本 4.2.2。我也尝试使用 vlc 播放此 url,效果很好。有人知道这个问题吗?
谢谢。