Finalizing a matroska video recorded in parallel to RTSP server
I'm developing an application where I serve a live video stream over RTSP and
alongside record it on-device with a different bitrate. For this I have a
tee and a proxysink in the lauch line I give to the RTSP server and a second
pipeline with a proxysrc and a filesink:
When a client connects, I link the two proxy elements in the RTSP media
factory's "media-configure" callback. Both streaming and writing to file
works, except that the file is never finalized and thus not seekable.
I am trying to finalize it when I get a "teardown-request" from the
GstRTSPClient by calling the following function (CustomData is a struct
holding pointers to all the gstreamer elements I need.):
Everything works as expected here and "got EOS on bus" is printed. However,
the file is not seekable.
Besides what's shown in the above function I have tried:
- sending the EOS not to the sinkpad of the filesink, but to the filesink
element. Then I do not get the message on the bus (it hangs indefinitely)
- sending the EOS not to the filesink, but to the whole record pipeline.
Again, no EOS on the bus.
- trying all of the above just after ensuring the record pipeline is in the
playing state. That makes no difference.
I'm sure it's something obvious that I just don't understand. What am I