| OLD | NEW |
| 1 Contains the sources used to compile FFmpeg binaries used by Google Chrome and | 1 Contains the sources used to compile FFmpeg binaries used by Google Chrome and |
| 2 Chromium. | 2 Chromium. |
| 3 | 3 |
| 4 The FFmpeg source is from Alexander Strange's ffmpeg-mt branch: | 4 The FFmpeg source is from Alexander Strange's ffmpeg-mt branch: |
| 5 git://gitorious.org/~astrange/ffmpeg/ffmpeg-mt.git | 5 git://gitorious.org/~astrange/ffmpeg/ffmpeg-mt.git |
| 6 Commit: 42b521db9177ed2d4e62845659fdcd44c59757f9 | 6 Commit: 42b521db9177ed2d4e62845659fdcd44c59757f9 |
| 7 | 7 |
| 8 This corresponds to r18769 in the mainline ffmpeg repository. | 8 This corresponds to r18769 in the mainline ffmpeg repository. |
| 9 | 9 |
| 10 The Theora patches are also from the ffmpeg-mt branch above. The git commit | 10 The Theora patches are also from the ffmpeg-mt branch above. The git commit |
| 11 numbers and the corresponding svn revisions for them from ffmpeg mainline can | 11 numbers and the corresponding svn revisions for them from ffmpeg mainline can |
| 12 be found at the top of each patch. | 12 be found at the top of each patch. |
| 13 | 13 |
| 14 The libswscale source is from the public libswscale repository: | 14 The libswscale source is from the public libswscale repository: |
| 15 git://git.ffmpeg.org/libswscale | 15 git://git.ffmpeg.org/libswscale |
| 16 Commit: 69fc1002e2c92aac84dccc5047141feefc94b309 | 16 Commit: 69fc1002e2c92aac84dccc5047141feefc94b309 |
| 17 | 17 |
| 18 The static_pthread_O2.patch does two things. First, it uses -O2 instead of | 18 The static_pthread_O2.patch does two things. First, it uses -O2 instead of |
| 19 -O3 to build ffmpeg. This yields a significant savings in binary size, and | 19 -O3 to build ffmpeg. This yields a significant savings in binary size, and |
| 20 also seems to improve performance (lower CPU usage). Second, the patch adds | 20 also seems to improve performance (lower CPU usage). Second, the patch adds |
| 21 a modification that statically links pthreadGC2 into avcodec-52.dll on an | 21 a modification that statically links pthreadGC2 into avcodec-52.dll on an |
| 22 MSYS/MinGW build in Windows. This reduces the number of DLLs required for | 22 MSYS/MinGW build in Windows. This reduces the number of DLLs required for |
| 23 distribution, and lowers the total size of the binaries. | 23 distribution, and lowers the total size of the binaries. |
| 24 | 24 |
| 25 Steps for extracting: | 25 Steps for extracting: |
| 26 1) Extract ffmpeg-mt, which creates the directory ffmpeg-mt: | 26 1) Extract ffmpeg-mt, which creates the directory ffmpeg-mt: |
| 27 tar xzvf ffmpeg-mt.tar.gz | 27 tar xf ffmpeg-mt.tar.gz |
| 28 2) Descend into the newly created ffmpeg-mt directory: | 28 3) Extract libswscale in place: |
| 29 cd ffmpeg-mt | 29 cd ffmpeg-mt |
| 30 3) Extract libswscale in place: | 30 tar xf ../libswscale.tar.gz |
| 31 tar xzvf ../libswscale.tar.gz | |
| 32 4) Apply the static_pthread_O2.patch: | 31 4) Apply the static_pthread_O2.patch: |
| 33 patch -p1 < ../patches/to_upstream/01_static_pthread_O2.patch | 32 patch -p1 < ../patches/to_upstream/01_static_pthread_O2.patch |
| 34 5) Apply additional security patches: | 33 5) Apply additional security patches: |
| 35 patch -p1 < ../patches/to_upstream/02_mov_dref_looping.patch | 34 patch -p1 < ../patches/to_upstream/02_mov_dref_looping.patch |
| 36 patch -p1 < ../patches/to_upstream/03_aac_zero_bands.patch | |
| 37 patch -p1 < ../patches/to_upstream/04_mpeg4_video_to_elementary_stream.pa
tch | 35 patch -p1 < ../patches/to_upstream/04_mpeg4_video_to_elementary_stream.pa
tch |
| 38 patch -p1 < ../patches/to_upstream/05_vc1_bsfs.patch | 36 patch -p1 < ../patches/to_upstream/05_vc1_bsfs.patch |
| 39 patch -p1 < ../patches/to_upstream/06_respect_flac_dirac_configure.patch | 37 patch -p1 < ../patches/to_upstream/06_respect_flac_dirac_configure.patch |
| 40 patch -p1 < ../patches/to_upstream/08_ogg_seek_missing_first_frame.patch | 38 patch -p1 < ../patches/to_upstream/08_ogg_seek_missing_first_frame.patch |
| 41 patch -p1 < ../patches/to_upstream/09_remove_decode_on_config_no_svq3.pat
ch | 39 patch -p1 < ../patches/to_upstream/09_remove_decode_on_config_no_svq3.pat
ch |
| 42 patch -p1 < ../patches/to_upstream/10_resolve_text_relocations.patch | |
| 43 patch -p1 < ../patches/ugly/13_get_bits_overrun.patch | 40 patch -p1 < ../patches/ugly/13_get_bits_overrun.patch |
| 44 patch -p1 < ../patches/ugly/14_enforce_theora_oob.patch | 41 patch -p1 < ../patches/ugly/14_enforce_theora_oob.patch |
| 45 patch -p1 < ../patches/ugly/15_enforce_vorbis_oob.patch | 42 patch -p1 < ../patches/ugly/15_enforce_vorbis_oob_divzero.patch |
| 46 patch -p1 < ../patches/ugly/16_avoid_floor_divzero.patch | 43 patch -p1 < ../patches/ugly/16_aac_oob_read.patch |
| 47 patch -p1 < ../patches/ugly/17_aac_oob_read.patch | |
| 48 | 44 |
| 49 There is also a script "make_src_tree.sh" that automates most of the steps | 45 There is also a script "make_src_tree.sh" that automates most of the steps |
| 50 above for you. It is currently only tested on linux. | 46 above for you. It is currently only tested on linux. |
| 51 | 47 |
| 52 NOTE: Under Windows it is recommended to use Chromium's MinGW/MSYS environment | 48 NOTE: Under Windows it is recommended to use Chromium's MinGW/MSYS environment |
| 53 or 7-Zip to extract the archives. We've experienced issues when using WinRAR. | 49 or 7-Zip to extract the archives. We've experienced issues when using WinRAR. |
| 54 | 50 |
| 55 Since FFmpeg is sandboxed inside the render process, we're only interested in | 51 Since FFmpeg is sandboxed inside the render process, we're only interested in |
| 56 building the absolute minimum. | 52 building the absolute minimum. |
| 57 | 53 |
| 58 Example configure flags suitable for Chromium (Ogg+Theora+Vorbis), which will | 54 Example configure flags suitable for Chromium (Ogg+Theora+Vorbis), which will |
| 59 build and install to the directory ./chromium-ffmpeg: | 55 build and install to the directory ./chromium-ffmpeg: |
| 60 | 56 |
| 61 ./configure --disable-ffmpeg --disable-ffplay --disable-ffserver \ | 57 ./configure --disable-ffmpeg --disable-ffplay --disable-ffserver \ |
| 62 --enable-shared --disable-static --disable-debug \ | 58 --enable-shared --disable-static --disable-debug \ |
| 63 » --disable-network --disable-encoders --disable-decoders \ | 59 » --disable-network --disable-encoders --disable-decoders \ |
| 64 » --disable-hwaccels --disable-muxers --disable-demuxers \ | 60 » --disable-hwaccels --disable-muxers --disable-demuxers \ |
| 65 » --disable-parsers --disable-bsfs --disable-protocols \ | 61 » --disable-parsers --disable-bsfs --disable-protocols \ |
| 66 » --disable-devices --disable-filters --disable-gpl \ | 62 » --disable-devices --disable-filters --disable-gpl \ |
| 67 » --enable-decoder=theora --enable-decoder=vorbis \ | 63 » --enable-decoder=theora --enable-decoder=vorbis \ |
| 68 » --enable-demuxer=ogg --enable-pthreads --enable-yasm \ | 64 » --enable-demuxer=ogg --enable-pthreads --enable-yasm \ |
| 69 » --prefix=./chromium-ffmpeg | 65 » --prefix=./chromium-ffmpeg |
| 70 | 66 |
| 71 The following flags are used for Google Chrome, which also include non-free | 67 The following flags are used for Google Chrome, which also include non-free |
| 72 decoders (H.264, AAC and MP3): | 68 decoders (H.264, AAC and MP3): |
| 73 ./configure --disable-ffmpeg --disable-ffplay --disable-ffserver \ | 69 ./configure --disable-ffmpeg --disable-ffplay --disable-ffserver \ |
| 74 --enable-shared --disable-static --disable-debug \ | 70 --enable-shared --disable-static --disable-debug \ |
| 75 » --disable-network --disable-encoders --disable-decoders \ | 71 » --disable-network --disable-encoders --disable-decoders \ |
| 76 » --disable-hwaccels --disable-muxers --disable-demuxers \ | 72 » --disable-hwaccels --disable-muxers --disable-demuxers \ |
| 77 » --disable-parsers --disable-bsfs --disable-protocols \ | 73 » --disable-parsers --disable-bsfs --disable-protocols \ |
| 78 » --disable-devices --disable-filters --disable-gpl \ | 74 » --disable-devices --disable-filters --disable-gpl \ |
| 79 --enable-decoder=theora --enable-decoder=vorbis \ | 75 --enable-decoder=theora --enable-decoder=vorbis \ |
| 80 » --enable-demuxer=ogg --enable-decoder=aac --enable-decoder=h264 \ | 76 » --enable-demuxer=ogg --enable-decoder=aac --enable-decoder=h264 \ |
| 81 » --enable-decoder=mp3 --enable-demuxer=mp3 --enable-demuxer=mov \ | 77 » --enable-decoder=mp3 --enable-demuxer=mp3 --enable-demuxer=mov \ |
| 82 » --enable-parser=mpegaudio --enable-pthreads --enable-yasm \ | 78 » --enable-parser=mpegaudio --enable-pthreads --enable-yasm \ |
| 83 » --prefix=./chrome-ffmpeg | 79 » --prefix=./chrome-ffmpeg |
| 84 | 80 |
| 85 If building on Windows with Chromium's MinGW/MSYS environment, add the following
: | 81 If building on Windows with Chromium's MinGW/MSYS environment, add the following
: |
| 86 --target-os=mingw32 --enable-memalign-hack --cc=gcc-sjlj | 82 --target-os=mingw32 --enable-memalign-hack --cc=gcc-sjlj |
| 87 | 83 |
| 88 To build: | 84 To build: |
| 89 make | 85 make |
| 90 | 86 |
| 91 To install: | 87 To install: |
| 92 make install | 88 make install |
| 93 | 89 |
| 94 On Windows, run editbin.exe on the resulting DLLs to enable additional security | 90 On Windows, run editbin.exe on the resulting DLLs to enable additional security |
| 95 features: | 91 features: |
| 96 1) Start a Visual Studio command prompt: | 92 1) Start a Visual Studio command prompt: |
| 97 Start Menu | 93 Start Menu |
| 98 > Microsoft Visual Studio 2005 | 94 > Microsoft Visual Studio 2005 |
| 99 > Visual Studio Tools | 95 > Visual Studio Tools |
| 100 > Visual Studio 2005 Command Prompt | 96 > Visual Studio 2005 Command Prompt |
| 101 2) Change directories to where the DLLs were built | 97 2) Change directories to where the DLLs were built |
| 102 3) editbin.exe /NXCOMPAT /DYNAMICBASE *.dll | 98 3) editbin.exe /NXCOMPAT /DYNAMICBASE *.dll |
| 103 Now copy the resulting avcodec-52.dll, avformat-52.dll, and | 99 Now copy the resulting avcodec-52.dll, avformat-52.dll, and |
| 104 avutil-50.dll alongside chrome.exe for windows. | 100 avutil-50.dll alongside chrome.exe for windows. |
| 105 | 101 |
| 106 On Mac, copy the resulting libavcodec.52.dylib, libavformat.52.dylib, and | 102 On Mac, copy the resulting libavcodec.52.dylib, libavformat.52.dylib, and |
| 107 libavutil.50.dylib into the Chromium.app/Contents/MacOS folder alongside the | 103 libavutil.50.dylib into the Chromium.app/Contents/MacOS folder alongside the |
| 108 Chromium binary. | 104 Chromium binary. |
| 109 | 105 |
| 110 On Linux, copy the resulting libavcodec.so.52, libavformat.so.52, and | 106 On Linux, copy the resulting libavcodec.so.52, libavformat.so.52, and |
| 111 libavutil.so.50 alongside the chrome executable. | 107 libavutil.so.50 alongside the chrome executable. |
| OLD | NEW |