GStreamer hlssink 管道终止
GStreamer hlssink pipeline termination
使用以下管道播放本地文件时:
gst-launch-1.0 filesrc location=/tmp/test.mp4 ! qtdemux ! queue ! h264parse ! mpegtsmux ! hlssink
我得到以下输出:
streamer_1 | Setting pipeline to PAUSED ...
streamer_1 | Pipeline is PREROLLING ...
streamer_1 | Pipeline is PREROLLED ...
streamer_1 | Setting pipeline to PLAYING ...
streamer_1 | New clock: GstSystemClock
streamer_1 | Got EOS from element "pipeline0".
streamer_1 | Execution ended after 0:00:22.647824881
streamer_1 | Setting pipeline to NULL ...
streamer_1 | Freeing pipeline .
这个管道的工作原理是我可以在浏览器中看到内容的输出,但它在 22 秒后终止。我的 test.mp4 文件是 15 分钟的流。
有人可以帮助我理解它为什么会在结束时终止以及我将如何播放完整的 15 分钟文件吗?
我终于明白了。如果您引入 clocksync
步骤,那么它将以预期的速率发出帧:
gst-launch-1.0 filesrc location=/tmp/test.mp4 ! qtdemux ! queue ! h264parse ! mpegtsmux ! clocksync ! hlssink
使用以下管道播放本地文件时:
gst-launch-1.0 filesrc location=/tmp/test.mp4 ! qtdemux ! queue ! h264parse ! mpegtsmux ! hlssink
我得到以下输出:
streamer_1 | Setting pipeline to PAUSED ...
streamer_1 | Pipeline is PREROLLING ...
streamer_1 | Pipeline is PREROLLED ...
streamer_1 | Setting pipeline to PLAYING ...
streamer_1 | New clock: GstSystemClock
streamer_1 | Got EOS from element "pipeline0".
streamer_1 | Execution ended after 0:00:22.647824881
streamer_1 | Setting pipeline to NULL ...
streamer_1 | Freeing pipeline .
这个管道的工作原理是我可以在浏览器中看到内容的输出,但它在 22 秒后终止。我的 test.mp4 文件是 15 分钟的流。
有人可以帮助我理解它为什么会在结束时终止以及我将如何播放完整的 15 分钟文件吗?
我终于明白了。如果您引入 clocksync
步骤,那么它将以预期的速率发出帧:
gst-launch-1.0 filesrc location=/tmp/test.mp4 ! qtdemux ! queue ! h264parse ! mpegtsmux ! clocksync ! hlssink