我正在通過為請求的解析度動態創建 ABR 階梯來創建一個用于查看攝像機源的應用程式。以下是我擁有的靜態管道
gst-launch-1.0 hlssink2 name=ingest1 playlist-location=live/stream.m3u8 location=live/segment%d.ts max-files=10 target-duration=2 \
rtspsrc location="rtsp://myrtspcamurl:554/" name=rtspsrc0" \
rtspsrc0. ! rtph264depay ! tee name=t \
t. ! queue ! ingest1.video \
t. ! queue ! decodebin ! tee name=decode_t \
decode_t. ! queue ! videorate ! videoscale ! video/x-raw,framerate=2/1,width=240,height=240 ! videoconvert ! jpegenc ! multifilesink location=stills/stills%d.jpg \
decode_t. ! queue ! videoscale ! video/x-raw,width=640,height=360 ! openh264enc ! hlssink2 location=360/segment%d.ts playlist-location=360/stream.m3u8
我正在嘗試以編程方式添加以下動態編碼器管道,如下所示
decode_t. ! queue ! videoscale ! video/x-raw,width=854,height=480 ! openh264enc ! hlssink2 location=480/segment%d.ts playlist-location=480/stream.m3u8
為了添加這個管道,我從decode_ttee 得到一個新的 src pad 并設定BLOCK_DOWNSTREAM。一切正常。
我遇到的問題是:
當管道運行數小時以攝取視頻時,當我啟動一個新的編碼器管道時,它會阻塞另一個 360p 階梯,直到這個新的 hlsink2(480p) 的段數與 360p 相同。
因此,兩個流的 stream.m3u8 在此之前都無法使用。似乎它正在嘗試同步管道運行時間。
有解決方法嗎?我在 rus 和 github 中有一個作業版本 - > https://github.com/ggovindan/abr_ladder
我真的很感謝這方面的任何幫助!
uj5u.com熱心網友回復:
默認情況下,videorate您在每個 HLS 輸出箱中的輸出總是從運行時間 0 開始輸出。如果你這樣做
videorate.set_property("skip-to-first", true);
create_encoder_bin()那么這應該按預期運行。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/469130.html
上一篇:為什么將輸出寫入正在緩沖的管道
下一篇:向子行程發送信號以更新值
