如何停止管道并启动具有相同来源的新管道?

2024-09-30 10:42:09 发布

您现在位置:Python中文网/ 问答频道 /正文

我试着做录像机。 当我开始写入第二个文件时,接收器错误:进程结束,退出代码139(被信号11:SIGSEGV中断)

Gst.init(sys.argv)
pipeline = Gst.parse_launch(
    'nvarguscamerasrc gainrange="1 1" ispdigitalgainrange="2 2" ! '
    'video/x-raw(memory:NVMM),width=1280, height=720, framerate=120/1, format=NV12 ! '
    'omxh264enc ! qtmux ! filesink location=out/file1.mp4')
pipeline.set_state(Gst.State.PLAYING)
time.sleep(2)
pipeline.send_event(Gst.Event.new_eos())
pipeline.set_state(Gst.State.NULL)

print("Start write second file")

pipeline2 = Gst.parse_launch(
    'nvarguscamerasrc gainrange="1 1" ispdigitalgainrange="2 2" ! '
    'video/x-raw(memory:NVMM),width=1280, height=720, framerate=120/1, format=NV12 ! '
    'omxh264enc ! qtmux ! filesink location=file2.mp4')
pipeline2.set_state(Gst.State.PLAYING)
time.sleep(2)
pipeline2.send_event(Gst.Event.new_eos())
pipeline2.set_state(Gst.State.NULL)

如何停止第一条管道,启动第二条管道?你知道吗

或者我需要制作摄像头管道witch从摄像头获取数据,当我需要写入文件并记录摄像头管道时使用tee?你知道吗

我是第一次使用Gstreamer


Tags: 文件管道pipelineparsevideolaunch摄像头state

热门问题