Æí¸®ÇÑ È£½ºÆà ¹Ì¼ÒIDC

   
 
 
 

      1Â÷ ³×ÀÓ¼­¹ö :
      ns1.misoidc.com
      101.79.73.101

      2Â÷ ³×ÀÓ¼­¹ö :
      ns2.misoidc.com
      101.79.73.105

      ¾îÁ¦ : 301 ,¿À´Ã : 233
      Àüü : 1,240,727


     

 

 
ÀÛ¼ºÀÏ : 10-11-01 17:39
¿ìºÐÅõ¿¡ ffmpeg h.264 ¼³Ä¡
 ±Û¾´ÀÌ : ½ÑÀ¥È£½ºÆÃ
Á¶È¸ : 162,140  
   http://ubuntuforums.org/showthread.php?t=786095 [15405]
HOWTO: Install and use the latest FFmpeg and x264

FFmpeg is a versatile tool to encode and decode a multitude of video and audio formats. x264 encodes high-quality H.264 video.

Although FFmpeg and x264 are available in the Ubuntu repositories, you may need to compile from source. For example, the ffmpeg-user mailing list requires that you use the latest FFmpeg before asking for help. You may also like to have the bleeding-edge for encoding videos. Also, FFmpeg in the Ubuntu repository may not support necessary encoders, decoders, and formats.


Choose your Ubuntu
0.The instructions on the page are for Ubuntu Maverick Meerkat 10.10. Separate instructions are also available for older releases.

Install the Dependencies
1. Uninstall x264, libx264-dev, and ffmpeg if they are already installed. Open a terminal and run the following (you can usually paste into a terminal with shift+ctrl+v). Copy and paste the whole code box for each step.
Code:
sudo apt-get remove ffmpeg x264 libx264-dev
2. Get all of the packages you will need to install FFmpeg and x264 (you may need to enable the universe and multiverse repositories):
Code:
sudo apt-get update
sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html \
    libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev \
    libtheora-dev libvorbis-dev libvpx-dev libx11-dev libxfixes-dev libxvidcore-dev \
    zlib1g-dev

Install x264
3. Get the current source files, compile, and install.
Code:
cd
git clone git://git.videolan.org/x264.git
cd x264
./configure
make
sudo checkinstall --pkgname=x264 --pkgversion "2:0.`grep X264_BUILD x264.h -m1 | \
    cut -d' ' -f3`.`git rev-list HEAD | wc -l`+git`git rev-list HEAD -n 1 | \
    head -c 7`" --backup=no --deldoc=yes --fstrans=no --default

Install FFmpeg
4. Get the most current source files, compile, and install. Run "./configure --help" to see what other features you can enable/disable. Nightly FFmpeg snapshots are also available.
Code:
cd
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \
    --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
    --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis \
    --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
make
sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`LANG=C svn info | \
    grep Revision | awk '{ print $NF }'`" --backup=no --deldoc=yes --fstrans=no \
    --default
hash x264 ffmpeg ffplay

Install qt-faststart (optional)
5. This is a useful tool included with FFmpeg that rearranges a file with H.264 video, "such that the moov atom is in front of the data, thus facilitating network streaming". Basically, it allows web movies to start playing before they are completely downloaded. Usage: qt-faststart input.foo output.foo.
Code:
cd ~/ffmpeg
make tools/qt-faststart
sudo checkinstall --pkgname=qt-faststart --pkgversion "4:SVN-r`LANG=C svn info | \
    grep Revision | awk '{ print $NF }'`" --backup=no --deldoc=yes --fstrans=no \ 
    --default install -D -m755 tools/qt-faststart /usr/local/bin/qt-faststart
That's it for installation. You can keep the ~/x264 and ~/ffmpeg directories if you later want to update the source files to a new revision. See Updating FFmpeg and x264 below for more details.



Using FFmpeg and x264
The easiest method for high quality video encoding is by using the libx264 presets that are included with FFmpeg. I recommend reading the FFmpeg x264 encoding guide before trying these presets so you have a better idea of what to use. You can add options such as frame size (for example: -s 640x480) or tweak my examples to customize your encode. You can see a current list of all libx264 presets (such as ipod or lossless) or after installation look in the /usr/local/share/ffmpeg directory.

One-pass CRF (Constant Rate Factor) using the slow preset. One-pass CRF is good for general encoding and is what I use most often. Adjust -crf to change the quality. Lower numbers mean higher quality and a larger output file size. A sane range is 18 to 28.
Code:
ffmpeg -i input.avi -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre slow -crf 22 \
    -threads 0 output.mp4
Two-Pass encode using the fast presets. Two-pass encoding is used when you are targeting a specific bitrate and/or final output file size.
Code:
ffmpeg -i input.avi -pass 1 -vcodec libx264 -vpre fast_firstpass -b 512k -bt 512k
    -threads 0 -f rawvideo -an -y /dev/null && ffmpeg -i input.avi -pass 2 -acodec libfaac \
    -ab 128k -ac 2 -vcodec libx264 -vpre fast -b 512k -bt 512k -threads 0 output.mp4
