# GStreamer for recording live video

**URL:** https://discourse.processing.org/t/gstreamer-for-recording-live-video/31573
**Category:** Libraries
**Created:** [August 4, 2021, 9:59am UTC](https://discourse.processing.org/t/gstreamer-for-recording-live-video/31573 "2021-08-04T09:59:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![StainlessHolz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/stainlessholz/32/13542_2.png) [@StainlessHolz](https://discourse.processing.org/u/StainlessHolz)
#### Post date: [August 4, 2021, 9:59am UTC](https://discourse.processing.org/t/gstreamer-for-recording-live-video/31573/1 "2021-08-04T09:59:34Z")

</div>

Hi everyone,

Ive made a sketch witch decodes a full HD h.264 camera livestream, displays it and puts a overlay on it.  
To this point everything works fine and fast using the P2D renderer.

Now i need to record this video, preferably also with h.264.  
Ive already tried the external ffmpeg solution by hamoid:

> **[Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/8994/real-time-video-export-from-processing)**
>
> Processing is an electronic sketchbook, a language and a worldwide community. This is its forum.

But this solution is very slow and not usable for live video.

Now my thought is on GStreamer. I understand that it is possible to use it to do exactly what i need although not knowing if it is fast enough.  
I already use GStreamer in my sketch with the video library and a latency modification provided by neilcsmith:

> [@Reducing latency when capturing and displaying an RTSP stream](https://discourse.processing.org/t/reducing-latency-when-capturing-and-displaying-an-rtsp-stream/26531/3):
>
> No it isn’t! Only just seen this post. The buffering comes from GStreamer defaults. For some reason I can’t get the Capture pipeline: url to work with an rtsp pipeline at first attempt - I think there’s a fix missing in the released Video library at the moment that would allow this. However, it’s possible to set the latency on the rtspsrc inside the Movie’s PlayBin. This would be a little easier if Video had a recent version of our bindings, but this should work - import processing.video.…

It works very fast and nice.

And now my problem:  
I dont know exactly how to start or how to do it.  
I had a look into the gstreama-java google group:  
[https://groups.google.com/g/gstreamer-java](https://groups.google.com/g/gstreamer-java)  
But honestly, i didnt understand much. Does anyone have a tutorial or a description?

Kind regards,  
StainlessHolz
