python - Gstreamer splitmuxsrc 不播放 splitmuxsink 制作的 MP4 文件
问题描述
下午好,
我将 RTSP 流保存为 MP4 段。
"gst-launch-1.0 -e rtspsrc location=rtsp://192.168.0.108/profile2/media.smp ! splitmuxsink location=storage/%04d.mp4 max-size-time=10000000000 "
并且想播放我之前在 GTK 窗口中保存的视频,但首先尝试从 CLI 播放:
"gst-launch-1.0 splitmuxsrc location=storage/*.mp4 ! decodebin ! videoconvert ! videoscale ! autovideosink"
并获取
__
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:00.000074602
也尝试"gst-launch-1.0 playbin uri="splitmux://*.mp4"
从 gst 的文档并得到相同的错误。
从 PyCharm 调试器得到这个:__
gst_base_src_start_complete:<filesrc0> pad not activated yet
basesrc gstbasesrc.c:2396:gst_base_src_update_length:<filesrc0> processing at or past EOS
gst_type_find_element_loop:<typefindelement0> error: Stream contains no data.
如果我理解正确,存在未记录标题的问题,这就是为什么我尝试了 CLI 方法,但当没有显示任何内容并且在第一段之后立即开始播放时,我仍然遇到相同的错误。
如果有任何想法,你能帮我吗?
解决方案
在. h264parse config-interval=-1
_ splitmuxsink
那应该在每个关键帧之前写入解码器特定的数据。由于 RTSP 仅在带外发送此信息,因此流中缺少此信息,除非您告诉h264parse
明确插入它们。