iPod 640x480 using the slow and ipod640 presets:
Code:
ffmpeg -i input.avi -acodec libfaac -aq 100 -ac 2 -vcodec libx264 -vpre slow \
    -vpre ipod640 -crf 26 -map_meta_data 0:0 -vf scale=640:-1 -threads 0 output.mp4


Updating FFmpeg and x264
Development of FFmpeg and x264 is active and an occasional update can give you new features and bug fixes. To update FFmpeg and x264 you will need to remove the packages, make distclean, update the source, recompile, and install. To update x264:
Code:
sudo apt-get remove ffmpeg x264 libx264-dev libvpx
cd ~/x264
make distclean
git pull
Now compile x264 as shown earlier in the guide starting with the x264 ./configure line. Now update FFmpeg:
Code:
cd ~/ffmpeg
make distclean
svn update
Finish the installation starting with the FFmpeg ./configure line.



Reverting Changes Made by This Guide
To remove FFmpeg/x264 and other packages added for this guide:
Code:
sudo apt-get remove x264 ffmpeg qt-faststart build-essential subversion git-core \
    checkinstall yasm texi2html libfaac-dev libmp3lame-dev libsdl1.2-dev libtheora-dev \
    libvorbis-dev libvpx-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev
Lastly, delete the ffmpeg and x264 directories in your home folder.


Additional Resources
If You Need Help
Feel free to ask your questions here and I'll try to answer you. Helpful information includes your Ubuntu version, names of any third-party repositories or PPAs you are using, FFmpeg command, and the complete FFmpeg output if applicable.

Recent Updates
2010-10-21: Added libxext-dev dependency to Hardy. x11grab was not being enabled because this dependency was missing.

2010-09-20: Added Meerkat and archived Lucid instructions. Removed Dapper link. Added LANG=C to qt-faststart checkinstall.

2010-09-16: Added LAME instructions (more info). Broke up the code boxes on the Lucid guide to make them possibly easier to read. Tried making some parts of the guide less verbose. Added --deldoc=yes to the checkinstalls so the source directories can be deleted without sudo.


 
 

Total 78
¹øÈ£ Á¦   ¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
33 ¸®´ª½º¿ë ¹é½Å - f-prot ¼³Ä¡ ¹× »ç¿ë¹ý ½ÑÀ¥È£½ºÆà 05-24 66493
32 [MS-SQL]SQL Server 2005 ¿¬°á¿À·ù Áø´Ü¹æ¹ý ½ÑÀ¥È£½ºÆà 04-04 45434
31 odbc connection string ½ÑÀ¥È£½ºÆà 04-04 29290
30 NFS ¼­¹ö ±¸Ãà ½ÑÀ¥È£½ºÆà 03-31 31596
29 ¾ÆÆÄÄ¡¿¡ GeoIP ¸ðµâ ¼³Ä¡ÇÏ´Â ¹æ¹ý ½ÑÀ¥È£½ºÆà 02-11 47191
28 ¡°¹«Áß´Ü µ¥ÀÌÅͼ¾ÅÍ ÀÌÀü? ¶È¶ÈÇÑ ³×Æ®¿öÅ©°¡ Çعý¡±¡¦CJ½Ã½ºÅÛ¡¦ ½ÑÀ¥È£½ºÆà 02-07 25321
27 php ÇÔ¼öÁ¦ÇÑ ½ÑÀ¥È£½ºÆà 01-14 26920
26 À̹ÌÁö ¿ÜºÎ¸µÅ© Â÷´Ü ½ÑÀ¥È£½ºÆà 12-16 22129
25 SSLÀÎÁõ¼­ Linux ¼³Ä¡ ¹æ¹ý ½ÑÀ¥È£½ºÆà 12-13 24839
24 mysql ¸í·É¾î Á¤¸® ½ÑÀ¥È£½ºÆà 11-01 28492
23 mysql »ç¿ëÀÚ °èÁ¤ Ãß°¡Çϱ⠽ÑÀ¥È£½ºÆà 11-01 20789
22 °­·ÂÇÑ ¿ÀǼҽº ÆÄƼ¼Ç º¹±¸ ÇÁ·Î±×·¥ - TestDisk ½ÑÀ¥È£½ºÆà 11-01 52989
21 PHP Session °øÀ¯ (memcached ÀÌ¿ë) ½ÑÀ¥È£½ºÆà 11-01 68721
20 ¿ìºÐÅõ¿¡ ffmpeg h.264 ¼³Ä¡ ½ÑÀ¥È£½ºÆà 11-01 162141
19 ½º¸¶Æ®Æù¿ë ¶óÀÌºê ½ºÆ®¸®¹Ö ¼­¹ö ±¸Ãà ½ÑÀ¥È£½ºÆà 10-11 26691
 1  2  3  4  5  6