I’m currently using the following GStreamer pipeline with splitmuxsink to split the video every 10 seconds. However, I’m facing an issue with the video fragmentation as I’ve added the fragment properties in the “muxer-properties,” but it doesn’t seem to work as expected.
The goal is to split the video every 10 seconds and ensure proper video fragmentation. However, the fragment-duration property in “muxer-properties” doesn’t seem to work as intended.
I would greatly appreciate your help in resolving this issue and providing a solution. If you have any insights or suggestions, please let me know.
I’m no expert, but I think your issue occurs because the encoder doesn’t have a GOP size defined.
In that case, the splitmux element can’t actually split the video because the new file won’t start with a key frame.
Please try to set x264enc tune=zerolatency key-int-max=30.
If that works, you can obviously replace 30 with the key frame interval you want. I just assumed you are running in 30 FPS, and a key frame once per second is fairly normal.
The splitmuxsink element’s purpose it to split a stream into file parts/fragments based on max duration or file size, in such a way that the files can be played individually. It’s mostly been written to work with muxers that don’t support splitting natively, such as MP4 or Matroska.
If you use mp4mux with the fragment-duration property set it will do the fragmenting/splitting itself. So you basically have two elements that try to do splitting here. I guess the purpose is to get a new file on each split.
In any case, if you want to create fragmented MP4 files (fMP4) like for DASH/HLS, you should use one of the new fragmented mp4 muxers here: fmp4 (cmafmux, dashfmp4mux, isofmp4mux).
I am using GStreamer 1.14 and Linux 18.04 for my project. I want to know if I can use the fmp4 elements with the splitmuxsink element to split the video into segments of 10 seconds each. I also want to know how to install and use the gstremar-rs library.
Note: Each 10-second video segment should have a fragment data (moof, moov) for every 2 seconds of the segment.