trying to play some videos with the new processing and I'm having some troubles finding a compression setting that consistently works. I am currently using h264 mp4's and I get a java warning:
'gstvideo: failed to get caps of pad playsink1:video_raw_sink
gstvideo: failed to get framerate property of playsink1:audio_raw_sink'
and the video does not play. It seems like it may be an issue with trying to capture the duration property of the video. It seems to play when I don't track the progress.
I'm working on an application and would like to receive multiple touch events from windows 8. I have found a few libraries that seem to get at what I am trying to do, but they are all built for Processing 1.5 and because of a few new features of 2.0, I would need to use the beta for my purposes.
The two libraries that I have found are mt4j and simpletouch, both of which do not work in 2.0.
Is there a 2.0 library that anyone could suggest or point me in the direction of where to find this info?
Opening and running the example gsvideo for Pipeline > Raw give an Unsatisfied Link Error:
GSVideo version: 1.0.0
Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: Could not load library gstreamer-0.10
at org.gstreamer.lowlevel.GNative.loadWin32Library(GNative.java:83)
at org.gstreamer.lowlevel.GNative.loadLibrary(GNative.java:43)
at org.gstreamer.lowlevel.GstNative.load(GstNative.java:42)
at org.gstreamer.lowlevel.GstNative.load(GstNative.java:39)
at org.gstreamer.Gst.<clinit>(Gst.java:97)
at codeanticode.gsvideo.GSVideo.initImpl(Unknown Source)
at codeanticode.gsvideo.GSVideo.init(Unknown Source)
at codeanticode.gsvideo.GSPipeline.initGStreamer(Unknown Source)
at codeanticode.gsvideo.GSPipeline.<init>(Unknown Source)
at Raw.setup(Raw.java:40)
at processing.core.PApplet.handleDraw(PApplet.java:2103)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:190)
at processing.core.PApplet.run(PApplet.java:2006)
at java.lang.Thread.run(Thread.java:662)
GStreamer by default installs in the x86 Program Files directory, which is generally where 32 bit apps go, I copied the entire gstreamer folder into the "Program Files" directory folder, and updated my path variables to point to that version. Same results.
Anyone have any insight to this? I've scoured the interwebs for a x64 installer for GStreamer, but it seems that there are only instructions to build from the sdk, which I've tried without success.
Has anyone built the 64bit version of gstreamer that I could get my hands on, or have any advice on how to get this to work in a pure-64 bit setup? or point me in the right direction at least :)
Just wrapped up a project using the 2.0beta (loving the new version btw) and went to export and found the windows 64 output is now a .bat file rather than an .exe. This is fine, but it seems that the .bat file does not open, a cmd window opens and immediately closes. I think something is printed out in the window but it closes before I can read it.
It was necessary to crank the ram usage up to 4gb for this project, so I need to use the 64 bit version, the 32 2gb limit (really more like 1300MB in practice I have found) gets used up and crashes quickly. The development process has worked very well in 64 bit mode, but it seems like I may have to create my own bat file to get the application to run.
I am experiencing a crash in the JVM when dealing with PImages. I believe I have isolated the problem down to the resize() method, inside a class that extends Thread, when using the OPENGL renderer. It's kind of a long series of steps to reproduce, but each the resize, thread, and opengl are needed for the rest of the application. Im using the 2.0a8 release, so I realize bugs are going to be a reality, but it shouldn't be crashing the jvm :)
Here's a little test sketch that illustrates the problem:
Taking out the OPENGL, the resize() or the Thread seems to solve the problem, but OPENGL is necessary for other parts of the app, I would like to resize the image, and threadding is necessary to load images without halting the application.
Perhaps there is another way of resizing the image? Or maybe this warrents a bug report. Has anyone else experienced this?
In the process of working on a project that involves loading data and images from a cookie protected server, and I thought I'd share some of my findings. We are working with a custom installation of Jive (
http://www.jivesoftware.com/ a corporate social networking system) on our clients server.
I need to load activity streams and and other data feeds from their system. The catch is that they have overridden Jive's regular way of logging in users and have their own OneLogin system. So when you go to their Jive install, you are redirected to a OneLogin page that you enter a password, then redirected back to Jive which checks the cookies and lets you access information.
Jive has a nice rss system for all the data, however for security they have turned that functionality off, so I am using the REST api to get json files of the data to be loaded. But, the REST api also requires a user to be logged in. This requires me to pass a cookie (JSESSIONID) into my requests. This works great.... about 1/4 of the time :/ so to get around this limitation, I ended up asking for the json file until I get it; if it fails, it tries again. This pounds their server with requests, which is undesirable, but ends up working pretty reliably.
Another consideration is that I need to update the content as regularly as possible to feel like a live view of their activity. So all this loading happens on a thread that I can keep calling ever 5-10 seconds without disrupting other parts of the application.
Part of these Activity posts in Jive is the user's avatar image, and sometimes images they have posted. Initially I thought 'no big deal, loading images is easy in processing,' but, the url's to the images that is loaded in the json file are not .jpg/.png/whatever, they are server requests, which the server responds with base64 strings. So I was getting these strings and using a byte array to translate them to PImages. Then it gets frustrating. Most of the images I was trying worked great, but then I came across a few that had malformed headers. they had both jpeg and exif data, which apparently causes errors in the BufferedImage IOreading I was using. my workaround for this was to simply save the byte array to a local .jpg using saveBytes(), then load that saved image back in. For some reason this works great! :)
Anyway just thought I would share my findings and some code snippets in case anyone else was facing similar issues. so here's my cookie-passing html loading code:
Which you call by loadJson("rest/string/here", true); with a rest string as the first param.
I leave my httpClient open at the end of this loading so I can continue using it in my future update calls and for my image requests, which are done like this:
Which returns the pimage to the string that was passed. the commented bits show how I was previously converting the byte array to a PImage, but it seems like saving it locally then loading back seems to be more robust.
Sorry if that got a bit rant-ish, been working around the limitations of their REST api and specific installation for a few days now. hopefully some of this helps someone. Or if you have any suggestions on any of the process I'd love to hear!
Working on a project with live video streams, came to decide that GSVideo GSPipeline and VLC's Gstreamer functionality would be a good workflow. Eventually ill set it up using vlc's command line tools to streamline the process.
After a lot of (somewhat blind) trial and error I found a solution that actually works! I start up a capture stream in vlc, grabbing my screen at 5fps, and sending through http on my local ip address, encapsulated in MPEG 1, with the video transcoded as mp2v 512kbps. This stream is then captured in processing with the GSPipeline Capture example with this string:
However, it seems that the refresh rate is somewhat inconsistant sometimes I see changes within a half second, other times it is more like 6-8 seconds before updates, sometimes even longer.
Are there adjustments to either my vlc server or the processing client that could make for a more reliable solution? I think in the end I will put the pipeline reading and updating on a seperate thread to reserve power for other parts of the application, but I would like a closer to realtime video stream if possible.
A project I finished last summer, but just got the video uploaded. Since the initial 8-monitor version, the company has installed three other 3-monitor versions (3x 1920x1080 in landscape) in other locations worldwide, and has plans for more.
The goal of the global wall is to bring together the different channels of communication that happen at Steelcase. Articles are the voice of the company, relating both to events happening around the world, as well as upcoming products and services. Photos or a video can be added to an article to give a viewer more than words alone. The social stream pulls in the a specific Steelcase WorkCafe Twitter feed, giving the employees, customers and the public a chance to talk back. The world outside of the company is pulled in from news headlines from various media outlets. Business doesn’t happen at the same time everywhere Steelcase is represented, the locations on the map show this abstraction in the form of clocks that change color depending on the time of day in that place.
To keep the information fresh and relevant, the articles on the wall are updated using a content management system. Updates can occur daily, or scheduled in advance to feature an upcoming event. The application itself was custom built with Processing, pulling in daily updates to the stories and news, along with instant social feedback. The eight monitors are connected to a single computer, providing the power to animate the information in real time.
---------- technical stuff --------
The computer driving the wall was custom built as a very powerful machine, with a quad core processor, 12gb of ram, a solid state hard drive and two ATI Radeon HD 6000 series video cards. The video cards support 5 monitors each through two DVI, two display ports and one hdmi port allowing for the eight monitors for the wall and a service monitor with the computer.
The custom application was built with Processing ( processing.org ), which is an open source programming language built on top of Java. We used a variety of libraries to add functionality to the application such as Twitter integration, handling of HD video & images, OpenGL to name a few. The end display was 6144px wide by 1366px tall.
I recently finished a project for a client (picture at the end of this post:
https://forum.processing.org/topic/limits-of-processing) that they have decided to take international. We are planning a German, French and Chinese translated version of the application that will run in those locations.
I have tested the various characters of the languages in my current code to ensure they will display properly, and they all seem to work well. We have also worked out the content management to work in a streamlined way.
It seems like this is a pretty simple setup to duplicate (we have already made one smaller version of the application in NYC) are there any unforeseen obstacles I could encounter (and hopefully test ahead of time) with the application running on a computer in a different country. Of course the power plugs and potentially network setups may be different, but is it more complicated than installing windows in a different language, installing the application and sending the cpu off?
I am using the gsvideo lib to play a large background video scaled 2x. I play the video through once, then hold the last frame in the texture while other parts of the app animate, then the video resets and we go through the process of playing again.
However, it seems that sometimes, the second (or third, fourth, maybe not at all) the video stalls partway in (also inconsistant). Because other classes are waiting for the video to finish, the entire app halts. No errors, the video seems to just pause. I have even gone as far as to tell the video to play each frame it loads.
When the video is finished, I stop it and delete, then set it to null. when it replays I make a new GSMovie object. maybe this isn't necessary, but it seemed to make it work more often.
So Im wondering if the format of the video is a problem, it is currently a h264 mov file at about 3000x600 (for a large video wall, these dimensions are actually only half size) is there another format that works more consistently? or is there a way to tell the movie to keep playing? is my telling it to play each frame killing it somehow?
I can give some code, but there are a lot of dependancies, really if you have a way to replay a gsvideo, that seems like my main issue.
Im using the ijeomamotion tween library to handle the movement of some PGraphic objects on the stage. I am using the TweenSequence class to setup three (intro, across, and outro) tweens to play in sequence for each object. have three different objects I want to animate so I have an Array of TweenSequences that holds each of the sequences for the different objects. each object is taking a slightly different path and has slightly different timing, so it is important to keep them septate. then in the draw loop I loop through the tweensequences and move the object they are attached to.
and in my draw loop I grab the current tween of the sequence and the position of that tween, then calculate where the object should be and finally draw the object to stage.
the problem is, it seems like on occasion, the current tween of the sequence gets reset before the position is reset. here's the println trace that is happening to describe the problem:
...
//all going well, animating nicely
Current time : 32.871094
Current time : 32.9472
Current time : 32.983295
Current time : 32.9967
Current time : 32.999794
//about to have problems
Current time : 66.0 //this is the end value for the next tween in the sequence
Current time : 66.0 //and again
//back to normal here
Current time : 33.03256
Current time : 33.073227
Current time : 33.130108
Current time : 33.20314
Current time : 33.29226
...
if it happened once, I could maybe understand maybe it sets the current tween on one draw loop then grabs the value the next loop, but for it to happen twice in a row seems strange.
Im using the GSVideo lib to play a video with alpha in one of my sketches. the video, admittedly, is very large in dimensions (5464x384) but it sometimes plays flawlessly and others gives me this error:
sometimes multiple times, and the video freezes. I have my ram set to 1024, and processing will not seem to run at all if I set it any higher than that ('could not run the sketch' at 2048, can't load libraries @ 1536)
I would be ok if the video had to drop frames, but it needs to continue through to the end.
ive been developing an app on my mac, using the JDialog and JEditorPane classes from java. everything works great on my machine, but when I transfer to the windows machine that the app will end up running on, I get an Exception error on almost everything in my JDialog class. I don't get import errors so I am pretty sure I have the jar files.
Is there a windows version of these files that would work differently? what am I missing?
Ive been working all day with no problems, but suddenly I am getting errors about having to call textFont() before any text(). Im fine adding it, but when I do I get another series of errors about using a library that is not compatible with this version of processing:
Exception in thread "Animation Thread" java.lang.NoSuchMethodError:
at processing.opengl.PGraphicsOpenGL.bindTexture(PGraphicsOpenGL.java:821)
at codeanticode.glgraphics.GLGraphics.renderTriangles(Unknown Source)
at processing.core.PGraphics3D.endShape(PGraphics3D.java:633)
at processing.core.PGraphics.endShape(PGraphics.java:1153)
at processing.core.PGraphics.imageImpl(PGraphics.java:2293)
at processing.core.PGraphics.image(PGraphics.java:2182)
at processing.core.PApplet.image(PApplet.java:7280)
at C12$Tweet.drawTweet(C12.java:777)
at C12$TwitterStreamThread.moveDown(C12.java:907)
at C12$TwitterStreamThread.newTweet(C12.java:892)
at C12$TwitterStreamThread.getTimeline(C12.java:855)
at C12$TwitterStreamThread.<init>(C12.java:840)
at C12.setup(C12.java:105)
at processing.core.PApplet.handleDraw(PApplet.java:1402)
at processing.core.PApplet.run(PApplet.java:1327)
at java.lang.Thread.run(Thread.java:680)
From what I can tell, this error is thrown when I try to draw a PGraphics to stage with image(). is there some issue with using fonts in PGraphic buffers? is there a way around this?
Im trying to grab a .json file from a password protected drupal database and can't seem to find anything about how to add usernames and passwords to http requests.
Im trying to allow the parsing and displaying of a subset of html, specifically some basic text elements such as <p>, <b>,<br> and other text styling tags to allow simple styling from an external .html/.txt file.
Ideally it would work similarly to htmlText in as3.
Im working on a project that is going to use many components, one of which will be video. I have experimented on a few of the video libraries out there and it seems like GSVideo is the most effective (not resource intensive).
I would like to be able to play an HD video file (1080 would be great, but would settle for 720) but I can't seem to get better than 15 fps playback. I currently am using an h264 compressed mov file, but have experimented with mp4, avi, m4v and ogg formats with various bitrates with similar results.
Does anyone have recommendations on compression settings to use or a library that will work more consistently?
I have been asked by a client to produce a video wall. The final installed piece will be 8 monitors mounted in vertically, in a row, driven by one powerful computer. We have a computer with two video cards that can output the 8 displays and handle the cms system we have planned. Our concept involves a particle system working as the background, and various news and rss feeds displaying text, images and videos at determined times across the 8 screens.
We have chosen to explore Processing as a possible solution for driving the visuals for its ability to output very large sketches and ability to process a large amount of data, however, with our limited experience with the language, I'm not sure that it is the right solution for this project.
Has anyone had experience with projects like this? examples, or at least knowledge that our goals can be achieved?