GStreamer - 同时保存 .mp4 和 HLS 的问题

问题描述 投票:0回答:1

我有两个管道,分别从 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'
video-streaming streaming gstreamer http-live-streaming rtsp
1个回答
0
投票

问题在于你如何使用

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'
© www.soinside.com 2019 - 2024. All rights reserved.