【发布时间】:2023-01-12 20:47:43
【问题描述】:
我的相机可以生成不同格式的视频流。其中之一是 h264 编码流。我使用 dshow 和 gstreamer 来获取这个流并用 c++ 处理它,并通过共享内存发送它。我的问题与 gst 上限中的字段流格式特别相关。我怎么知道它是字节流还是avc?它是与相机产生的流紧密耦合还是像我自己用 gstreamer 设置的传输东西?我使用的是相当复杂的商业特定管道,我无法在此处完整分享。当我在我的代码中设置 gst_caps_set_simple (gstCaps, "stream-format", G_TYPE_STRING, "byte-stream", nullptr); 时,它可以工作,但我不是 100% 为什么,所以我想澄清一下。
我已经尝试使用 ffmpeg 检查有关此特定相机的信息,但我无法获得有关流格式的信息。我得到的最好的是:
ffmpeg -f dshow -list_options true -i video="nameOfCamera"
(...)
vcodec=h264 min s=128x96 fps=0.015625 max s=768x480 fps=29.97
vcodec=h264 min s=128x96 fps=0.015625 max s=768x576 fps=25
vcodec=h264 min s=128x96 fps=0.015625 max s=768x480 fps=29.97
vcodec=h264 min s=128x96 fps=0.015625 max s=768x576 fps=25
vcodec=h264 min s=128x96 fps=0.015625 max s=768x480 fps=29.97
vcodec=h264 min s=128x96 fps=0.015625 max s=768x576 fps=25
vcodec=h264 min s=128x96 fps=0.015625 max s=768x576 fps=25
(...)
【问题讨论】:
标签: c++ ffmpeg gstreamer h.264 directshow