我一直在嘗試使用 XPath 并將變數從 FFProbe 提供的 XML 中提取出來。/ffprobe/streams/codec_type
<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
<streams>
<stream index="0" codec_name="mpeg2video" codec_long_name="MPEG-2 video"/>`
</stream>
</streams>
</ffprobe>
uj5u.com熱心網友回復:
你的 XPath,
/ffprobe/streams/codec_type
選擇codec_type具有指定遺產的元素,但您的 XML,
<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
<streams>
<stream index="0" codec_name="mpeg2video" codec_long_name="MPEG-2 video"/>`
</stream>
</streams>
</ffprobe>
- 沒有這樣的元素,并且
- 格式不
</stream>正確,因為它在自閉合標記之后有一個無關的閉合<stream/>標記。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/442387.html
上一篇:如何洗掉標簽?
