Always generate video segments from splitmuxsink

Jonas Danielsson jonas.danielsson at spiideo.com
Tue Apr 18 13:46:21 UTC 2023


Hi Matt!

I have used them, and read that link, but I have not gotten them to
work when using H264 without decode/encoding.

Jonas

On Tue, 18 Apr 2023 at 15:45, Matt Feury <mattfeury at gmail.com> wrote:
>
> Checkout fallbacksrc / fallbackswitch
> https://coaxion.net/blog/2020/07/automatic-retry-on-error-and-fallback-stream-handling-for-gstreamer-sources/
>
> haven't used it but been meaning to for similar purposes. you can provide a fallback image that it switches to when the live element stops.
>
>
>
>
> On Tue, Apr 18, 2023, 9:40 AM Jonas Danielsson via gstreamer-devel <gstreamer-devel at lists.freedesktop.org> wrote:
>>
>> Hello hackers!
>>
>> I have a challenge for you!
>> I want to generate video segments from H264 that arrive over RTSP,
>> sort of like this:
>>
>>     udpsrc ! rtpbin ! rtph264depay ! h264parse ! ...
>>
>> Say, I want 5 seconds segments.
>> Easy you say! Just use splitmuxsink, something like:
>>
>>     udpsrc ! rtpbin ! rtph264depay ! h264parse ! splitmuxsink
>> max-size-time=5000000000
>>
>> But, then I will add that I want to generate these MP4 segments even
>> though the source of
>> this RTP stream restarts, or goes offline, or in another way is flaky.
>> I always want these segments.
>>
>> Is there some tricky way of doing this? Some special mp4 way to hook into?
>> Some dark corner of the h264 spec? Some GStreamer specialité?
>>
>> So what do I expect to be in them when the source is gone? I am not sure ...
>> The last frame might be ok, some kind filler frame? sure. Black? I'll take it.
>>
>> The important part here is I want to always have a N second segment
>> with a known start-
>> and stop time. That I can upload to its final destination. I am
>> substituting a legacy system here so
>> there are some constraints I need to honor.
>>
>> And ... I do not want to decode / encode the H264. This is 4k video
>> and CPU time is money
>> here.
>>
>> Do I have any options?
>> Regards
>> Jonas


More information about the gstreamer-devel mailing list