Hi, I’m displaying a video from v4l2src in a waylandsink and while I’m doing that I want to dynamically record the video to an mp4. I want to allow a user provided input to determine when to start recording to an mp4 and when to stop the recording. The recording pipeline I’m currently using is:
gst-launch-1.0 v4l2src ! vpuenc_h264 ! h264parse ! mp4mux ! filesink location=sample.mp4 -e
I tried connecting the recording pipeline to a tee and then deleting it when I’m done recording and I was able to get video to record but that approach causes problems after starting and stopping recording multiple times. Does anyone know a way I can approach this, preferably by just pausing the recording section of the pipeline?
Solved! Go to Solution.
Hi @itaigolan,
I would implement a gstreamer Tee that sinks in an Appsink. After that, every time a new recording event occurs, I will start a recording pipeline using Appsrc. This would be my best bet.
You might alternatively look at Ridgerun Interpipe that can do similar stuff:
https://developer.ridgerun.com/wiki/index.php/GstInterpipe_-_GstInterpipe_Overview
Using pause or start/stop does not work well with MP4 because MP4 needs a proper file header that contains all key frame positions of the stream. A more robust file format for this is Mpeg-TS. H.264 elementary stream embeds very well in *.ts files and TS muxer are available in stock Gstreamer.
Hi @itaigolan,
I would implement a gstreamer Tee that sinks in an Appsink. After that, every time a new recording event occurs, I will start a recording pipeline using Appsrc. This would be my best bet.
You might alternatively look at Ridgerun Interpipe that can do similar stuff:
https://developer.ridgerun.com/wiki/index.php/GstInterpipe_-_GstInterpipe_Overview
Using pause or start/stop does not work well with MP4 because MP4 needs a proper file header that contains all key frame positions of the stream. A more robust file format for this is Mpeg-TS. H.264 elementary stream embeds very well in *.ts files and TS muxer are available in stock Gstreamer.
Thanks for the response, I got good results using the appsink approach.
what processor and bsp version do you use? and what kind of problem do you have?
The processor is imx8mp and we are running Mickledore. My question is how do I set up a system where I can dynamically start and stop video recording while constantly displaying the video on a waylandsink.