openFrameworks-RaspberryPi / openFrameworks

This repo has migrated into the openFramworks core! Please go to http://github.com/openFrameworks/openFrameworks for the latest!
http://github.com/openFrameworks/openFrameworks
Other
104 stars 11 forks source link

video player glitch / playback problems when using ofxArtoolkitPlus #110

Open kalwalt opened 11 years ago

kalwalt commented 11 years ago

Istantanea - 09012013 - 23:06:46 i tested the ofxArtoolKitPlus addon https://github.com/fishkingsin/ofxARtoolkitPlus when i set to video mode i get a video glitcy and segmented . The video is a .mov 640x480 pixel. i will post a screenshot of the video for reference. videoPlayerExample works fine for me instead, but res is 320x240. Does happens also on rpi?

kalwalt commented 11 years ago

this is what is displayed instead on a linux64 bit machine. on the left the .mov video and on the right the openCV grayThresolded video. Schermata del 2013-01-09 23:12:46

bakercp commented 11 years ago

If you play the same video in the normal ofVideoPlayer example do you get the same glitches? Could you post a link to the vid?

bakercp commented 11 years ago

Got the vid here: https://github.com/fishkingsin/ofxARtoolkitPlus/blob/master/example/bin/data/marker.mov

bakercp commented 11 years ago

RPI segfaults on that video as it is using the standard videoPlayerExample. I re-exported it in QT on OSX using H.264 (which it already was supposedly) and it worked the first time. I think the gstplayer is a little picky ... b/c when I tried it again it segfaulted. Then it worked again. Very unpredictable.

kalwalt commented 11 years ago

this is from videoPlayerExample and the marker.mov Screenshot from 2013-01-09 23:34:20 the issue not happens but stranges border . i have to try without the other code here. Strange the rpi issue, also strange the issue below with the video and OpenCV together...

bakercp commented 11 years ago

@kalwalt well, in any case, you've created a lovely artwork with that last post :)

kalwalt commented 11 years ago

And ofxARToolKit addon example with 640x480 video grabbing instead works well (but not so many fps..)

@kalwalt well, in any case, you've created a lovely artwork with that last post :)

yes, NY MOMA is crazy for this!

tomorrow massive testing!

arturoc commented 11 years ago

the borders are because the hw accelerated plugin of gstreamer returns padded images and the gstreamre implementation in OF is not able to remove them yet. actually the hardware accelerated version is slower than the software one so if you remove those plugins you'll get the correct video and faster playback

kalwalt commented 11 years ago

thanks for the answer @arturoc , i forgot to mention that also the image ( the OF logo .jpg) it's not displayed when the app is in live mode probably for the reason explained in this issue :https://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/42

and about the issue in the first screenshot?

arturoc commented 11 years ago

the first screenshot seems like it was returning rgb and being rendered as grayscale or rgba as rgb or something like that

fishkingsin commented 11 years ago

just tested RPi with arottlkitplus works fine

http://vimeo.com/57516383 but funny thing is the cursor was transformed by AR matrix

bakercp commented 11 years ago

@fishkingsin very cool. On RPi, the cursor is rendered as a part of the ofAppEGLWindow (it's just an embedded texture @arturoc made) and is subject to the global model/view matrices. So, when you applyProjectionMatrix() and applyModelMatrix() the cursor is subject to those transformations as well. If you want to make sure the cursor is undistorted, make sure you save a reference to the standard model / view matrix and restore them at the end of your draw / render loop (the cursor is then rendered between draw loops).

I'm currently looking at ways to put the cursor in it's own EGL window that is not subject to the transforms. Others have done this in the RPi world. I just need to get a free minute :)

Also, there's no reason currently to use X11 (via startx) to run your programs. It's not needed on the RPi because we are using a custom non-x11 window system (we create our own bare-metal window). By not using X, you can save a little ram.

danzeeeman commented 11 years ago

@kalwalt is this still an issue?

kalwalt commented 11 years ago

@danthemellowman i should test it again. I haven't looked again. i will check whan i have a bit of time.