如何解决仅在有限的时间内记录实时流m3u8到mp4
uridecodebin uri="$URL" async-handling=true sync=true name=dec ! videoscale ! video/x-raw,width=1920,height=1080 \
! queue2 name=q2 max-size-time=0 max-size-bytes=0 max-size-buffers=150 low-watermark=0.2 high-watermark=0.5 use-buffering=true \
! gdkpixbufoverlay location=/rails/ui/public/krowne.png offset-x=1728 offset-y=0 alpha=0.5 overlay-width=192 overlay-height=49 \
! tee name=t \
compositor name=mix \
sink_0::xpos=0 sink_0::ypos=0 sink_0::zorder=0 \
! videoconvert \
! x264enc cabac=false key-int-max=50 quantizer=0 pass=0 speed-preset=ultrafast tune=zerolatency bitrate=20000 byte-stream=true ! video/x-h264,height=1080,pixel-aspect-ratio=1/1,framerate=25/1,format=YV12,profile=constrained-baseline \
! qtmux name=mux \
! queue \
! filesink location=../ui/public/2.mp4 dec. \
! audioconvert \
! audiorate \
! audioresample \
! audio/x-raw,rate=44100,layout=interleaved,format=F32LE,channels=1 ! queue ! avenc_aac bitrate=128000 ac=2 \
! queue \
! audio/mpeg \
! mux. \
t. ! queue ! mix.sink_0
具有这样的管道。如果我使用带有有限视频的任何http / web网址,效果会很好,因为它会自行停止。
但是我要实现的是,使用无限的m3u8 / TS流运行此管道,并在N分钟后将其停止。
最好的情况是num-buffers
,但我不知道如何。
我尝试过-使用ruby sdk来停止整个管道,并且还明确地停止dec
。但int仍不会阻止uridecodebin接收流
有什么建议吗?
我的hacky shell脚本尝试有效:
gst-launch-1.0 ..... &
gstpid=$!
echo $gstpid
sleep 200
kill -SIGINT $gstpid
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。