Menu

#23 Large videos 'choppy' under Linux / Android

v1.0
unread
nobody
None
5
2014-06-23
2014-06-17
Anonymous
No

I am attempting to play a large video (1280x1440) at 30fps. Under Win32, the video plays smoothly, without issue. However, when the same program plays the same video under Linux or Android, the video plays very choppy, and skips many frames (it only updates the video about once per second). Also note that there is no message regarding "dropping frames" (or any other messages for that matter) from libtheoraplayer. This is either an issue with libtheoraplayer or possibly (however doubtful) a bug with glTexSubImage2d() / glTexImage2d() [I have tried both with the same results] under Linux.

Another thing to note (also only on Linux / Android): if the video is set to "AutoRestart," it will play at normal speed on the first time through with said choppiness, but then it appears to play slower (about 1/2 speed) on every subsequent time through, and when it plays slower, it does not appear to drop frames (or at least nowhere near as many).

Just to note, both Windows and Linux machines are running nVidia GT-series gfx cards.

Discussion

  • Krešimir Špes

    Krešimir Špes - 2014-06-18

    Hi,

    Hmm, very important, which preprocessor macros did you use to compile libtheora and libtheoraplayer for linux and android? We keep android build scripts as visual studio project using vs-android extension and the preprocessor macros are very very important because they include/exclude CPU level hardware accelerated decoding in both those libraries.

    and which architecture is that android? X86 or ARM?

    Although while I can understand android maybe, linux iz puzzling me, even without acceleration it shouldn't be this choppy.. Can you maybe send me this video to test on a Mac? If you're not able to disclose this particular video, can you make a dummy video that behaves the same on your system?

    It's probably not a glTexImage bug although I have encountered this as a performance issue on some androids, but not nearly as much.

    Also, please tell me a bit about your setup, what are you using on linux? SDL + OpenGL? be as descriptive as possible please :)

    And one last thing, if you could send me demo source code that can compile on Ubuntu, I can test the fix directly (assuming it's not a preprocessor issue)

     
  • Joe LeVeque

    Joe LeVeque - 2014-06-18

    Thanks for the quick reply!

    First, to add some more detail:

    On Android, I am compiling for ARM architecture.

    My setup is SDL2 + OpenGL for all platforms.

    Especially with regards to Android, I had a suspicion that preprocessor macros may be the culprit. For Android I have created an automated build system for libraries that relies on the standard Android NDK build process, so I created my own makefiles for libtheoraplayer, and therefore I was unaware you had already created an Android build system and that it was wrapped up in Visual Studio. I compared my makefile with your VS project, and realized that I was compiling for Android without the "NEON" macros. I added them in to my makefile, and due to the Neon (v7a) architecture, I also had to build the lib using the armeabi-v7a toolchain, as opposed to the default armeabi toolchain. This now appears to give me much better performance on Android. The video is still not quite perfectly smooth, but this may just be due to hardware limitations. I will continue to investigate this independently.

    However, when compiling for Linux (32-bit, static lib), I am generating makefiles using CMake and I am using the following preprocessor macros for libtheoraplayer, and yet the problem persists:

    -D__THEORA -D_YUV_LIBYUV -D__SSSE3__ -DTHEORAVIDEO_EXPORTS -D_LIB
    

    Could you confirm that these are correct for a 32-bit Linux build? Is there anything I'm missing? Any other macros I should try? If you don't see anything obviously wrong, I am more than willing to send you the video to try for yourself - just let me know where to send it. Thanks again!

     
  • Joe LeVeque

    Joe LeVeque - 2014-06-22

    A bit more information on Linux: After compiling different versions of the theoraplayer library (with the flags noted in my previous post), I have found that the 1/2 speed-slowdown-on-auto-restart issue I mentioned earlier was introduced in revision 265.

    I also noticed a significant increase in choppiness between revisions 225 and 227. I'm not quite sure if the change that introduced this choppiness was in revision 226 or 227, because revision 226 would not build due to missing libyuv system heades errors. Please let me know if there's anything else I can do to help you narrow this down further.

     
  • Krešimir Špes

    Krešimir Špes - 2014-06-23

    I didn't get email notifications from the google code tracker, let's switch the discusson there now.

    link: hhttps://code.google.com/p/libtheoraplayer/issues/detail?id=2

     

Log in to post a comment.