Giter VIP home page Giter VIP logo

ofxomxplayer's Introduction

REQUIREMENTS:

CURRENT KNOWN MAJOR ISSUES:

Videos with and audio track (even silent) work best and allow more accurate looping/frame tracking

DESCRIPTION:

This is an openFrameworks video player addon for the Raspberry Pi. The video player is hardware accelerated and can provide textures to openFrameworks to be used for shaders, etc.

USAGE:

Use Releases unless you are contributing or looking for bleeding edge. Releases contain tested versions that work for specific versions of openFrameworks.

Clone into openFrameworks/addons

There 2 modes of Playback, Direct (aka Non-textured) or Textured.

Direct:

  • Renders directly to the screen, no texture access or pixels. This is most similar to what you will see in omxplayer
  • By default is played fullscreen video
  • OF is still able to run other processes in the background.
  • 1080p video playback is typically good

Textured:

Allows the use of

  • shaders
  • pixel access
  • drawing overlays
  • 720p video works best here

Audio:

  • Yes

Headphone jack may require this tweak:
https://gist.github.com/jvcleave/4972661

To use HDMI Audio you may need to add the below line to /boot/config.txt and reboot. See http://elinux.org/RPiconfig for more details

hdmi_drive=2

EXAMPLES:

example-basic:
Playback of video in texture mode (default)

example-texture-mode:

Playback of video in texture mode (default)

example-direct-mode:

Playback of video in direct mode (no textures/pixel access)

example-multiple-players:

Simultaneous playback 2 videos in non-texture mode

example-playlist:

Playback of a folder of videos in texture mode

example-pixels:

Example of pixel access that is needed for OpenCv operations/Saving images, etc

example-http-stream:

plays network streamed video

example-shader:

Use of shaders

example-playback-controls:

tried to keep these close to omxplayer

example-wrapper:

ofRPIVideoPlayer extends ofVideoPlayer in hopes to be a drop in replacement for ofVideoPlayer,

There may be other examples in Master branch but the above are most likely to remain

COMPRESSION RECOMMENDATIONS:

CREDITS:

Majority of the code is based off of https://github.com/popcornmix/omxplayer

See COPYING for license details inherited from omxplayer/xbmc

Test video files from: http://www.bigbuckbunny.org/index.php/download/

REHAUL NOTES:

I have basically rewritten the underlying engine in order to keep as close to omxplayer as possible. It seems to be about the same performance-wise. Noticeable changes are better looping and audio. This addon should play most files the same way as omxplayer. ofxOMXPlayerEngine is basically omxplayer.cpp with additions to support the openFrameworks model and textures.

This addon no longer has static/custom compiled versions of libav.

I closed all the previous issues as I won't be doing anything to the old code.

TODO: I still need to port back some of the direct mode display options and some stuff around the filters. There is also some functionality missing around switching the audio settings at runtime.

ofxomxplayer's People

Contributors

arturoc avatar avilleret avatar bigfatbrowncat avatar cyrcom avatar drfuzzyness avatar jvcleave avatar pierrep avatar timonsku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ofxomxplayer's Issues

Implementation of Video Speed Control

Hi jvcleave,
I want to ask if it is possible to add there function to adjust current video speed. It would be nice if I can sometimes to slow down or speed up the video playing speed.
Is it difficult to do that ?

Threaded init routine for start playing new video file

I usually play several small video loops at one time. When I start new video loop it freeze for a short time all currently playing videos, because the initialization of a new video takes a time.
Do you plan to do threaded version of initialization routine for start playing new video file ?

example-basic would not compile anymore

Since I picked the new sources today ( 21 March 2014 ), the example-basic would not compile anymore.
I've copied the src and libs folders to addons/ofxOMXPlayer/
and the example-basic folder to apps/myApps.
When doing "make", I'm getting many errors like that one:
../../../addons/ofxOMXPlayer/src/ADDON_DEFINES.h:206:2: error: time_t does not name a type.

What is the (new) proper way to compile the examples?
Used to work fine with teh github version from a few weeks ago...

Issue using ofxOMXPlayer in non-textured mode in order to play randomly 1080p videos

Hello,

I'm new to c++, openFrameworks, and ofxOMXPlayer, and can't find a solution to my problem ... I tried pretty much everything I thought could work and searched a lot around, but since I'm just an amateur programmer (I've done a few projects with processing, javascript, and OF), I think I can unpurposely make some clumsy things ...

I've made a code to read videos in a random order, with a simple rule to not have two identical videos running next to each other.
I got it running fine on a win PC with the classic ofVideoPlayer, and for some reason there was some lag in transitions on mac (even with the platform specific advanced video player), so I made a version in which videos are decomposed to series of images that are read next to each other by the program, which runs fine, but not on every mac.

Since this program will be used to show videos in an exhibition, a friend of mine suggested that I used the Raspberry Pi and lended one to me, because that way, I can just give the RPi with the functionning program, and avoid any compatibility issue... And I fell in love with it :)

On the RPi, both the videoPlayer method and the continuous images run too slow, but thank god I found your addon !
I managed to play one of my videos fullscreen non-textured (as I will simply display, and want the best performances in HD 1080p) by adapting the examples, but I don't understand everything that goes on with some command lines, and can't manage to adapt it to my initial code, in order to play videos next to each other ....
Also, on the first program I made with the ofVideoPlayer I had two instances of the player in order to have one loading the next video while the current plays, to get the best possible transitions. I don't know if it will be possible/necessary with ofxOMXPlayer.
I would really appreciate if you had an idea how to do this and give me some guidelines .. thanks a lot !

Here is what I tried (it runs but after 1st video, plays videos simultenaously and ends up giving me an erro really quickly)...

If you want to see the previous functionnal codes let me know and I will post them :)

main.cpp

#include "ofMain.h"
#include "multiPlayer.h"
//#include "ofGLProgrammableRenderer.h"

int main()
{
    //ofSetLogLevel(OF_LOG_VERBOSE);
    //ofSetCurrentRenderer(ofGLProgrammableRenderer::TYPE);
    ofSetupOpenGL(1280, 720, OF_FULLSCREEN);
    ofRunApp( new multiPlayer());
}

multiPlayer.h

#ifndef MATH_H_INCLUDED
#define MATH_H_INCLUDED

#pragma once

#include "ofMain.h"
#include "ofxOMXPlayer.h"

class multiPlayer : public ofBaseApp{

    public:

        void setup();
        void update();
        void draw();
        //void keyPressed(int key);

        unsigned int totalMovies;
        unsigned int loadingMovieId;

        void playAndPreload();

    vector<ofxOMXPlayer*> omxPlayers;

};

#endif // MATH_H_INCLUDED

multiPlayer.cpp

#include "math.h"
#include "multiPlayer.h"

//--------------------------------------------------------------
void multiPlayer::setup()
{

    ofHideCursor();

    ofBackground(0,0,0);

    //ofSetLogLevel(OF_LOG_VERBOSE);
    //ofSetLogLevel("ofThread", OF_LOG_ERROR);
    ofSetVerticalSync(true);

    //ofToDataPath("../data/");

    totalMovies = 16;
    loadingMovieId = 0;

    ofxOMXPlayerSettings settings;

    loadingMovieId = floor(ofRandom(totalMovies));
    settings.videoPath = "/home/pi/openFrameworks/apps/myApps/velos-videoomx/bin/data/" + ofToString(loadingMovieId + 1) + ".mov";
    settings.enableLooping = false;
    settings.enableAudio = false;
    settings.enableTexture = false;

    if (!settings.enableTexture)
        {
            //We have the option to pass in a rectangle
            //to be used for a non-textured player to use (as opposed to the default full screen)
            settings.displayRect.width = ofGetScreenWidth();
            settings.displayRect.height = int (((ofGetScreenWidth()) * 9) / 16);
            settings.displayRect.x = 0 ;
            settings.displayRect.y = ( (ofGetScreenHeight()) - (int (((ofGetScreenWidth()) * 9) / 16)) ) / 2;
        }

    ofxOMXPlayer* playerOne = new ofxOMXPlayer();
    playerOne->setup(settings);
    omxPlayers.push_back(playerOne);

}

//--------------------------------------------------------------
void multiPlayer::update()
{



}

//--------------------------------------------------------------
void multiPlayer::draw(){

        // Plays the video on playerOne
        ofxOMXPlayer* playerOne = omxPlayers [0];
        cout << "test video en lecture : " << (playerOne->isPlaying()) << endl;
        if (playerOne->isPlaying())
        {
            ofPushMatrix();
                ofTranslate(playerOne->settings.displayRect.x, 0, 0);
                //ofDrawBitmapStringHighlight(player->getInfo(), 60, 60, ofColor(ofColor::black, 90), ofColor::yellow);
            ofPopMatrix();
        } else // actions when video on playerOne ends
        {
            playAndPreload();
            cout << "test : lecture 1er fichier finie" << endl;
        }

    //stringstream fpsInfo;
    //fpsInfo <<"\n" <<  "APP FPS: "+ ofToString(ofGetFrameRate());
    //ofDrawBitmapStringHighlight(fpsInfo.str(), 60, 20, ofColor::black, ofColor::yellow);


}

//--------------------------------------------------------------
//extract from initial code - is launched when a video ends in either player, and after the following video is launched on other player
void multiPlayer::playAndPreload(){

   // get a unique random ID
   cout << "test random Id : " << loadingMovieId << endl ;
   int preloadId = floor(ofRandom(totalMovies));
   while (preloadId == loadingMovieId ) {
      preloadId = floor(ofRandom(totalMovies));
   }
   cout << "test new Id : " << preloadId << endl ;
   // set the loading movie to the new ID
   loadingMovieId = preloadId;

        ofxOMXPlayerSettings settings;

        settings.videoPath = "/home/pi/openFrameworks/apps/myApps/velos-videoomx/bin/data/" + ofToString(loadingMovieId + 1) + ".mov";
        cout << "test new path : " << settings.videoPath << endl ;
        settings.enableLooping = false;
        settings.enableAudio = false;
        settings.enableTexture = false;

        if (!settings.enableTexture)
        {
            //We have the option to pass in a rectangle
            //to be used for a non-textured player to use (as opposed to the default full screen)
            settings.displayRect.width = ofGetScreenWidth();
            settings.displayRect.height = int (((ofGetScreenWidth()) * 9) / 16);
            settings.displayRect.x = 0 ;
            settings.displayRect.y = ( (ofGetScreenHeight()) - (int (((ofGetScreenWidth()) * 9) / 16)) ) / 2;
        }
        ofxOMXPlayer* playerOne = new ofxOMXPlayer();
        playerOne->setup(settings);
        omxPlayers.push_back(playerOne);

}

