如何在 NReco 中获取 "has_b_frames" 视频 属性?
How to get "has_b_frames" video property in NReco?
我尝试获取视频的 "has_b_frames" 值,但在 select xml 节点失败。
代码:
var videoInfo = new FFProbe();
var root = videoInfo.GetMediaInfo(filename).Result.CreateNavigator();
root.Select("/ffprobe/streams");
root.MoveToNextAttribute();
根的值为
root value 1 and root value 2分别是
outerxml 的值为 outerxml value with XML visualizer.
那么我怎样才能得到属性 "has_b_frames" 呢?
谢谢
您需要使用适当的 XPath 选择器,如下所示:
var mediaInfo = videoInfo.GetMediaInfo(filename);
var has_b_frames = mediaInfo.Result.CreateNavigator().SelectSingleNode(
"/ffprobe/streams/stream[@index=\"0\"]/@has_b_frames")?.Value;
我尝试获取视频的 "has_b_frames" 值,但在 select xml 节点失败。
代码:
var videoInfo = new FFProbe();
var root = videoInfo.GetMediaInfo(filename).Result.CreateNavigator();
root.Select("/ffprobe/streams");
root.MoveToNextAttribute();
根的值为
root value 1 and root value 2分别是
outerxml 的值为 outerxml value with XML visualizer.
那么我怎样才能得到属性 "has_b_frames" 呢?
谢谢
您需要使用适当的 XPath 选择器,如下所示:
var mediaInfo = videoInfo.GetMediaInfo(filename);
var has_b_frames = mediaInfo.Result.CreateNavigator().SelectSingleNode(
"/ffprobe/streams/stream[@index=\"0\"]/@has_b_frames")?.Value;