This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Linux
Hi
Can i save a video for every 10mins periodically (i.e, 6videos for an hr) using GST pipelines if so,
can you please help me how to do that.
It is possible to save one file.
Thanks,
Jahnavi
Hello,
jahnavi mallpragada said:It is possible to save one file.
Yes. The element to save in single file is filesink location=/path to file/name of the file.
jahnavi mallpragada said:Can i save a video for every 10mins periodically (i.e, 6videos for an hr) using GST pipelines if so,
can you please help me how to do that.
Yes.
Please what is the full use case? Is it capture->encode->save in file?
BR
Margarita
Hello,
jahnavi mallpragada said:Can i save a video for every 10mins periodically (i.e, 6videos for an hr) using GST pipelines if so,
You could try multifilesink element but set properties next-file and max-file-duration and location of course. You could check the multifilesink's properties by executing this command gst-inspect-1.0 multifilesink
Let me know if this helps or if you have additional questions.
BR
Margarita
Hello,
I am sorry but your pipeline will fail.
Please, here is example that you could try on my side it is working:
gst-launch-1.0 -e v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! tee name=t ! queue ! ducatih264enc intra-interval=1 ! queue ! h264parse ! splitmuxsink location="save%d.mp4" muxer=mp4mux max-files=10 max-size-time=60000000000 t. ! queue ! kmssink -e
gst-launch-1.0 playbin uri=file:///home/root/test/save1.mp4
...
Execution ended after 0:01:00.006332604
...
Here is the information about this pipeline and the settings that I have used:
- v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! ...
The camera on my side provides the resolution, framerate and format that are set in the capsfilter.
- vpe num-input-buffers=8 is used since the encoder requires on his input NV12 format but my camera provides YUY2.
- tee element will split the pipeline to two branches.
-first branch is the encoding branch. Please notice that after the encoder there is a parser element.
-I have used splitmuxsink element. This element will slit the video every 1 min(60000000000 this value is in nanoseconds), will save max 10 files and will mux the video into mp4 container.
You could check here for more information:
gstreamer.freedesktop.org/.../gst-plugins-good-plugins-splitmuxsink.html
-Second branch is the display branch.
Hope this helps.
BR
Margarita