textured mode - tearing issue

Hi jvcleave.
Thanks again for a great work. ofxOmxPlayer is getting better and better.
I have two issues -

  1. I have problem a don't know if there is any solution for it.
    I use player in texture mode and I see some kind of tearing problem. When I use special video files (in means of content) for example white filled circle moving from left to right on black border .There is visible a huge tearing problem. The OpenGL app is Vsync. I think it comes from the situation that video decoder-render thread is rendering to the texture directly but independently on Vsync signal and eglSwapBuffers command. Do you have any idea how this can be solved ?
  2. When movie is looping (texture or non-texture mode) after the first pass it starts playing very quickly. I know that the version from Sep 08, 2013 didn't do that.

onVideoEnd and onVideoLoop not accurate

Hi,
the onVideoEnd and onVideoLoop events are fired too early
regarding the current frame / time of the video.

most of the time those events hare fired 5 to 20 frames before
the end of a 912 frames long video...

i had to reimplement in my script a watchdog

  • if not in loop mode: videoDidEnd when getCurrentFrame() = getTotalNumFrames()-1
  • if in loop mode: videoDidLoop when lastFrameNum > getCurrentFrame()

it's a dirty workaround, but i did not take the time to digg into the code.
I'll post some fix once i did some research.

But are the getCurrentFrame() and getTotalNumFrames() accurate ?

I had some trouble also with getMediaTime() that is some kind of time of living
of the engine and not the time position in the media (doesn't restart when video loop,
and doesn't stop when video end without looping)...

I did reimplement something using
position = .getCurrentFrame() * .getDuration() / getTotalNumFrames()

Do you think it's accurate ?

Thank you
Best Regards,
Thomas

expected performance inside an FBO

Hi !

I'm trying to achieve a smooth and fluid video reproduction in a RaspberryPi2 .
My testApp is drawing the omxPlayer into an FBO, then drawing the FBO to the screen with a ofxHomography matrix multiplication.

If I create the FBO of 1280x720 i get a framerate of 59-60fps.
But if i create the FBO with ofGetWidth() and ofGetHeight() the app runs at 30-35 fps, and the video looks less smoothly playing then with 1280x720.

I'm using OF084 libs, Raspbian 3.18.7-v7+ , OMXPlayer 337004e

This is my memory partition :
$ vcgencmd get_mem arm
arm=624M
$ vcgencmd get_mem gpu
gpu=384M

I do use export MAKEFLAGS="-j4 -s PLATFORM_VARIANT=rpi2".
I'm not playing from X, but from command line .

I don't understand why i'm getting this :
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): screenRect: 1680x1050
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): windowRect: 1680x1050
When I'm using a FullHD monitor (1920x1080) ?
?¿ Seems like it's not detecting the display as a 1920x1080?)

MediaInfo log for my file . The file was rendered with Adobe After Effects.

General
Complete name : /Users/eloimaduell/Desktop/MIES_2015/RASPBERRY_MIES/VIDEO_CODECS/test2.mov
Format : MPEG-4
Format profile : QuickTime
Codec ID : qt
File size : 91.3 MiB
Duration : 1mn 41s
Overall bit rate mode : Variable
Overall bit rate : 7 549 Kbps
Encoded date : UTC 2015-04-06 20:58:45
Tagged date : UTC 2015-04-06 21:01:21
Writing library : Apple QuickTime
©TIM : 00:00:00:00
©TSC : 25
©TSZ : 1

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings, CABAC : No
Format settings, ReFrames : 2 frames
Format settings, GOP : N=1
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1mn 41s
Bit rate mode : Variable
Bit rate : 6 007 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.261
Stream size : 72.7 MiB (80%)
Language : English
Encoded date : UTC 2015-04-06 20:58:45
Tagged date : UTC 2015-04-06 21:01:21
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709

Audio
ID : 2
Format : PCM
Format settings, Endianness : Little
Format settings, Sign : Signed
Codec ID : sowt
Duration : 1mn 41s
Source duration : 1mn 41s
Bit rate mode : Constant
Bit rate : 1 536 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Stream size : 18.6 MiB (20%)
Source stream size : 18.6 MiB (20%)
Language : English
Encoded date : UTC 2015-04-06 20:58:45
Tagged date : UTC 2015-04-06 21:01:21

Other
ID : 3
Type : Time code
Format : QuickTime TC
Duration : 1mn 41s
Time code of first frame : 00:00:00:00
Time code settings : Striped
Language : English
Encoded date : UTC 2015-04-06 21:01:21
Tagged date : UTC 2015-04-06 21:01:21

It's the expected performance loss (from 60 fps to 35 fps) to use a bigger FBO (from 720p to 1080p?)

I've also experienced that drawing a smaller video makes framerate higher ?

I'm not sure if i'm not using a proper sample file or if I've to accept that using a FBO to draw the ofxOMXPlayer might slow down things to this end (35 fps) ?

Related questions ...
· Video Compression ? Better .MOV or .MP4 ?
· Video Compression ? Better 1 Keyframe per frame for a smooth fluid play ?

Mouse cursor appears in corner

I have compiled and ran this on my pi, and running the example-playlist but I get the mouse cursor in the top left corner and I cannot get it to go away, I have tried unclutter but Im wondering if it is another issue. Any help would be appreciated.

Multiple players example in texture mode freezes first image

Hello @jvcleave.

Thanks for this great addon. Really. It's working like a charm. And fast too.
I'm trying to change the example-multiple-players so it uses the texture mode.
I just added this to the ::draw():

player->draw(40 + (400*i), 200, 400, 300);

So that it draws the frames.
But the first movie frame is not refreshing.
Although, both player->getInfo() tell us that the movies are playing. And the second video is looping fine. The first one is stuck on the same frame.

I'v tried lookin in many places but can't find where that might be coming from. Any idea?
Thx.

ADDON_DEFINES.h conflicts with ofxNetwork

The SOCKET_ERROR and INVALID_SOCKET macro seem to conflict with macros of the same name in ofxNetwork. I don't know what these macros are doing so I don't feel comfortable to start changing them. It doesn't seem like it matters that much but you may want to have a look at that.

In file included from ../../../addons/ofxNetwork/src/ofxTCPClient.h:4:0,
                 from ../../../addons/ofxNetwork/src/ofxNetwork.h:3,
                 from src/ofApp.h:57,
                 from src/ofApp.cpp:1:
../../../addons/ofxNetwork/src/ofxTCPManager.h:75:0: warning: "INVALID_SOCKET" redefined [enabled by default]
  #define INVALID_SOCKET -1
 ^
In file included from ../../../addons/ofxOMXPlayer/src/File.h:3:0,
                 from ../../../addons/ofxOMXPlayer/src/OMXReader.h:13,
                 from ../../../addons/ofxOMXPlayer/src/OMXPlayerVideoBase.h:8,
                 from ../../../addons/ofxOMXPlayer/src/OMXPlayerEGLImage.h:2,
                 from ../../../addons/ofxOMXPlayer/src/ofxOMXPlayerEngine.h:16,
                 from ../../../addons/ofxOMXPlayer/src/ofxOMXPlayer.h:7,
                 from src/ofApp.h:56,
                 from src/ofApp.cpp:1:
../../../addons/ofxOMXPlayer/src/ADDON_DEFINES.h:146:0: note: this is the location of the previous definition
 #define INVALID_SOCKET (~0)
 ^
In file included from ../../../addons/ofxNetwork/src/ofxTCPClient.h:4:0,
                 from ../../../addons/ofxNetwork/src/ofxNetwork.h:3,
                 from src/ofApp.h:57,
                 from src/ofApp.cpp:1:
../../../addons/ofxNetwork/src/ofxTCPManager.h:76:0: warning: "SOCKET_ERROR" redefined [enabled by default]
  #define SOCKET_ERROR -1
 ^
In file included from ../../../addons/ofxOMXPlayer/src/File.h:3:0,
                 from ../../../addons/ofxOMXPlayer/src/OMXReader.h:13,
                 from ../../../addons/ofxOMXPlayer/src/OMXPlayerVideoBase.h:8,
                 from ../../../addons/ofxOMXPlayer/src/OMXPlayerEGLImage.h:2,
                 from ../../../addons/ofxOMXPlayer/src/ofxOMXPlayerEngine.h:16,
                 from ../../../addons/ofxOMXPlayer/src/ofxOMXPlayer.h:7,
                 from src/ofApp.h:56,
                 from src/ofApp.cpp:1:
../../../addons/ofxOMXPlayer/src/ADDON_DEFINES.h:145:0: note: this is the location of the previous definition
 #define SOCKET_ERROR (-1)
 ^

Playing audio only files and blank videos with audio

OMXplayer itself handles audio files just fine but ofxOMXplayer refuses playback because of the missing video portion. Can that be fixed? Would be great to accelerate audio playback aswell, the standard sound player is really slow with loading on the pi.

Another thing is that I can't seem to playback videos with just black frames, doesn't matter what encoder I use (always h264 though) I always end up with this error:
[verbose] OMX_ERRORTYPE COMXCoreComponent::DecoderEventHandler(OMX_HANDLETYPE, OMX_PTR, OMX_EVENTTYPE, OMX_U32, OMX_U32, OMX_PTR): OMX_ErrorStreamCorrupt

it plays but at a really low fps of 0-10fps and after ~7-8 seconds of loading time.

Sometimes abort when running loadMovie() in thread

Hi jvcleave.
I'm trying to ask if you have any clue but I know it is beyond the scope of current master branch.
I have two running instances of omxPlayers. I've changed your code to be able to load new video file in thread and thus not to see the little stuck in running parallel video file when changing video files. But sometimes I got error codes from OMX and program abort.
The error codes that I got is

