Hello,
I’m trying to save an RTSP stream (at a certain key frame) to a mp4 file so I drop first few frames and key frame; the issue I’m running into is my resultant mp4 file does not have a duration and is not seekable. This seems to be because the rtsp camera somehow has caps framerate=(string)0/1 which means FPS isn’t set.
Here is my setup:
pipeline 1: rtspsrc ! … ! h264depay ! h264parse ! appsink
pipeline 2: appsrc ! … ! h264parse ! mp4mux ! filesink
so essentially appsink is handing over GstSamples to appsrc starting at a key frame and appsrc pipeline is saving the frames to file.
interestingly, if I run gst-launch-1.0 -e rtspsrc ! … ! h264parse ! mp4mux ! filesink then despite the caps of framerate=0/1 the resultant mp4 file has duration and is seekable. I did notice in logs a-framerate=30.0 before framerate=0/1 in caps eventually.
How can I ensure my mp4 file has duration and is seekable?
Thank you very much!