gstreamer 파이프라인 예시가 있습니다.gst-launch-1.0 v4l2src device=/dev/video2 ! image/jpeg,width=1280, height=800, framerate=30/1 ! v4l2jpegdec ! queue ! v4l2h264enc extra-controls="controls, h264_profile=4, video_bitrate=620000" ! 'video/x-h264, profile=high, level=(string)4' ! h264parse ! matroskamux ! filesink location=output2.mkv
명령줄에서 실행합니다. 프로세스를 종료하기 위해 Ctrl+C를 누르는 대신 프로세스에 EOS 이벤트를 보내고 싶습니다.
이것이 가능한가? 만약 그렇다면, 누군가 그것을 해본 적이 있거나 해결책은 무엇입니까?
답변1
이 작업을 수행할 방법을 찾을 수 없었지만 watchdog timeout=1000
파이프에 추가하고 비디오 입력 연결을 끊은 다음 워치독이 스트림을 종료하고 EOS를 생성합니다. 또한 -e
비디오 파일이 제대로 닫혔는지 확인하기 위해 명령 끝에 다음이 있습니다 .
gst-launch-1.0.exe rtspsrc location=rtsp://192.168.189.3:8554/bandwidth_h264 latency=0 ! decodebin ! watchdog timeout=1000 ! tee name=split split.! queue leaky=1 ! autovideosink sync=false split.! queue leaky=1 ! videoconvert ! x264enc ! mp4mux ! filesink location=c:/demo/test.mp4 -e