[ error ] m_omx_render OMX_StateExecuting FAIL error:
*** glibc detected *** ./player: corrupted double-linked list: 0xadcb1060 ***
Aborted

or

[ error ] m_omx_tunnel_sched Establish FAIL error:
*** glibc detected *** ./player: corrupted double-linked list: 0xae0e3310 ***
Aborted

I think it doesn't comes with my changes in your code but I know that it has some connection with running loadMovie() function in thread, because when I use non threaded version - it works ok.

Just I'm asking if you have any clue where that error comes from.

change which video is playing with loadMovie(string filename) ?

hi ofxOMXPlayer !

I've been succesffully using ofxOMXPlayer but i'm having trouble to change the video which is playing (without stopping the app).

I tried to make (once an OSC message with a message that tells which video to load ) :

/// LOAD MOVIE
else if(address.find("load")!=-1)
{

    string filename = m->getArgAsString(0);
    int fadeTime = m->getArgAsInt32(1);
    ofVec2f myPos = screenPosition;
    ofVec2f mySize = screenSize;

    cout << "pmOmxPlayer :: OSC :: load : " << filename << " : fadeTime : " << fadeTime << endl;


    omxPlayer->setPaused(true);
    omxPlayer->close();

    omxPlayer->loadMovie(filename);
 }

but the video doesn't get updated ? The app is not crashing, but the new video is not playing ?
I've looked at the "playListApp" example, but seems that is doing basically the same ... so LoadMovie() when needed ?

Am I missing something ?
(i've checked that all the videos that i'm trying to play have same resolution and they all play nicely in the ofxOMXPlayer )

Thanks

flickering and dropped frames

I'm seeing flickering when I play back a movie. It looks like the picture offsets for 1 frame or so. The picture also drops out to black screen every so often and stays that way for about 2 seconds at a time.

I'm playing back h264 1080p movies. Is this the preferred codec?

Don't know if I should open another issue but;
I also notice that the movie plays the correct speed the first time through but then plays at double speed when it starts over. It continues to play at that doubled speed for each loop thereafter.

video compression recomendations ...

Hi !

I've tried to follow the video compression recomendations ... i used MPEGStreamClip in an OSX Mavericks system.

I can't find any way of rendering an H264 codec + PCM audio ?

Maybe my first question would be if the recomendation are for : Quicktime or MP4 file ?
If i choose MP4 and X264 i just can choose MP4-AAC audio ...
If i choose MOV and X264 i just can choose Uncompressed, IMA4:1, MPEG4-AAC. Mpeg Layer2 ...
Is the Uncompressed option a PCM ?

Thanks for making this a bit clearer ...

omxPlayer.getPixels() is half resolution

Hello, I am experiencing unexpected behavior with the function "omxPlayer.getPixels()" from the "example-pixels".

the pixel data collected by "omxPlayer.getPixels()" is only half the resolution of the original video, same with the omxPlayer.saveImage(); function. The image file is created on the correct size but the actual image is half the size of the jpg.
Anyone else experienced this?

Hint:
I'm using ofx 0.8.0 and 2 omxplayers in my scene. The video files resolution is 640 x 360.

built and ran but white video

this is the screen cap
http://vimeo.com/59976283
with password "github"

this is the log
shader works
app works
but the video rendering seems does not work on my Pi
is that video format problem?

[ofAppEGLWindow::setupRPiNativeWindow:notice] screenRect.width==1920, screenRect.height=1080
[ofAppEGLWindow::setupRPiNativeWindow:notice] windowRect.width==1280, windowRect.height=720
[ofAppEGLWindow::createSurface:notice] Setting up EGL Display
[ofAppEGLWindow::createSurface:notice] EGL Display correctly set.
[ofAppEGLWindow::createSurface:notice] ofGetCurrentRenderer()->getType()=GLES2
[ofAppEGLWindow::createSurface:notice] GLES2 Renderer detected.
[ofAppEGLWindow::createSurface:notice] Surface created correctly
[ofAppEGLWindow::createSurface:notice] API Binded correctly
[ofAppEGLWindow::createSurface:notice] OpenGL ES version OpenGL ES 2.0

[notice] GLES2 loading vertex shader from default source
[verbose] Creating GLSL Program
[verbose] GL_VERTEX_SHADER shader compiled.
[notice] GLES2 loading fragment shader from default source
[verbose] GL_FRAGMENT_SHADER shader compiled.
[verbose] Attaching shader of type GL_FRAGMENT_SHADER
[verbose] Attaching shader of type GL_VERTEX_SHADER
[verbose] Program linked.
[ofAppEGLWindow::createSurface:notice] -----EGL-----
[ofAppEGLWindow::createSurface:notice] EGL_VERSION_MAJOR = 1
[ofAppEGLWindow::createSurface:notice] EGL_VERSION_MINOR = 4
[ofAppEGLWindow::createSurface:notice] EGL_CLIENT_APIS = OpenGL_ES OpenVG
[ofAppEGLWindow::createSurface:notice] EGL_VENDOR = Broadcom
[ofAppEGLWindow::createSurface:notice] EGL_VERSION = 1.4
[ofAppEGLWindow::createSurface:notice] EGL_EXTENSIONS = EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_vg_parent_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_lock_surface 
[ofAppEGLWindow::createSurface:notice] GL_RENDERER = VideoCore IV HW
[ofAppEGLWindow::createSurface:notice] GL_VERSION  = OpenGL ES 2.0
[ofAppEGLWindow::createSurface:notice] GL_VENDOR   = Broadcom
[ofAppEGLWindow::createSurface:notice] -------------
[ofAppEGLWindow::setupPeripherals:notice] Peripheral setup complete.
[ofAppEGLWindow:notice] setupUDev() : Created udev object.
[ofAppEGLWindow:notice] setupMouse() : Unabled to find mouse.
[ofAppEGLWindow:error] setupMouse() : did not open mouse.
[ofAppEGLWindow:warning] setupKeyboard() : Unabled to find keyboard.
[ofAppEGLWindow:error] setupKeyboard() : did not open keyboard.
[ofAppEGLWindow::setupPeripherals:notice] Native event setup complete.
[ofAppEGLWindow::setupOpenGL:notice] Peripheral setup complete.
[ofAppEGLWindow::runAppViaInfiniteLoop:notice] Entering infinite loop.
[verbose] Creating GLSL Program
[verbose] GL_VERTEX_SHADER shader compiled.
[verbose] GL_FRAGMENT_SHADER shader compiled.
[verbose] Attaching shader of type GL_FRAGMENT_SHADER
[verbose] Attaching shader of type GL_VERTEX_SHADER
[verbose] Program linked.
[ofFbo:verbose] FBO supported
[ofFbo:verbose] GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_texture_npot GL_OES_depth24 GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_rgb8_rgba8 GL_OES_depth32 GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_APPLE_rgb_422 GL_EXT_debug_marker 
[ofFbo:verbose] FBO supported
[ofFbo:verbose] GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_texture_npot GL_OES_depth24 GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_rgb8_rgba8 GL_OES_depth32 GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_APPLE_rgb_422 GL_EXT_debug_marker 
[ofFbo:verbose] FBO supported
[ofFbo:verbose] GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_texture_npot GL_OES_depth24 GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_rgb8_rgba8 GL_OES_depth32 GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_APPLE_rgb_422 GL_EXT_debug_marker 
[notice] bind framebuffer
[notice] allocate texture
[notice] framebuffertexture2d
[ofFbo:verbose] FRAMEBUFFER_COMPLETE - OK

DllBcm: Using omx system library
DllOMX: Using omx system library
DllAvFormat: Using libavformat system library
DllAvUtilBase: Using libavutil system library
DllAvCodec: Using libavcodec system library
DllAvFormat: Using libavformat system library[verbose] omxReader open moviePath PASS: /home/pi/videos/Cars720p_MpegStreamClip.mov
[verbose] Video streams detection PASS

DllOMX: Using omx system library[verbose] 
COMXCoreComponent::Initialize OMX.broadcom.clock input port 80 output port 81

[verbose] clock Init PASS
[verbose] SET videoWidth: 1280
[verbose] SET videoHeight: 720
[verbose] Create EGLImage PASS
OMXPlayerVideo::Open

DllAvUtilBase: Using libavutil system library
DllAvCodec: Using libavcodec system library
DllAvFormat: Using libavformat system library
DllOMX: Using omx system library
DllOMX: Using omx system library
DllOMX: Using omx system library
DllOMX: Using omx system library[verbose] 
COMXCoreComponent::Initialize OMX.broadcom.video_decode input port 130 output port 131


DllOMX: Using omx system library[verbose] 
COMXCoreComponent::Initialize OMX.broadcom.egl_render input port 220 output port 221


DllOMX: Using omx system library[verbose] 
COMXCoreComponent::Initialize OMX.broadcom.video_scheduler input port 10 output port 11

[verbose] m_omx_decoder SET OMX_IndexParamVideoPortFormat PASS
[verbose] m_omx_decoder GET OMX_IndexParamPortDefinition PASS
[verbose] m_omx_decoder SET OMX_IndexParamPortDefinition PASS
[verbose] 
COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.video_decode) - port(130), nBufferCountMin(1), nBufferCountActual(30), nBufferSize(81920), nBufferAlignmen(16)

