3

私が使用している: UBUNTU 14.04 + SDL 2.0.4 + Code::Blocks 13.12 - ( C++ ) - libtheora.a (v.1.1.1)にリンク

TARGET: SDL2 アプリケーションで Ogg Theora ビデオを再生(デコード)できること。
ffmpeg ライブラリを使用できます。しかし、彼らは MPEG を使用しているため、ライセンスの問題があります...など...そこで、 「特許を取得していない」ため、 http:
//www.theora.org から Ogg Theora ライブラリを選択しました。(彼らはシンプルで非常に寛容なライセンスを持っており、「独自の」コーデックは使用されていません)。

私は Web で、C++ での非常に単純なSDL2 + Ogg Theora ビデオ再生の例を検索してきました。オーディオをデコードする必要はなく、私の場合はビデオのみで、SDL2 に送信します (おそらくテクスチャに?...)。しかし、関連するものは見つかりませんでした。「乱雑な」コードしか見つかりませんでしたが、それでも機能しませんでした。

誰でもコード スニペットを共有できますか (解決策 / ヒント / その他のアイデア)?...

これまでのコード...
(このテストでは、「theoraplay.h」を使用しています -- https://icculus.org/theoraplay -- 現時点では)

// My project linkage:
-lSDL2
-lSDL2_image
-lSDL2_mixer
-logg
-lvorbis
-lvorbisenc
-lvorbisfile
-ltheora
-ltheoraenc
-ltheoradec

// SDL2:
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>

// OGG Library: (The multimedia wrapper)
#include "ogg/ogg.h"

// VORBIS Library: (Audio)
#include "vorbis/codec.h"
#include "vorbis/vorbisenc.h"
#include "vorbis/vorbisfile.h"

// THEORA Library: (Video)
#include "theora/theora.h"
#include "theora/theoraenc.h"
#include "theora/theoradec.h"    

// The "framework" for Ogg Theora video play, from: https://icculus.org/theoraplay      
// I'm Testing it... 
#include "theoraplay.h"


// SDL2 - Objects:
SDL_Surface* surface;
SDL_Texture* texture;
SDL_Rect rectangle;

// THEORAPLAY - Objects:
THEORAPLAY_Decoder* decoder = NULL; // Will return a Link error... Why?...
const THEORAPLAY_VideoFrame* video = NULL;  // No issues (Links and runs ok)
const THEORAPLAY_AudioPacket* audio = NULL; // No issues (Links and runs ok)




int main(int args, char* argv[]){

   // (SDL2 code to create the window, renderer, events, etc, goes here...) 

   surface = IMG_Load("images/example.png"); // Load an image.       
   texture = SDL_CreateTextureFromSurface(renderer, temp); // Pass the image into a texture.

   // "ERROR" - LOG says: undefined reference to "THEORAPLAY_startDecodeFile"...
   decoder = THEORAPLAY_startDecodeFile("bunny.ogg", 20, THEORAPLAY_VIDFMT_YV12);
   // "bunny.ogg" - Ogg video from: https://peach.blender.org/download

   // SDL2: Here, will be added the code to pass THEORA frames into a SDL2 streaming texture...

   while(!quit){

      // Render everything:
      SDL_RenderCopy(renderer, texture, NULL, &rectangle);

   };

};
4

0 に答える 0