GStreamer - fakesink0:sink) (4096 bytes, dts: none, pts: none, duration: none for first text lines read by filesrc from srt file

拥有回忆 提交于 2019-12-24 18:54:28

问题


Why in following pipeline I have None timestamp at beginning of reading text from .srt file with subtitles?

Its a problem for me as I want to mux it later with h264 video from other src, and that fails due to "Buffer has no PTS" from muxer.

GStreamer version 1.14.5

gst-launch-1.0 filesrc do-timestamp=true location=English.srt  ! queue ! fakesink silent=false -v
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = event   ******* (fakesink0:sink) E (type: stream-start (10254), GstEventStreamStart, stream-id=(string)a02d40ac74fcf80941cc61947d76a1e054212aa98d213ab8cf403f1634f3abb0, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;) 0x563e90b389e0
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = event   ******* (fakesink0:sink) E (type: segment (17934), GstEventSegment, segment=(GstSegment)"GstSegment, flags=(GstSegmentFlags)GST_SEGMENT_FLAG_NONE, rate=(double)1, applied-rate=(double)1, format=(GstFormat)GST_FORMAT_TIME, base=(guint64)0, offset=(guint64)0, start=(guint64)0, stop=(guint64)18446744073709551615, time=(guint64)0, position=(guint64)0, duration=(guint64)18446744073709551615;";) 0x563e90b38a50
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = preroll   ******* 
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (4096 bytes, dts: none, pts: none, duration: none, offset: -1, offset_end: 4095, flags: 00000040 discont , meta: none) 0x7f35f0008060
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (4096 bytes, dts: none, pts: none, duration: none, offset: -1, offset_end: 4095, flags: 00000000 , meta: none) 0x7f35f0008170
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (4096 bytes, dts: none, pts: none, duration: none, offset: -1, offset_end: 4095, flags: 00000000 , meta: none) 0x7f35f0008280
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (4096 bytes, dts: none, pts: none, duration: none, offset: -1, offset_end: 4095, flags: 00000000 , meta: none) 0x7f35f0008390
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (4096 bytes, dts: 0:00:00.001037500, pts: 0:00:00.001037500, duration: none, offset: -1, offset_end: 4095, flags: 00000000 , meta: none) 0x7f35f00084a0
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (4096 bytes, dts: 0:00:00.001103400, pts: 0:00:00.001103400, duration: none, offset: -1, offset_end: 4095, flags: 00000000 , meta: none) 0x7f35f00085b0
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain   ******* (fakesink0:sink) (4096 bytes, dts: 0:00:00.001135300, pts: 0:00:00.001135300, duration: none, offset: -1, offset_end: 4095, flags: 00000000 , meta: none) 0x7f35f00086c0

Part of file to read:

1
00:00:00,900 --> 00:00:37,690
Flesh and sin die.

2
00:00:42,530 --> 00:00:46,410
Die with Christ, that's it.
Rise with Christ.

3
00:00:46,620 --> 00:00:50,660
That's it. Holy Spirit, come.
Holy Spirit come, set her free.

4
00:00:51,120 --> 00:00:53,080
Die with Christ.

回答1:


You have absolute no logic in your pipeline. Other than the file has the extension .srt no one knows with what kind of data we deal with here. You probably want something like subparse.

gst-launch-1.0 filesrc do-timestamp=true location=English.srt  ! subparse ! queue ! fakesink silent=false -v


来源:https://stackoverflow.com/questions/59361367/gstreamer-fakesink0sink-4096-bytes-dts-none-pts-none-duration-none-fo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!