[verbose] BUFFER SIZE 1
[verbose] BUFFER SIZE 2
[verbose] BUFFER SIZE 3
[verbose] BUFFER SIZE 4
[verbose] BUFFER SIZE 5
[verbose] BUFFER SIZE 6
[verbose] BUFFER SIZE 7
[verbose] BUFFER SIZE 8
[verbose] BUFFER SIZE 9
[verbose] BUFFER SIZE 10
[verbose] BUFFER SIZE 11
[verbose] BUFFER SIZE 12
[verbose] BUFFER SIZE 13
[verbose] BUFFER SIZE 14
[verbose] BUFFER SIZE 15
[verbose] BUFFER SIZE 16
[verbose] BUFFER SIZE 17
[verbose] BUFFER SIZE 18
[verbose] BUFFER SIZE 19
[verbose] BUFFER SIZE 20
[verbose] BUFFER SIZE 21
[verbose] BUFFER SIZE 22
[verbose] BUFFER SIZE 23
[verbose] BUFFER SIZE 24
[verbose] BUFFER SIZE 25
[verbose] BUFFER SIZE 26
[verbose] BUFFER SIZE 27
[verbose] BUFFER SIZE 28
[verbose] BUFFER SIZE 29
[verbose] BUFFER SIZE 30
[verbose] m_omx_decoder AllocInputBuffers PASS
[verbose] OMX_EventPortSettingsChanged at ofGetElapsedTimeMillis: 699
[verbose] m_omx_tunnel_decoder Establish PASS
[verbose] m_omx_decoder OMX_StateExecuting PASS
[verbose] OMX_EventPortSettingsChanged at ofGetElapsedTimeMillis: 711
[verbose] m_omx_tunnel_sched Establish PASS
[verbose] OMX_EventPortSettingsChanged at ofGetElapsedTimeMillis: 715
[verbose] m_omx_sched OMX_StateExecuting PASS
[verbose] m_omx_render OMX_StateIdle PASS
[verbose] m_omx_render.GetOutputPort(): 221
[verbose] 
COMXCoreComponent::WaitForCommand OMX.broadcom.egl_render wait timeout event.eEvent 0x00000000 event.command 0x00000003 event.nData2 221

[verbose] m_omx_render Enable OUTPUT Port PASS
[verbose] m_omx_render UseEGLImage PASS
[verbose] COMXVideo::SendDecoderConfig m_extradata: 38791320 
[verbose] SendDecoderConfig PASS
[verbose] OMX_EventPortSettingsChanged at ofGetElapsedTimeMillis: 2737
[verbose] m_omx_render OMX_StateExecuting PASS
[verbose] m_omx_render FillThisBuffer PASS
[verbose] COMXVideo::Open - decoder_component(0x0x24ff448), input_port(0x82), output_port(0x83)

Video codec omx-h264 width 1280 height 720 profile 578 fps 29.970030
[verbose] 
OMXThread::Create - Thread with id 1121276592 started

[verbose] duration SET: 156.99
[verbose] Opened video PASS
[ofAppEGLWindow::runAppViaInfiniteLoop:notice] ofNotifySetup() complete.
[verbose] OMX_EventPortSettingsChanged at ofGetElapsedTimeMillis: 3424
^C[ofAppRunner:verbose] sighandler : Signal handled 2
[verbose] OF app is being terminated!
[verbose] testApp::exiting hard
[ofAppEGLWindow:notice] destroyNativeKeyboard()
[ofAppEGLWindow:notice] destroyNativeKeyboard() : unable to reset terminal
[ofAppEGLWindow::destroySurface:notice] Destroying EGL Surface.
make: *** [run] Segmentation fault


isOpen not set to true when engine restart

Hi,

i got a problem with the .close() function:

  • when creating the player, the flag "isOpen" is set to true (ofxOMXPlayer.cpp line 13)
  • when using the .close() function, the engine is deleted and "isOpen" is set to false (ofxOMXPlayer.cpp line 493)
  • but when we .setup() again, the isOpen flag is not set to true, so on the next .close() it will return without killing the engine (ofxOMXPlayer.cpp line 483) so the .close() function is broken after one use !

=> If i well understand the code, we should add this in the openEngine() function:
isOpen = true;
after restarting the engine the line 274 of ofxOMXPlayer.cpp

=> it would be also better to have the initial value of "isOpen" set to false
on line 13 of ofxOMXPlayer.cpp

