[英]Using Live555 to Stream Live Video from an IP camera connected to an H264 encoder
[英]Is stream-format in h264 related to camera provided stream or is it more like transport thing?
我的相機可以生成不同格式的視頻 stream。 其中之一是 h264 編碼的 stream。我使用 dshow 和 gstreamer 來獲取這個 stream 並用 c++ 處理它並通過共享 memory 發送它。我的問題與 gst 上限中的字段流格式有關。 我怎么知道它是字節流還是avc? 它與相機產生的 stream 緊密耦合,還是像我自己用 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
(...)
我認為從中獲取數據的接口應該指定數據格式。
GStreamer 術語中的byte-stream
流是符合 H.264 規范的常規 H.264 字節流,具有起始代碼、起始代碼模擬字節等。
或者, avc
樣本可以是替代格式(MP4 文件將 H.264 數據存儲為 AVC 樣本,而不是字節流)。 AVC 樣本基本上是[nal length][nal data of length size]
...塊(沒有起始代碼或起始代碼模擬字節)。
AVC 示例為您提供快速 NAL 塊訪問,因為常規字節流必須進行更多解析。
因此,無論您進入 GStreamer 中什么,您都必須設置類型,以便下游元素知道期望的數據類型。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.