#10 jumping mjpeg/avi movies crashes

closed-fixed
nobody
None
5
2011-10-02
2010-07-02
sebastien loss
No

I am developping a little video player synced with MTC with keystoning and timeline editor.
GSVideo on linux gstreamer work very well... but some codecs are problematic like mjpeg (at 100%) that we often use as Blender output, because for this broadcast quality. Totem react very well with our movie files but gstreamer is very unstable with it :
- random crashes when reading it
- especialy when jumping on it

The processing context is : framerate at 30 with mjpeg movies at 30fps
We are using the last stable release. On other hand , with XVID / MPEG4 no problem at all.

question : there is a workaround or a best manner to seeking or jumping a video files. Maybe with GSPipe ?
question 2 : where I can find a gstreamer pipe tutorial for playing, reading, seeking or jumping a movie ?

i am a newbie with processing so maybe I miss something about using gsvideo ;)
In attachment there is a processing log of my last crash.
thanks a lot. Bye

Discussion

  • sebastien loss
    sebastien loss
    2010-07-02

    hs error pid log

     
    Attachments
  • sebastien loss
    sebastien loss
    2010-07-04

    oups !!
    "Totem react very well with our movie files but gstreamer is very unstable with it :"

    I mean : "Totem (gstreamer) react very well with our movie files but GSVideo is very unstable with it :"

    Sorry

     
  • sebastien loss
    sebastien loss
    2010-07-07

    I had reinstalled gsvideo 0.5.1 and after some tests reading and jumping mjpeg avi files cause no problem at all.... so gsvideo 0.6 is not ready to be release as stable version... ;)

     
  • Andres Colubri
    Andres Colubri
    2010-07-21

    I added some fixes to the speed and jump methods in the latest test release of gsvideo (20100720). I tried with a small mjpeg video in a avi container, and works fine. Could you check this release as well and let me know if you still have problems?

    Regarding to your 2nd question, I'm not sure if you can jump to a specific frame using a pipeline. Since gstreamer is a low level library, it has functions to do this, but they are meant to be accessed from your code (this is what gsvideo does inside the GSMovie class, for instance).

     
  • sebastien loss
    sebastien loss
    2010-07-21

    Arg !! That worse !! My app immediatly crashs when it try to load movies. It reads videos in a "video" folder. I removed the Mpeg ones and Quicktime ones and finally my app runs only with some Xvid.....

    Examples coming with GSMovie package work fine...

    Here my simple loading fonction (for recording movie properties ). Note that fct forward in video at each frame because I want a feedback (loading bar for example) :

    void loadMovies(String[] listfiles)
    {

    nb = nboffilestoload -1;
    
    if\(nb >= 0\) \{
    
            if\(initvideo\) \{
                movies\[nb\] = new GSMovie\(this, "videos/" + listfiles\[nb\]\);    
                movies\[nb\].volume\(0\);
                progressbar += "\#";
                movies\[nb\].play\(\);
                initvideo = \!initvideo;
            \}
    
            if \(movies\[nb\].available\(\)\)
            \{
    
                if \(   \( 1 < movies\[nb\].width\) &&
                            \( 1 < movies\[nb\].height\) && \( 0.0 < movies\[nb\].duration\(\)\) \)\{
    
                    movieCards\[nb\] = new movieCard\(  nb, movies\[nb\].getFilename\(\),
                    movies\[nb\].duration\(\),
                    movies\[nb\].width,
                    movies\[nb\].height \);
    
                    movies\[nb\].goToBeginning\(\);
                    movies\[nb\].pause\(\);
    
                    LCDbar.update\("LOADING VIDEOS :"+progressbar, 30, false\);
                    nboffilestoload--;
                    initvideo = \!initvideo;
                \}
    
                movies\[nb\].read\(\);
                \}
    
    \}
    

    }

     
  • sebastien loss
    sebastien loss
    2010-07-21

    Oups, I just find why it crashes : I have to add "else" before movie.read() .... because after the props are retrieved the movie is paused and read a last time. This read fonction is very fragile :) No problem with 0.5.1.
    Anyway YES mjpeg work well with your last release ! Thank a lot !

     
  • sebastien loss
    sebastien loss
    2010-07-21

    So I spoke too soon ... same problem with this release than 0.6... maybe it's me... I'll try to test jump fct in a small applet.

     
  • Andres Colubri
    Andres Colubri
    2010-07-21

    ok, so this bug can be closed, right?

     
  • sebastien loss
    sebastien loss
    2010-07-22

    I have review my code and it's seem to be fine and rather clear.
    When I jump mjpeg it randomly crash with this error : C [libc.so.6+0x86dbb] memcpy+0x15b (or memcpy+02x2f3)
    the sequencer load videos once -> read each video -> put pixel in gltexture -> used by a mesh in gloffscren -> get texture of this gloffscreen to put it in keystone renderer (basically to a PImage pointer).
    I use your GLgraphics library and your processing renderer. gltexture and gloffscreen and keystone surface share the same resolution. Only videos resolutions can vary from 600x400 to 1440x810.
    Again it fine with 0.5.1. Maybe your last version do something at a lower level that could bypass a memory allocation or adaptation tests.

     
  • Andres Colubri
    Andres Colubri
    2010-07-22

    Ok, I'll compare the 0.5.1 with the latest release to see if I find something.

    btw, what version of linux are you using?

     
  • Andres Colubri
    Andres Colubri
    2010-07-23

    Disregard the questions about Linux distro/version, I just saw that info in the error log. Thanks.

     
  • Andres Colubri
    Andres Colubri
    2010-07-23

    There is only one significant difference in the code of GSMovie between version 0.5.1 and the latest test release, which could account for your problem. In one of the 0.6-pre releases I started including a new mode called direct buffer pass which should improve performance. I don't expect this feature to create crashes like the ones you are experiencing, but just in case I uploaded a new test release (20100723) which allows you to disable this mode. To do so, add the following line in the setup() function:

    GSVideo.passDirectBuffer = false;

    before any other gsvideo operation.

    Another suggestion is that you put the mov.read() call inside the movieEvent(GSMovie mov) function.

    If nothing of this helps, could you upload a minimal, complete sketch which reproduces the problem?

    Thanks.

     
  • Andres Colubri
    Andres Colubri
    2011-03-12

    Please check again once I release version 0.8 (it should be in the following days). Also make sure you are using an up-to-date version of gstreamer on your system (I assume you are working on Linux).

     
  • Andres Colubri
    Andres Colubri
    2011-10-02

    • status: open --> closed-fixed
     
  • Andres Colubri
    Andres Colubri
    2011-10-02

    The issues in the jump() method have been addressed in rev. 243