In order to have "isOpen" matching the engine state:

  • closed at startup (line 13)
  • opened after calling the setup() function (after line 274)
  • closed after the close() function (line 493, that's ok)

Let me know if i missed something..

Best Regards

Thomas

opt.h file not found

Hi,

I'm using ofxOMX on 0.8.3 on a clean newly updated/upgraded raspbian wheezy. When I try to compile it tells me that opt.h is missing from libs/ffmpeg/include/libavcodec.

I added the file to the folder with the following code, which silenced the error. Not sure if this is a good fix or not...

#ifndef AVCODEC_OPT_H
#define AVCODEC_OPT_H

#include "libavcodec/version.h"

#if FF_API_OPT_H
#include "libavutil/opt.h"
#endif

#endif /* AVCODEC_OPT_H */

Glitches in texture mode

I’m experiencing visual glitches by displaying textures coming from ofxOMXPlayer.

The problem is clearly visible when using my highly contrasted testing videos.

untitled 01 4
(the red line is cut while it's always straight in the video)

screen shot 2015-02-12 at 16 36 58
(multiple glitches in this one, clearly coming from the texture since all three quads are affected)

At first I thought it might be a vertical-sync display problem.
I made sure I switched vertical-sync on in my application, then I drew a vertical white line scrolling from left to right to be perfectly sure it wasn’t.

The problem doesn’t always show up, depending on the video file, the usage of a fbo or not, the resolution of the display and the amount of pixels I draw on top of the video, etc.

I actually spent a lot of time figuring out what could be wrong in my code, until I realise I could reproduce the problem by running the basic example using texture mode, with one of my torture-sync-test movies.

Did anyone experience a similar problem?

My guess is that ofxOMXPlayer asynchronously writes texture data while it’s been used for drawing, couldn't it?

Question: What does the amount of GPU split depend on?

In the README it says "GPU split set to 128 (may need to be higher for larger videos)". What exactly is the determining factor here? Simply size? Meaning a 4 minute video is fine with 128MB but an hour long video needs 256MB? Or is it bitrate and or framerate that dictates the size?

Blank screen when loading a second movie

Hi !
Thanks for all the recent improvments :)
It pushed me to re-factor my ofxOMXPlayer based "HPlayer".
I have an old bug, wich might be an ofxOMX concern (or maybe the way i use it..):

In textured mode (only), i first play a movie, then i use my custom 'next' function
to play the next one in my playlist. Then, for some particular movies,
the screen stay black while the sound, getFrame, etc.. are working properly.
From there no matter if i next, or stop/play again, the video will not come back.
So i guess something broke up in the Engine, but i don't see particular error.

I do have this problem with a particular file:
the Sintel 480p mp4 trailer
https://download.blender.org/durian/trailer/

There is no problem with the BBB, or the Sintel 720p mp4 trailer!
It happens after reading the Sintel 480p, no matter what is the next movie.
I guess something broke during the playback of this particular movie...
preventing the next movie to play properly. But i can't figure what.

I tried both implementation of my 'next' function:
1°: with loadMovie(file)
2°: with stop(); / settings.videoPath = file; / setup(settings);

My 'stop' function is doing:

  • close() / framebuffer.begin(); / ofClear(0,0,0,0); / framebuffer.end();

The player is instancied with a pointer.

It's not a big issue since i think it's related to a bad encoding ,
but it could be interesting to understand what is breaking,
and maybe prevent it or fire an error log...
Because the strange part is that the guilty movie do display properly,
it just prevent next ones to show there video.

Thanks again for the good work 👍

Best Regards,

ofxOMXPlayer.h: no such File

i'm trying to compile one example but i always get the
ofxOMXPlayer.h: no such File
error
I could not find anything on the web so i ask you guy's what to do.
Thanks

CPU used 99%

Raspberry Pi + rasbian

Manual exec "make run" is good, CPU load ~27-36%

But if you use
Autostart exec for crontab or use any other method of startup

@reboot /usr/bin/startvideo

cat /usr/bin/startvideo

#!/bin/bash
cd /home/pi/openFrameworks/addons/ofxOMXPlayer/example-playlist/
make run

Result: CPU load ~97-99%

In main.ccp use code:

ofSetFrameRate(60);
ofSetVerticalSync(true);

Compile Errors w/ Lib.

To reproduce:

git clone this repo:

(in $(OF_ROOT)/examples/rpi)

git clone [email protected]:jvcleave/ofxOMXPlayer.git

Then I moved the contents of the $(OF_ROOT)/examples/rpi/addons/* into $(OF_ROOT)/addons/.

Then I added an addons.make file in the example folder ($(OF_ROOT)/examples/rpi/ofxOMXPlayer) with the line ofxOMXPlayer and ran make.

Then I got all of this. :)

Compiling OF library for Release
make[2]: Nothing to be done for `ReleaseABI'.
Done!


Compiling ofxOMXPlayer for Release
Compiling src/testApp.cpp
mkdir -p obj/linuxarmv6l/Release/src
g++ -c -Os -I./addons/ofxOMXPlayer/libs/ffmpeg/include -fPIC -U_FORTIFY_SOURCE -Wall -ftree-vectorize -ftree-vectorize -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -DPIC -D_REENTRANT -DOMX -DOMX_SKIP64BIT -I./src -I../../../addons/ofxOMXPlayer/libs/omxplayer/src -I../../../addons/ofxOMXPlayer/libs/omxplayer/src/utils -I../../../addons/ofxOMXPlayer/libs/omxplayer/src/linux -I../../../addons/ofxOMXPlayer/libs/ffmpeg/include -I../../../addons/ofxOMXPlayer/libs/ffmpeg/include/libswscale -I../../../addons/ofxOMXPlayer/libs/ffmpeg/include/libavutil -I../../../addons/ofxOMXPlayer/libs/ffmpeg/include/libavfilter -I../../../addons/ofxOMXPlayer/libs/ffmpeg/include/libavcodec -I../../../addons/ofxOMXPlayer/libs/ffmpeg/include/libavformat -I../../../addons/ofxOMXPlayer/libs/ffmpeg/include/libavdevice -I../../../addons/ofxOMXPlayer/libs/ffmpeg/include/libswresample -I../../../addons/ofxOMXPlayer/libs/ffmpeg/include/libpostproc -I../../../addons/ofxOMXPlayer/src -Wall -fexceptions -march=armv6 -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DOF_USING_GTK -DOF_USING_MPG123 -DTARGET_RASPBERRY_PI -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -pthread -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gstreamer-0.10 -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/lib/arm-linux-gnueabihf/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I../../../libs/cairo/include -I../../../libs/cairo/include/cairo -I../../../libs/cairo/include/libpng15 -I../../../libs/cairo/include/pixman-1 -I../../../libs/fmodex/include -I../../../libs/kiss/include -I../../../libs/poco/include -I../../../libs/portaudio/include -I../../../libs/rtAudio/include -I../../../libs/tess2/include -I../../../libs/openFrameworks -I../../../libs/openFrameworks/events -I../../../libs/openFrameworks/types -I../../../libs/openFrameworks/math -I../../../libs/openFrameworks/sound -I../../../libs/openFrameworks/app -I../../../libs/openFrameworks/utils -I../../../libs/openFrameworks/gl -I../../../libs/openFrameworks/3d -I../../../libs/openFrameworks/communication -I../../../libs/openFrameworks/video -I../../../libs/openFrameworks/graphics -MMD -MP -MF obj/linuxarmv6l/Release/src/testApp.d -MT obj/linuxarmv6l/Release/src/testApp.o -o obj/linuxarmv6l/Release/src/testApp.o -c src/testApp.cpp
In file included from /opt/vc/include/interface/vcos/vcos.h:116:0,
                 from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
                 from /opt/vc/include/bcm_host.h:46,
                 from ../../../libs/openFrameworks/utils/ofConstants.h:152,
                 from ../../../libs/openFrameworks/ofMain.h:5,
                 from src/testApp.h:3,
                 from src/testApp.cpp:1:
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h:133:20: error: field ‘expires’ has incomplete type
In file included from /opt/vc/include/interface/vcos/vcos.h:116:0,
                 from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
                 from /opt/vc/include/bcm_host.h:46,
                 from ../../../libs/openFrameworks/utils/ofConstants.h:152,
                 from ../../../libs/openFrameworks/ofMain.h:5,
                 from src/testApp.h:3,
                 from src/testApp.cpp:1:
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h: In function ‘VCOS_STATUS_T vcos_semaphore_wait_timeout(VCOS_SEMAPHORE_T*, VCOS_UNSIGNED)’:
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h:297:20: error: aggregate ‘timespec ts’ has incomplete type and cannot be defined
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h: In function ‘void vcos_sleep(uint32_t)’:
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h:371:20: error: aggregate ‘timespec ts’ has incomplete type and cannot be defined
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h:374:23: error: ‘nanosleep’ was not declared in this scope
In file included from ../../../libs/openFrameworks/utils/ofConstants.h:334:0,
                 from ../../../libs/openFrameworks/ofMain.h:5,
                 from src/testApp.h:3,
                 from src/testApp.cpp:1:
/usr/include/c++/4.6/ctime: At global scope:
/usr/include/c++/4.6/ctime:62:11: error: ‘::clock_t’ has not been declared
/usr/include/c++/4.6/ctime:63:11: error: ‘::time_t’ has not been declared
/usr/include/c++/4.6/ctime:64:11: error: ‘::tm’ has not been declared
/usr/include/c++/4.6/ctime:66:11: error: ‘::clock’ has not been declared
/usr/include/c++/4.6/ctime:67:11: error: ‘::difftime’ has not been declared
/usr/include/c++/4.6/ctime:68:11: error: ‘::mktime’ has not been declared
/usr/include/c++/4.6/ctime:69:11: error: ‘::time’ has not been declared
/usr/include/c++/4.6/ctime:70:11: error: ‘::asctime’ has not been declared
/usr/include/c++/4.6/ctime:71:11: error: ‘::ctime’ has not been declared
/usr/include/c++/4.6/ctime:72:11: error: ‘::gmtime’ has not been declared
/usr/include/c++/4.6/ctime:73:11: error: ‘::localtime’ has not been declared
/usr/include/c++/4.6/ctime:74:11: error: ‘::strftime’ has not been declared
In file included from ../../../libs/poco/include/Poco/File.h:44:0,
                 from ../../../libs/openFrameworks/utils/ofFileUtils.h:4,
                 from ../../../libs/openFrameworks/ofMain.h:6,
                 from src/testApp.h:3,
                 from src/testApp.cpp:1:
../../../libs/poco/include/Poco/Timestamp.h:103:2: error: ‘time_t’ in namespace ‘std’ does not name a type
../../../libs/poco/include/Poco/Timestamp.h:125:38: error: ‘std::time_t’ has not been declared
../../../libs/poco/include/Poco/Timestamp.h:217:8: error: ‘time_t’ in namespace ‘std’ does not name a type
In file included from /usr/include/glib-2.0/glib.h:39:0,
                 from /usr/include/gstreamer-0.10/gst/gst.h:27,
                 from ../../../libs/openFrameworks/video/ofGstUtils.h:12,
                 from ../../../libs/openFrameworks/video/ofGstVideoGrabber.h:3,
                 from ../../../libs/openFrameworks/video/ofVideoGrabber.h:31,
                 from ../../../libs/openFrameworks/ofMain.h:71,
                 from src/testApp.h:3,
                 from src/testApp.cpp:1:
/usr/include/glib-2.0/glib/gbookmarkfile.h:150:11: error: ‘time_t’ has not been declared
/usr/include/glib-2.0/glib/gbookmarkfile.h:157:11: error: ‘time_t’ has not been declared
/usr/include/glib-2.0/glib/gbookmarkfile.h:176:11: error: ‘time_t’ has not been declared
/usr/include/glib-2.0/glib/gbookmarkfile.h:177:1: error: ‘time_t’ does not name a type
/usr/include/glib-2.0/glib/gbookmarkfile.h:182:11: error: ‘time_t’ has not been declared
/usr/include/glib-2.0/glib/gbookmarkfile.h:183:1: error: ‘time_t’ does not name a type
/usr/include/glib-2.0/glib/gbookmarkfile.h:188:11: error: ‘time_t’ has not been declared
/usr/include/glib-2.0/glib/gbookmarkfile.h:189:1: error: ‘time_t’ does not name a type
In file included from /usr/include/glib-2.0/glib.h:45:0,
                 from /usr/include/gstreamer-0.10/gst/gst.h:27,
                 from ../../../libs/openFrameworks/video/ofGstUtils.h:12,
                 from ../../../libs/openFrameworks/video/ofGstVideoGrabber.h:3,
                 from ../../../libs/openFrameworks/video/ofVideoGrabber.h:31,
                 from ../../../libs/openFrameworks/ofMain.h:71,
                 from src/testApp.h:3,
                 from src/testApp.cpp:1:
/usr/include/glib-2.0/glib/gdate.h:174:9: error: ‘time_t’ has not been declared
In file included from /usr/include/arm-linux-gnueabihf/sys/stat.h:107:0,
                 from /usr/include/gstreamer-0.10/gst/gstplugin.h:31,
                 from /usr/include/gstreamer-0.10/gst/gstelementfactory.h:33,
                 from /usr/include/gstreamer-0.10/gst/gstelement.h:60,
                 from /usr/include/gstreamer-0.10/gst/gstbin.h:27,
                 from /usr/include/gstreamer-0.10/gst/gst.h:35,
                 from ../../../libs/openFrameworks/video/ofGstUtils.h:12,
                 from ../../../libs/openFrameworks/video/ofGstVideoGrabber.h:3,
                 from ../../../libs/openFrameworks/video/ofVideoGrabber.h:31,
                 from ../../../libs/openFrameworks/ofMain.h:71,
                 from src/testApp.h:3,
                 from src/testApp.cpp:1:
/usr/include/arm-linux-gnueabihf/bits/stat.h:73:21: error: field ‘st_atim’ has incomplete type
/usr/include/arm-linux-gnueabihf/bits/stat.h:74:21: error: field ‘st_mtim’ has incomplete type
/usr/include/arm-linux-gnueabihf/bits/stat.h:75:21: error: field ‘st_ctim’ has incomplete type
/usr/include/arm-linux-gnueabihf/bits/stat.h:119:21: error: field ‘st_atim’ has incomplete type
/usr/include/arm-linux-gnueabihf/bits/stat.h:120:21: error: field ‘st_mtim’ has incomplete type
/usr/include/arm-linux-gnueabihf/bits/stat.h:121:21: error: field ‘st_ctim’ has incomplete type
In file included from /usr/include/gstreamer-0.10/gst/gstelementfactory.h:33:0,
                 from /usr/include/gstreamer-0.10/gst/gstelement.h:60,
                 from /usr/include/gstreamer-0.10/gst/gstbin.h:27,
                 from /usr/include/gstreamer-0.10/gst/gst.h:35,
                 from ../../../libs/openFrameworks/video/ofGstUtils.h:12,
                 from ../../../libs/openFrameworks/video/ofGstVideoGrabber.h:3,
                 from ../../../libs/openFrameworks/video/ofVideoGrabber.h:31,
                 from ../../../libs/openFrameworks/ofMain.h:71,
                 from src/testApp.h:3,
                 from src/testApp.cpp:1:
/usr/include/gstreamer-0.10/gst/gstplugin.h:211:3: error: ‘time_t’ does not name a type
In file included from /usr/include/c++/4.6/bits/locale_facets_nonio.h:1936:0,
                 from /usr/include/c++/4.6/locale:43,
                 from ../../../addons/ofxOMXPlayer/libs/omxplayer/src/utils/StdString.h:670,
                 from ../../../addons/ofxOMXPlayer/libs/omxplayer/src/DynamicDll.h:24,
                 from ../../../addons/ofxOMXPlayer/libs/omxplayer/src/DllBCM.h:7,
                 from ../../../addons/ofxOMXPlayer/libs/omxplayer/src/linux/RBP.h:39,
                 from ../../../addons/ofxOMXPlayer/src/ofxOMXPlayer.h:12,
                 from src/testApp.h:4,
                 from src/testApp.cpp:1:
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc: In member function ‘_InIter std::time_get<_CharT, _InIter>::_M_extract_via_format(std::time_get<_CharT, _InIter>::iter_type, std::time_get<_CharT, _InIter>::iter_type, std::ios_base&, std::ios_base::iostate&, tm*, const _CharT*) const’:
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:656:47: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:663:47: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:671:47: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:678:47: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:690:46: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:697:50: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:700:48: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:712:46: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:717:46: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:725:11: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:729:46: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:749:46: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:793:11: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc: In member function ‘virtual _InIter std::time_get<_CharT, _InIter>::do_get_weekday(std::time_get<_CharT, _InIter>::iter_type, std::time_get<_CharT, _InIter>::iter_type, std::ios_base&, std::ios_base::iostate&, tm*) const’:
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:1080:6: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc: In member function ‘virtual _InIter std::time_get<_CharT, _InIter>::do_get_monthname(std::time_get<_CharT, _InIter>::iter_type, std::time_get<_CharT, _InIter>::iter_type, std::ios_base&, std::ios_base::iostate&, tm*) const’:
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:1108:6: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc: In member function ‘virtual _InIter std::time_get<_CharT, _InIter>::do_get_year(std::time_get<_CharT, _InIter>::iter_type, std::time_get<_CharT, _InIter>::iter_type, std::ios_base&, std::ios_base::iostate&, tm*) const’:
/usr/include/c++/4.6/bits/locale_facets_nonio.tcc:1131:6: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:134:8: error: forward declaration of ‘struct tm’
In file included from ../../../addons/ofxOMXPlayer/libs/omxplayer/src/DllAvFormat.h:4:0,
                 from ../../../addons/ofxOMXPlayer/libs/omxplayer/src/OMXClock.h:3,
                 from ../../../addons/ofxOMXPlayer/src/ofxOMXPlayer.h:13,
                 from src/testApp.h:4,
                 from src/testApp.cpp:1:
../../../addons/ofxOMXPlayer/libs/omxplayer/src/DllAvCodec.h: In member function ‘virtual int DllAvCodec::avcodec_encode_audio(AVCodecContext*, uint8_t*, int, const short int*)’:
../../../addons/ofxOMXPlayer/libs/omxplayer/src/DllAvCodec.h:116:120: warning: ‘int avcodec_encode_audio(AVCodecContext*, uint8_t*, int, const short int*)’ is deprecated (declared at ../../../addons/ofxOMXPlayer/libs/ffmpeg/include/libavcodec/avcodec.h:4189) [-Wdeprecated-declarations]
../../../addons/ofxOMXPlayer/libs/omxplayer/src/DllAvCodec.h:116:170: warning: ‘int avcodec_encode_audio(AVCodecContext*, uint8_t*, int, const short int*)’ is deprecated (declared at ../../../addons/ofxOMXPlayer/libs/ffmpeg/include/libavcodec/avcodec.h:4189) [-Wdeprecated-declarations]
In file included from ../../../addons/ofxOMXPlayer/libs/omxplayer/src/OMXAudio.h:8:0,
                 from ../../../addons/ofxOMXPlayer/libs/omxplayer/src/OMXPlayerAudio.h:15,
                 from ../../../addons/ofxOMXPlayer/src/ofxOMXPlayer.h:15,
                 from src/testApp.h:4,
                 from src/testApp.cpp:1:
../../../addons/ofxOMXPlayer/libs/omxplayer/src/linux/PlatformDefs.h: At global scope:
../../../addons/ofxOMXPlayer/libs/omxplayer/src/linux/PlatformDefs.h:380:3: error: ‘time_t’ does not name a type
../../../addons/ofxOMXPlayer/libs/omxplayer/src/linux/PlatformDefs.h:381:3: error: ‘time_t’ does not name a type
../../../addons/ofxOMXPlayer/libs/omxplayer/src/linux/PlatformDefs.h:382:3: error: ‘time_t’ does not name a type
src/testApp.cpp: In member function ‘virtual void testApp::exit()’:
src/testApp.cpp:101:11: warning: null argument where non-null required (argument 1) [-Wnonnull]
make[1]: *** [obj/linuxarmv6l/Release/src/testApp.o] Error 1
make: *** [Release] Error 2
pi@raspberrypi ~/openFrameworks/examples/rpi/ofxOMXPlayer $ 

[Suggestion] Getting 1080p in textured mode on Raspberry Pi 2

So according to the RPi2 announcement on the RPi Blog video decoding is a hell lot faster now:
"NEON-enabled multicore video codecs can be over 20x faster"

http://www.raspberrypi.org/blog/#raspberry-pi-2-on-sale
I couldn't find more info on why this is the case. Maybe the VPU changed with the new CPU, the GPU is still the same. Or they just added the NEON extension and it isn't even related to the VPU.

I can confirm that ofxOMXPlayer works just fine on the Pi2 so far, loading videos seems to happen quite a bit faster but without any modifications 1080p is still lagging in textured mode.

We have twice as much RAM now, maybe buffering more frames could already do the job?
If buffering is even going on? I never dug that deep into the source.
When playing 1080p right now there are 1-2 second of fluid playback and then it goes back to stuttering.

The video player doesn't stop after video end

Hi,
The video player (loop disable) continue to stay in play mode once
the video reach the end, .isPlaying() and isOpen are still true,
and the Video stay on the last frame.

Maybe it's what we want.. but the isPlaying() staying true is confusing :)

I think it would be cleaner to fully stop and close the player once a video is finnished
What do you think ?

I hope you are not annoyed by all the issues i'm posting ;)
for info, i'm working on a OSC binded player (HPlayer) based on your addon
and a network controller in NodeJS (HController)
to be able to manage many players on a web interface with playlist capabilities
and some OpenGL effects... you can follow that here if you are interested:
https://github.com/Hemisphere-Project/

Thanks
Thomas

USB Audio not honored

It seems if useHDMIForAudio is false it forces the audio through the 3.5mm jack even though in the ALSA settings a USB soundcard is set to a higher priority. ofSoundPlayer is playing through the USB soundcard while OMXPlayer is going through the internal jack.

getPixels() returns RGBA data

I noticed this addon is using GL_RGBA format for the videos textures.
is there a reason not for using RGB format? Or is there a way to receive RGB formatted data when calling ofxOMXPlayer::getPixels() ?

add volume into ofxOMXPlayerSettings

Hi,
it's more an enhancement idea than an issue:
it would be great to have the volume added to the ofxOMXPlayerSettings object
for two reason:

  • to be able supply the initial volume with other settings on player setup (so we don't have to set it up after the player has already started)
  • when using loadMovie(); the volume would be kept unchanged. For the moment when we load a new file, the volume reset automatically to 0.5 and that can be annoying (we have to set again the volume to the desired value after every loadMovie)

In those 2 cases, we have to change the volume after the video start at volume 0.5
and that can produce sound glitches or unwanted sounds.

Thanks for your work !

Best Regards

OMX_ErrorInsufficientResources on loadMovie()

Hi,
i'm not sure if this is an actual issue or just something i did wrong,
(so it's maybe not the best place to post this ?)
here is my problem:

  • i start a player with given settings, everything goes fine
  • after a while i load a different movie using Player.loadMovie(newVideoPath)

but then, i got two OMX errors (seems to be related to the audio mixer..):

[ error ] OMX_ERRORTYPE COMXCoreTunel::Deestablish(bool)::OMX.broadcom.audio_mixer TUNNEL UNSET FAIL: OMX_ErrorIncorrectStateOperation

[ error ] OMX_ERRORTYPE COMXCoreComponent::SetStateForComponent(OMX_STATETYPE): OMX_GetState FAIL OMX_ErrorInsufficientResources

The video change as expected and the sound works properly, so it's maybe not a big deal, but i was a bit worried about this since i will heavily change video in my project..

For now, this routine is running over 2 videos, and one is the Bunny sample that works properly with examples, but still produce those errors with my script: so i guess it's not an audio encoding issue..

I got those errors regardless of the used settings
(useHDMIForAudio / enableTexture / enableLooping)

Is there a way to properly stop the player before loading the next media ?
I tried Player.close(); but it doesn't improve.

any clue ?
Thanks !

Best Regards

Fast changing videofile without destroying and reinitalizing all omx classes

Hello.
I need to fast change playing video file.
Is it possible to add there functionality to change currently playing video file to another video file without completely destroying and recreating ofxOMXPlayer class (and all OXM and libav initializations) ?
I think the ofxOMXPlayer has the function calls (stop(), play(), loadMovie()) for it already defined but not implemented.

Regarding to the proper destroying ofxOMXPlayer class using texture and eglImage. I can not find a function call eglDestroyImageKHR to destroy EGLImage.

I'm new to the GItHub so don't beat me if there is another standard way how to discuss new functions and some source tweaking than in Issue section.

Switch to a new video file

I am able to play a .mov file but if I try to use the same ofxOMXPlayer object to open a new file changing settings.videopath and calling setup(settings) I get an exception.

Is it currently possible to close the file and open a new one runtime?

Implementing Step Frame Backward

Hi jvcleave,
I want to ask if it is possible to add a stepFrameBackward function.
I'd like to use the ofxOMXPlayer as a perfomance and low resource image sequence player.
Therefor i have created an h.264 video with one picture by frame, and like to move it forward and backward using an rotary encoder, to get a stop motion effect.

I have done investigations already, but it seems that Openmax does not have such a function.
It would be great if you can help me to find a solution.

compile errors

Just put the new addons, Makefile, and config.make file into my Pi player and got these errors when compiling:

In file included from /opt/vc/include/interface/vcos/vcos.h:116:0,
from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
from /opt/vc/include/bcm_host.h:46,
from ../../../libs/openFrameworks/utils/ofConstants.h:160,
from ../../../libs/openFrameworks/ofMain.h:5,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideoBase.h:2,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.h:4,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.cpp:24:
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h:134:20: error: field ‘expires’ has incomplete type
In file included from /opt/vc/include/interface/vcos/vcos.h:116:0,
from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
from /opt/vc/include/bcm_host.h:46,
from ../../../libs/openFrameworks/utils/ofConstants.h:160,
from ../../../libs/openFrameworks/ofMain.h:5,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideoBase.h:2,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.h:4,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.cpp:24:
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h: In function ‘VCOS_STATUS_T vcos_semaphore_wait_timeout(VCOS_SEMAPHORE_T_, VCOS_UNSIGNED)’:
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h:298:20: error: aggregate ‘timespec ts’ has incomplete type and cannot be defined
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h: In function ‘void vcos_sleep(uint32_t)’:
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h:372:20: error: aggregate ‘timespec ts’ has incomplete type and cannot be defined
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h:375:23: error: ‘nanosleep’ was not declared in this scope
In file included from ../../../libs/openFrameworks/utils/ofConstants.h:342:0,
from ../../../libs/openFrameworks/ofMain.h:5,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideoBase.h:2,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.h:4,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.cpp:24:
/usr/include/c++/4.6/ctime: At global scope:
/usr/include/c++/4.6/ctime:62:11: error: ‘::clock_t’ has not been declared
/usr/include/c++/4.6/ctime:63:11: error: ‘::time_t’ has not been declared
/usr/include/c++/4.6/ctime:64:11: error: ‘::tm’ has not been declared
/usr/include/c++/4.6/ctime:66:11: error: ‘::clock’ has not been declared
/usr/include/c++/4.6/ctime:67:11: error: ‘::difftime’ has not been declared
/usr/include/c++/4.6/ctime:68:11: error: ‘::mktime’ has not been declared
/usr/include/c++/4.6/ctime:69:11: error: ‘::time’ has not been declared
/usr/include/c++/4.6/ctime:70:11: error: ‘::asctime’ has not been declared
/usr/include/c++/4.6/ctime:71:11: error: ‘::ctime’ has not been declared
/usr/include/c++/4.6/ctime:72:11: error: ‘::gmtime’ has not been declared
/usr/include/c++/4.6/ctime:73:11: error: ‘::localtime’ has not been declared
/usr/include/c++/4.6/ctime:74:11: error: ‘::strftime’ has not been declared
In file included from ../../../libs/poco/include/Poco/File.h:44:0,
from ../../../libs/openFrameworks/utils/ofFileUtils.h:4,
from ../../../libs/openFrameworks/ofMain.h:6,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideoBase.h:2,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.h:4,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.cpp:24:
../../../libs/poco/include/Poco/Timestamp.h:103:2: error: ‘time_t’ in namespace ‘std’ does not name a type
../../../libs/poco/include/Poco/Timestamp.h:125:38: error: ‘std::time_t’ has not been declared
../../../libs/poco/include/Poco/Timestamp.h:217:8: error: ‘time_t’ in namespace ‘std’ does not name a type
In file included from /usr/include/glib-2.0/glib.h:39:0,
from /usr/include/gstreamer-1.0/gst/gst.h:27,
from ../../../libs/openFrameworks/video/ofGstUtils.h:13,
from ../../../libs/openFrameworks/video/ofGstVideoGrabber.h:3,
from ../../../libs/openFrameworks/video/ofVideoGrabber.h:31,
from ../../../libs/openFrameworks/ofMain.h:76,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideoBase.h:2,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.h:4,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.cpp:24:
/usr/include/glib-2.0/glib/gbookmarkfile.h:150:11: error: ‘time_t’ has not been declared
/usr/include/glib-2.0/glib/gbookmarkfile.h:157:11: error: ‘time_t’ has not been declared
/usr/include/glib-2.0/glib/gbookmarkfile.h:176:11: error: ‘time_t’ has not been declared
/usr/include/glib-2.0/glib/gbookmarkfile.h:177:1: error: ‘time_t’ does not name a type
/usr/include/glib-2.0/glib/gbookmarkfile.h:182:11: error: ‘time_t’ has not been declared
/usr/include/glib-2.0/glib/gbookmarkfile.h:183:1: error: ‘time_t’ does not name a type
/usr/include/glib-2.0/glib/gbookmarkfile.h:188:11: error: ‘time_t’ has not been declared
/usr/include/glib-2.0/glib/gbookmarkfile.h:189:1: error: ‘time_t’ does not name a type
In file included from /usr/include/glib-2.0/glib.h:45:0,
from /usr/include/gstreamer-1.0/gst/gst.h:27,
from ../../../libs/openFrameworks/video/ofGstUtils.h:13,
from ../../../libs/openFrameworks/video/ofGstVideoGrabber.h:3,
from ../../../libs/openFrameworks/video/ofVideoGrabber.h:31,
from ../../../libs/openFrameworks/ofMain.h:76,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideoBase.h:2,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.h:4,
from addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.cpp:24:
/usr/include/glib-2.0/glib/gdate.h:174:9: error: ‘time_t’ has not been declared
make[1]: *_* [obj/linuxarmv6l/Release/addons/ofxOMXPlayer/ofxOMXPlayer/src/OMXPlayerVideo.o] Error 1
make: *** [Release] Error 2

Multiple video support for textured Player

Hi jvcleave,

I'm trying to port an art installation I've made using Processing to Raspberry Pi. (https://vimeo.com/49332537)

I've recently got my raspi up and running with oF and your addon which is working very well, nice job !

As I said, textured player works great but I need to try using 12 textures (this is 12 different video loops).

I've tried having two OMXPlayer objects with no luck (I knew your wrote "Multiple video for textured Player not supported" but I had to try :P )

I will be glad to help with this project adding this feature, the first thing that came to my mind was having an EGLContainer per player (instead of the Global you've made)

Do you think I'm going in the right direction here ? It's the multiple video support feature far more difficult to achieve than it seems ?

Thank you very much for this project
Leandro.

segfault on close when audio is enabled

hello there,

first of all, thanks for putting this together. for the most part the video playback performance is pretty impressive, and the addon is quite easy to use.

i'm running into this issue when audio is enabled for playback: using the example-basic, if i don't enable audio, the verbose output at the end looks like:

....
[verbose] virtual OMXDecoderBase::~OMXDecoderBase(): END ---------
[verbose] virtual bool OMXPlayerEGLImage::Close(): POST DELETE eglImageDecoder
[verbose] virtual bool OMXPlayerEGLImage::Close():  END
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.clock START
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.clock END
[verbose] virtual ofxOMXPlayerEngine::~ofxOMXPlayerEngine(): ~ofxOMXPlayerEngine END
player closed
[notice ] ofAppEGLWindow: destroyNativeKeyboard()
[verbose] ofThread: - name: Thread 1 - Signaled to stop.
[verbose] ofThread: - name: Thread 1 - waiting to stop
[verbose] ofThread: - name: Thread 1 - Thread Finished.
[notice ] ofAppEGLWindow: destroySurface(): destroying EGL surface
[verbose] void ofxOMXPlayer::close():  isOpen: 0

and everything quits nicely.

however, if i enable audio, i see the following:

[verbose] void OMXPlayerAudio::Flush(): OMXPlayerAudio::Flush start
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_decode START
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_decode END
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_mixer START
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_mixer END
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_mixer START
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_mixer END
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_render START
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_render END
[verbose] void OMXPlayerAudio::Flush(): OMXPlayerAudio::Flush end
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_decode START
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_decode END
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_mixer START
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_mixer END
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_mixer START
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_mixer END
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_render START
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_render END
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.clock START
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.clock END
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_render START
[verbose] void COMXCoreComponent::FlushAll(): OMX.broadcom.audio_render END
Segmentation fault

the settings i'm using to enable/disable the audio looks like this, and the segfault happens whether i set it with HDMI, or without:

settings.useHDMIForAudio = false;       //default true
settings.enableAudio = true ;           //default true, save resources by disabling

since this only happens at the very end, its not a huge problem, but it would be nice to figure out what is causing this.

any pointers would be greatly appreciated!

Missing display aspect ratio

Hi jvcleave,
Another idea to extend ofxOMXPlayer.
Very often I need to know the original video aspect ratio.
The width and height of video image doesn't very often corresponds to the actual video aspect ratio.
Probably from OMXStreamInfo.h (class COMXStreamInfo) allow use of "float aspect" variable in ofxOMXPlayer.

Segfault while reading Quicktime H264 other than example

I am using the "addon" with texture and no-texture with the develop version of openframeworks (integrating armv6 platform and Rpi), not the raspberry-openframeworks.

I have no problem with the big_bunny video example but when I switch to another video I made, either with After Effet or MpegStreamClip, in Quicktime format and H264 codec, I have a segfault.

[verbose] Video codec omx-h264 width 1280 height 720 profile 77 fps 29.970030
[verbose] OMXThread::Create - Thread with id -1299086576 started
[verbose] videoPlayer->GetFPS(): 29.97
[verbose] duration SET: 9.87653
[verbose] OMXClock::OMXStart(0)
[verbose] Opened video PASS
[notice ] ofAppEGLWindow: runAppViaInfiniteLoop(): setting up notifications complete
[verbose] Thread 2: started
[verbose] OMXVideo::Decode VDec : setStartTime 0.000000

Segmentation fault

Strange thing is that I have no problem playing the video using omxplayer from command line.

I tried to debug with gdb but it even segfault sooner...

(gdb) run
Starting program: /home/pi/dev/openFrameworks/apps/ofxOMXPlayerTest/ofxOMXPlayer/bin/ofxOMXPlayer_debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Program received signal SIGILL, Illegal instruction.
0xb6d845e0 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0

Same program with big_bunny sample file works well.

[feature request] transparency

Yep. Don't know if it's even close to be possible, but I would love to have a (interactive) transparency factor. So one video can be played over the other and you could ajust the transparency of the above layer.

Thanks. If others need this, we could create a collective bounty for this.

Frame flashes white at the end of a movie when looping first time through

I have 5 or 6 movies compressed with Streamclip which are 6-30 seconds long and loop. They have black backgrounds and all of them seem to have one frame where it flashes white at the end of the first loop (second time through it doesn't do this). I'm not sure how to fix this or why it is happening - it would be better for me if it flashed black - I set the background to black.

Any ideas on what I should be looking at? I think using h.264 via your recommendations should have done the trick for good compression.

Correct seeking or seek to beginning / restart movie

This is more of an enhancement to:

  • perform correct and fast seeking
  • restart a movie from the beginning

I tried several way but I either ended without any seeking at all or with a 1-3 sec lag.

It would be at least nice to have a correct Stop/Play method that rewind the movie to the beginning without to much lag.

Any idea on the subject?

play udp stream in texture mode

Hello, thanks for creating ofxOMXPlayer! I have a problem, hope someone can help.

I have a desktop vlc streaming an udp stream. If i open it in omxplayer, it works great.

If i try to play it in the ofxOmxPlayer testapp, change videopath to:
string videoPath = "udp://224.1.1.1:5004";

it opens, but there are no frames comming in. All i get is a white screen, with the framecounters in the left corner. The app fps is about 118, Media time is 4.70000e+08 (weird?)

The rest is all zero:
Duration: 0
Total Frames: 0
Current Frame: 0
Remaining frames: 0

with enableTexture = true or false.

The default bunny video runs fine.

My questions:

  • Is it even posible to play streaming content with ofxOMXPlayer?
  • If so, is there a way to pass omxplayer arguments like --video_queue or --live to ofxOMXPlayer?

Below is the output i got from 'make run'

[warning] ofAppEGLWindow: init(): X11 not availble on RPI yet, using a native window instead
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): screenRect: 1280x1024
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): windowRect: 1280x1024
[notice ] ofAppEGLWindow: createSurface(): setting up EGL Display
[notice ] ofAppEGLWindow: createSurface(): EGL Display correctly set
[notice ] ofAppEGLWindow: createSurface(): current renderer type: ProgrammableGL
[notice ] ofAppEGLWindow: createSurface(): GLES2 renderer detected
[notice ] ofAppEGLWindow: createSurface(): surface created correctly
[notice ] ofAppEGLWindow: createSurface(): API bound correctly
[notice ] ofAppEGLWindow: createSurface(): -----EGL-----
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION_MAJOR = 1
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION_MINOR = 4
[notice ] ofAppEGLWindow: createSurface(): EGL_CLIENT_APIS = OpenGL_ES OpenVG
[notice ] ofAppEGLWindow: createSurface(): EGL_VENDOR = Broadcom
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION = 1.4
[notice ] ofAppEGLWindow: createSurface(): EGL_EXTENSIONS = EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_vg_parent_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_lock_surface 
[notice ] ofAppEGLWindow: createSurface(): GL_RENDERER = VideoCore IV HW
[notice ] ofAppEGLWindow: createSurface(): GL_VERSION  = OpenGL ES 2.0
[notice ] ofAppEGLWindow: createSurface(): GL_VENDOR   = Broadcom
[notice ] ofAppEGLWindow: createSurface(): -------------
[ error ] ofShader: begin(): couldn't begin, shader not loaded
[ error ] ofShader: begin(): couldn't begin, shader not loaded
[ error ] ofShader: begin(): couldn't begin, shader not loaded
[ error ] ofShader: begin(): couldn't begin, shader not loaded
[notice ] ofAppEGLWindow: setupPeripherals(): peripheral setup complete
[notice ] ofAppEGLWindow: setupNativeUDev(): created udev object
[notice ] ofAppEGLWindow: setupMouse(): unabled to find mouse
[ error ] ofAppEGLWindow: setupMouse(): did not open mouse
[ error ] ofAppEGLWindow: setupMouse(): did not open mouse, mouse_fd < 0
[notice ] ofAppEGLWindow: setupKeyboard(): keyboard_fd= 5 devicePath=/dev/input/by-path/platform-bcm2708_usb-usb-0:1.3:1.0-event-kbd
[notice ] ofAppEGLWindow: setupKeyboard(): keyboard device name = Dell Dell USB Keyboard
[notice ] ofAppEGLWindow: setupPeripherals(): native event setup complete
[notice ] ofAppEGLWindow: setupOpenGL(): peripheral setup complete
[verbose] ofAppRunner: GL ready
[verbose] ofAppRunner: Vendor:   Broadcom
[verbose] ofAppRunner: Renderer: VideoCore IV HW
[verbose] ofAppRunner: Version:  OpenGL ES 2.0
[verbose] ofAppRunner: GLSL:     OpenGL ES GLSL ES 1.00
[verbose] ofShader: checkAndCreateProgram(): creating GLSL program
[verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled
[warning] ofShader: GL_VERTEX_SHADER shader reports:
Compiled
[verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled
[warning] ofShader: GL_FRAGMENT_SHADER shader reports:
Compiled
[verbose] linkProgram(): attaching GL_FRAGMENT_SHADER shader to program 1
[verbose] linkProgram(): attaching GL_VERTEX_SHADER shader to program 1
[verbose] ofShader: checkProgramLinkStatus(): program 1linked
[notice ] ofAppEGLWindow: runAppViaInfiniteLoop(): entering infinite loop
[verbose] listed 0 files in "/home/pi/video/current/"
[verbose] COMXCore::Initialize
[verbose] moviePath is udp://224.1.1.1:5004
[verbose] COMXPlayer::OpenFile - avformat_open_input udp://224.1.1.1:5004 
[verbose] COMXPlayer::OpenFile - avformat_open_input enabled SEEKING 
[verbose] omxReader open moviePath PASS: udp://224.1.1.1:5004
[verbose] NO AUDIO
[verbose] Video streams detection PASS
[verbose] clock Init PASS
[verbose] SET videoWidth: 1280
[verbose] SET videoHeight: 720
[verbose] videoStreamInfo.nb_frames 0
[verbose] OMXPlayerEGLImage CONSTRUCT
[verbose] ofFbo: GL frame buffer object supported
[verbose] ofFbo: GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_texture_npot GL_OES_depth24 GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_rgb8_rgba8 GL_OES_depth32 GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_APPLE_rgb_422 GL_EXT_debug_marker 
[verbose] ofFbo: GL frame buffer object supported
[verbose] ofFbo: GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_texture_npot GL_OES_depth24 GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_rgb8_rgba8 GL_OES_depth32 GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_APPLE_rgb_422 GL_EXT_debug_marker 
[verbose] ofFbo: GL frame buffer object supported
[verbose] ofFbo: GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_texture_npot GL_OES_depth24 GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_rgb8_rgba8 GL_OES_depth32 GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_APPLE_rgb_422 GL_EXT_debug_marker 
[verbose] ofFbo: FRAMEBUFFER_COMPLETE - OK
[verbose] generateEGLImage: textureID: 3
[verbose] generateEGLImage: tex.isAllocated(): 1
[verbose] Create EGLImage PASS
[verbose] generateEGLImage: pixels Allocated PASS
[verbose] Open:  OMXPlayerEGLImage Open
[verbose] OMXDecoderBase::CONSTRUCT
[verbose] ProcessCodec:  m_video_codec_name: omx-h264
[verbose] Open: m_omx_decoder SET OMX_IndexParamVideoPortFormat PASS
[verbose] Open: m_omx_decoder GET OMX_IndexParamPortDefinition PASS
[verbose] Open: m_omx_decoder SET OMX_IndexParamPortDefinition PASS
[verbose] Open: m_omx_decoder OMX_IndexParamBrcmVideoDecodeErrorConcealment PASS
[verbose] Open: Open OMX_IndexParamNalStreamFormatSelect PASS
[verbose] COMXCoreComponent::AllocInputBuffers 
          component(OMX.broadcom.video_decode)                          
          port(130)                             
          nBufferCountMin(1)                    
          nBufferCountActual(80)                
          nBufferSize(81920)                        
          nBufferAlignmen(16) 

[verbose] Open: m_omx_decoder AllocInputBuffers PASS
[verbose] Open: m_omx_tunnel_decoder Establish PASS
[verbose] Open: m_omx_decoder OMX_StateExecuting PASS
[verbose] Open: m_omx_tunnel_sched Establish PASS
[verbose] Open: m_omx_sched OMX_StateExecuting PASS
[verbose] Open: m_omx_render GET OMX_IndexParamPortDefinition PASS
[verbose] Open: m_omx_render GET OMX_IndexParamPortDefinition PASS
[verbose] Open: m_omx_render OMX_StateIdle PASS
[verbose] Open: m_omx_render.GetOutputPort(): 221
[verbose] Open: m_omx_render Enable OUTPUT Port PASS
[verbose] Open: m_omx_render UseEGLImage PASS
[verbose] SendDecoderConfig: m_extrasize: 49
[verbose] SendDecoderConfig: m_extradata: 
[verbose] OMXDecoderBase::SendDecoderConfig m_extradata: 21264008 
[verbose] Open: SendDecoderConfig PASS
[verbose] Open: m_omx_render OMX_StateExecuting PASS
[verbose] Open: m_omx_render FillThisBuffer PASS
[verbose] OMXEGLImage::Open - decoder_component: 0x0x144b230, input_port: 0x82, output_port: 0x83 

[verbose] OpenDecoder: 
Video codec: omx-h264
Video width: 1280
Video height: 720
Video profile: 100
Video fps: 24

[verbose] videoPlayer->GetFPS(): 24
[verbose] OMXClock::OMXStart(0)
[verbose] Opened video PASS
[notice ] ofAppEGLWindow: runAppViaInfiniteLoop(): setting up notifications complete
[verbose] OMXVideo::Decode VDec : setStartTime 0.000000

[verbose] onUpdate:  EXITING VIA SIGNAL
[verbose] close:  isOpen: 1
[verbose] ~ofxOMXPlayerEngine START
[verbose] OMXPlayerVideoBase::Close()
[verbose] OMXPlayerVideoBase::Flush start
[verbose] OMXPlayerVideoBase::m_decoder->Reset
[verbose] OMXPlayerVideoBase::Flush end
[verbose] OMXPlayerVideoBase::Close() pre CloseDecoder
[verbose] COMXCoreComponent::WaitForCommand OMX.broadcom.clock      
                  wait timeout event.eEvent 0x00000000          
                  event.command 0x00000000                      
                  event.nData2 1

[verbose] COMXCore::Deinitialize
[verbose] ~ofxOMXPlayerEngine END
[verbose] destroyEGLImage: eglDestroyImageKHR PASS
[verbose] close:  isOpen: 0
[notice ] ofAppEGLWindow: destroyNativeKeyboard()
[notice ] ofAppEGLWindow: destroySurface(): destroying EGL surface
[verbose] close:  isOpen: 0
make: *** [run] Interrupt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.