ffmpeg distribution added to the repository
[Fobs.git] / FOBS_GUIDE
blob1e6a153fb6b62572bfd5142d6556f96a17fde8cb
1 FOBS_GUIDE - 0.4.2 - Easy steps for Fobs compilation and use
2 ------------------------------------------------------------
4 Fobs relies in a wide number of libraries, but many of them are optional. In this guide, we cover the most simple build scenario for Fobs (section 1) and provide examples of its use (section 2).
7 1 - FOBS COMPILATION:
9 The easiest way to compile Fobs is to use an ffmpeg build with no support for external libraries. Though some codecs will be left out of the compatibility list, most of them will still be usable. 
11 First of all you need appropriate build support installed in your operating system. Follow the instructions of section 2-A and 2-B of the INSTALL file to ensure you can start with the procedure.
13 We will assume that Fobs sources have been unpacked in the folder:
14 /path/to/fobs/sources
16 For simplicity, we will define the following env variable:
17 export FOBS_ROOT=/path/to/fobs/sources
19 1.1 - Building ffmpeg:
21 > cd $FOBS_ROOT
22 > tar xvfj resources/current-ffmpeg.tar.bz2
23 > cd ffmpeg
25 Configure depending on your system:
26 * MacOSX:
27 > ./configure --disable-shared --prefix=$FOBS_ROOT/external
29 * Linux:
30 > ./configure --disable-shared --prefix=$FOBS_ROOT/external --enable-pthreads
32 * MinGW:
33 > ./configure --disable-shared --prefix=$FOBS_ROOT/external --enable-memalign-hack
35 Run 'make':
36 > make
37 > make install
39 Manually install additional required files:
40 > cp libavformat/avi.h $FOBS_ROOT/external/include/libavformat/ 
41 > cp libavformat/riff.h $FOBS_ROOT/external/include/libavformat/
42 > mkdir $FOBS_ROOT/external/include/libswscale
43 > cp libswscale/swscale.h $FOBS_ROOT/external/include/libswscale/swscale.h
45 1.2 - Building Fobs:
46 > cd $FOBS_ROOT
47 Run the build script:
48 > ./buildFobs.sh FFMPEG_HOME=#external FOBS4JMF=yes OPTIMIZATION=yes DEBUG_SYMBOLS=no
50 Fobs binaries will be placed in the '$FOOB_ROOT/dist' folder.
53 2 - FOBS USAGE:
55 2.1 - FOBS4JMF:
56 Fobs is a programming library, and, as such, cannot be tested as a final user application. The most straightforward way to test Fobs capabilities is via the JMF plugin, Fobs4JMF. All the necessary files are copied into $FOBS_ROOT/dist/jmf during the build process.
57 > cd $FOBS_ROOT/dist/jmf
59 It is convenient to update LD_LIBRARY_PATH to include the plugin folder, so the native library can be found:
60 > export LD_LIBRARY_PATH=$FOBS_ROOT/dist/jmf (Linux)
61 > export DYLD_LIBRARY_PATH=$FOBS_ROOT/dist/jmf (MacOSX)
63 The Java Media Framework is included in this folder (jmf.jar). JMF includes a java-based Multimedia player called JMStudio. To run JMStudio we type the following command:
64 > java -cp jmf.jar JMStudio
66 If we run JMStudio like this, the Fobs4JMF plugin is not loaded. If we want to include the plugin in the execution we use the following command:
67 > java -cp fobs4jmf.jar:jmf.jar JMStudio
69 Different command line output indicates the presence of Fobs4JMF in the system. A short audio sample, in .ogg format, is also included in the folder. We can test how Fobs4JMF allows to handle additional formats using some online available videos:
70 >java -cp jmf.jar JMStudio "http://nasa.ibiblio.org/video/NASAKidsScienceNews/mpeg4/NASAKSN-HowDoSpaceShuttlesBlastOff.mp4"
71 (Returns error: Cannot find a suitable player)
73 >java -cp fobs4jmf.jar:jmf.jar JMStudio "http://nasa.ibiblio.org/video/NASAKidsScienceNews/mpeg4/NASAKSN-HowDoSpaceShuttlesBlastOff.mp4"
74 (After caching the file locally, the video starts playing)
76 2.2 - C++ Tests:
77 The folder $FOBS_ROOT/dist/test includes four simple example applications, focusing on describing the use of the library in different scenarios (decoding, encoding and transcoding):
78 - decode [-snap] input_filename: Decoder class use example. Decodes a multimedia file and shows characteristics and some decoding stats.
80 - reencode input_filename output_filename: Encoder class use example. Reencodes a video file with the following output parameters: Video-> frame_size=300x300, bitrate=600bps, codec=mpeg4; Audio-> sample_rate=22050, bitrate=32bps, codec=mp3 stream.
82 - transcode input_filename output_filename: Transcoder class use example. Transcode a video file into AVI format (video and audio codecs remain unchanged).