我有两个管道,分别从 RTSP 流创建 .mp4 和 HLS。
gst-launch-1.0 -v -e rtspsrc \
location="..." \
is-live=true \
! queue \
! rtph264depay \
! tee \
name=t \
t. \
! h264parse \
! mpegtsmux \
! hlssink \
playlist-length=0 \
max-files=50000 \
target-duration=3 \
location='segment%05d.ts' \
playlist-location='playlist.m3u8'
gst-launch-1.0 -v -e rtspsrc \
location="..." \
is-live=true \
! queue \
! rtph264depay \
! tee \
name=t \
t. \
! h264parse \
! mp4mux \
fragment-duration=1 \
! filesink \
append=true \
location='video.mp4'
当我合并它们时,它们都没有创建文件(只有空的.mp4)。 我缺少什么想法吗?可能是什么问题?
原型无法工作:
gst-launch-1.0 -v -e rtspsrc \
location="<source>" \
is-live=true \
! queue \
! rtph264depay \
! tee \
name=t \
t. \
! h264parse \
! mpegtsmux \
! hlssink \
playlist-length=0 \
max-files=50000 \
target-duration=3 \
location='segment%05d.ts' \
playlist-location='playlist.m3u8' \
t. \
! h264parse \
! mp4mux \
fragment-duration=1 \
! filesink \
append=true \
location='video.mp4'
问题在于你如何使用
queue
。您可以在这里阅读更多相关信息:https://gstreamer.freedesktop.org/documentation/coreelements/queue.html?gi-language=c
此代码有效:
location="<source>" \
is-live=true \
! rtph264depay \
! tee \
name=t \
t. \
! queue \
! h264parse \
! mpegtsmux \
! hlssink \
playlist-length=0 \
max-files=50000 \
target-duration=3 \
location='segment%05d.ts' \
playlist-location='playlist.m3u8' \
t. \
! queue \
! h264parse \
! mp4mux \
fragment-duration=1 \
! filesink \
append=true \
location='video.mp4'