sync-signal.com audio, video, electronics and code

27Dec/090

Recording Videos with Fluxus

Once you've created an awesome Fluxus sketch you're going to want to show the world. With a copy of ffmpeg this is a pretty quick and easy task.

Prep

Firstly you're going to want to install ffmpeg.

sudo apt-get install ffmpeg

If your workflow is anything like mine you more than likely have an MP3 you want to visualize. Unfortunately Fluxus can't process MP3s so you'll need to convert it to a WAV like so.

ffmpeg -i source.mp3 source.wav

Dumping the Frames

Now, in ~/.fluxus.scm you're going to want to comment out your start-audio call, and append this to the bottom of the file. What does this do you ask? Well, firstly you call start-audio and set up your buffer size for the desired FPS, to calculate it you want to use the formula <sample_rate>/<desired_fps>. In this example I've gone with 25fps, 44100/25 = 1764. Then you tell Fluxus where the WAV file you wish to process is located. Finally get Fluxus to dump each frame to a JPEG.

(start-audio "system:capture_1" 1764 44100) ; 44100/25 FPS = 1764
(process "/home/xin/Fluxus/Recordings/09-12-27/source.wav")
(start-framedump "frame" "jpg")

Now launch Fluxus and wait until everything stops moving. Here I've told Fluxus to open up in 720p and to execute and hide 'sketch.scm'.

fluxus -x sketch.scm -geom 1280x720

Convert to Video

Finally, convert the JPEGs and WAV to an AVI. Specify the two input sources (audio and video), the framerate and the output file.

ffmpeg -r 25 -i frame%05d.jpg -i source.wav output.avi

Here you may want to play around with additional ffmpeg arguments to improve the video quality or cut any dead space from the start/end.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.

Recent Posts

Tags

Electronics Equaliser Fluxus Guide JACK Karmic Live Coding lucid PIC PICkit2 Project Projects Pulseaudio Python StagFS TVRage TVSlurp Ubuntu Undrawing Usenet Video

Archives

Blogroll