29.12.24
The [pix_record] object for GEM within pure data allows you to record movie files. I'm not a windows or mac OSX user but on those platforms you can use the apple quicktime backend to record in various video formats. This should be straight forward to achieve using the help panel... just create a pix_record object in the normal way. Right click on it to open the help panel and experiment with different file extensions like .mp4, .mov or .avi.
I want to record video from Pd and GEM on GNU linux (debian based) computers but there is no video back end for saving .mp4 video's as far as I can find. I don't want to save raw video and I don't know how to use the available video backends. All my other VJ video loops are .mp4 so I would ideally like to record directly to .mp4 at a decent quality and resolution so I can re-process the video's.
The solution I have now figured out is a bit convoluted but it works and might open you up to other creative possibilities including live streaming your audio visuals and overlaying content ontop of your visuals. Using the
Install Pd and GEM from source on debian systems using these instructions which should enable the v4l2 backend (or v4l2loopback. This is a mechanism for sharing a video buffer that can be integrated into OBS Studio which * can * save mp4 video's.
I took a lot of inspiration from this blog post which recommends downloading purr-data or possibly even pd-extended. I would not recommend this options personally because I think its worth using pd-vanilla and the cons outway the pro's of using purr-data. You get nice fancy curved patch cables but you are also running a much heavier and complex application that is out of sync with the core pd-vanilla open source work.
I managed to get this to work using his patch he provided and the only object I needed to change was a counter which was trivial.
Install OBS Studio
Install pd and GEM from source (or via package manager)
Open this this patch and update it to add a [i] -> [+ 1] counter or just add a number object instead
Install and enable v4l2
sudo apt-get install v4l2loopback-dkms sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="test"
Determing the video descriptor and adapt the message within the patch.
ls -1 /sys/devices/virtual/video4linux
Mine came up as /dev/video0 but yours might be different. Update the patch accordingly
Open the "gem-record-example.pd" patch and open the GEM window. Bang the record message to start recording.
Open OBS Studio and create a v4l2 source. It should pick up the visuals and display them. Configure the output rectange within your window.
Configure the OBS Studio output video settings to your required quality and resolution settings.
Press "record video" within OBS Studio.
I made a .gif of the one of my test video's where I layered the screen capture of the patch and the spinning cube seen above. Don't worry the .gif converter made it pixellated.. the video output can be as good as your resolution configuration and OBS video settings. You can also incorporate audio via jack and live stream audio visuals from pure data or other applications with the visuals.