입력란에 @otopolsky 감사합니다. rtpsrc를 사용하고 있으므로 rtspsrc 등록 정보에 대한 의견이 확실하지 않습니다.
어쨌든 입력 스트림을 입력란에 넣으려는 귀하의 생각을 따르려고했습니다. 데모 코드를 위해 모든 오디오 자료를 한 쪽 입력 스트림으로 만 처리했습니다.
파이프 라인은 다음과 같다 : 파이프 라인이 재생 상태에 일단
rtmpsrc => decodebin => videoscale => videorate => capsfilter
=> compositor.sink_0 => capsfilter => x264enc => flvmux => rtmpsink
내가 이렇게 빈 동적 파이프 라인에 추가됩니다 보장하기 위해 빈을 구축 할 수 있습니다.
rtmpsrc => decodebin => videoscale => videorate => capsfilter
나는 또한 설정 빈의 유령 패드, 내가 프로브를 사용하는 빈 파이프 라인 사이의 실제 링크를 수행합니다 :
빈은 두 번째 입력의 모든 요소를 가지고 그런 다음
def _prob_block(self, pad, info, data):
pad.remove_probe(info.id)
src_pad = self.bin.get_static_pad('src')
sink_pad = self.compositor.get_request_pad('sink_1')
src_pad.link(sink_pad)
return Gst.PadProbeReturn.OK
ghost_pad = Gst.GhostPad.new('src', self.capsfilter_video_ben.get_static_pad('src'))
self.bin.add_pad(ghost_pad)
ghost_pad.add_probe(Gst.PadProbeType.BLOCK_DOWNSTREAM, self._prob_block, None)
, 나는 내 응용 프로그램이 의사 코드가이 거의 완벽하게 작동
def _activate_bin():
# ... this is where I create bin along with bin elements
# ... and create the ghost pad (see above)
# Then add the bin to the pipeline
pipe._pipeline.add(bin)
bin.set_state(Gst.State.PLAYING)
pipe = Pipeline()
GObject.timeout_add_seconds(10, _activate_bin)
pipe._pipeline.set_state(Gst.State.PLAYING)
을, 파이프 라인은 공동 통과 하나 개의 입력 (sink_0)로 시작 mpositor 그리고 rtmpsink (실제로 출력 스트림을 재생할 수 있습니다). 10 초 후, 나는 bin을 파이프 라인에 추가합니다 (compositor의 pad 'sink_1'). 여기에서 다시 말하지만, 이것은 컴포지터에 두 입력을 모두 얻을 때까지 완벽하게 작동합니다. 이것은 얼어 붙기 시작하는 곳입니다.
내가 읽을 수있는 것으로부터, 대기 시간 및/또는 시계에서 올 수 있었지만 문제를 해결할 수 없었습니다. 흥미로운 점은 양쪽 입력 스트림으로 파이프 라인을 시작할 때 문제가 없다는 것입니다.
왜 다른 행동을했는지 알고 싶습니까?