0

Good afternoon,

I'm saving RTSP stream as MP4 segments.

"gst-launch-1.0 -e rtspsrc location=rtsp://192.168.0.108/profile2/media.smp ! splitmuxsink location=storage/%04d.mp4 max-size-time=10000000000 "

And would like to play the videos I've saved earlier in the GTK window, but trying first to play from CLI with: "gst-launch-1.0 splitmuxsrc location=storage/*.mp4 ! decodebin ! videoconvert ! videoscale ! autovideosink" and get

__
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:00.000074602

also try the "gst-launch-1.0 playbin uri="splitmux://*.mp4" from documentation of gst and get the same error.

from PyCharm debugger got this: __

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.

If I understand right there is a problem that headers are not recorded, that's why I've tried CLI method and still I got the same error when nothing shows and playback starts right after the first segment.

can you help me if there are any ideas?

roganjosh
  • 12,594
  • 4
  • 29
  • 46
dow_jones
  • 9
  • 3

1 Answers1

0

Try h264parse config-interval=-1 (If your stream is H.264 format) before the splitmuxsink. That should write decoder specific data before each key frame. Since RTSP only sends this info out of band this info is missing from the stream unless You tell h264parse to explicitly insert them.

Florian Zwoch
  • 6,764
  • 2
  • 12
  • 21
  • Did you meant config-interval=-1? Splitmuxsrc stops after first couple frames I guess. New clock: GstSystemClock Got EOS from element "pipeline0". Execution ended after 0:00:00.009340541 Setting pipeline to PAUSED ... – dow_jones Jul 23 '18 at 15:29
  • I am trying this at the moment. `gst-launch-1.0 splitmuxsrc location=file*.mp4 ! qtdemux name=demux ! queue ! avdec_h264 ! videoconvert ! autovideosink` but this sends the error on splitmuxsrc: `WARNING: from element /GstPipeline:pipeline0/GstSplitMuxSrc:splitmuxsrc0: Could not read from resource. Additional debug info: gstsplitmuxsrc.c(706): gst_splitmux_src_start (): /GstPipeline:pipeline0/GstSplitMuxSrc:splitmuxsrc0: Failed to prepare file part ./file-001.mp4. Cannot play past there.` – dow_jones Jul 23 '18 at 15:56
  • `=-1` Thanks for noticing yes. Maybe you go into more detail. You want to save segments of MP4 files and play them? Doesn't `multifilesrc` do the trick for for you? Do the segments play if you play them one at a time? – Florian Zwoch Jul 23 '18 at 17:36
  • Its smth like security systems software. I have an RTSP stream from IP camera. I need to store it to have a replay of the moment (that’s why I think of segmented mp4 files or ts and m3u8) and play live stream in the GTK player window. Play on GTK drawing area, store in the backend to the folder. When I save a moment (timecode) on button click, I would like to get the record from the archive by asking for timecode(+-10 sec interval) and playing it in the new GTK window. So, now I’m starting from storing the video stream, to play the stream is not a problem with gst-parse-launch – dow_jones Jul 23 '18 at 19:49
  • Multifilesink cuts the file, but properly finishes it only when I add ‘-e’ to ‘gst-launch-1.0’, I understand why. Every single file is playing in standard Ubuntu Video player. But when I try to ‘multifilesrc location=*.mp4’ with ‘-v’ it simply shows that play stopped after first element. Could not read ‘01.mp4’. I’ve tried ffmpeg with segmentation and m3u8 creation but it just plays the first element again and show that DTS not in sync and no timecode in the stream. I think that maybe RTSP stream is not giving any needed data, am I right? – dow_jones Jul 23 '18 at 19:54