Page 29 of 241 FirstFirst ... 1927282930313979129 ... LastLast
Results 281 to 290 of 2402

Thread: HOWTO: Install and use the latest FFmpeg and x264

  1. #281
    Join Date
    Jun 2007
    Beans
    379

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Quote Originally Posted by Ng Oon-Ee View Post
    Hey, I recently tried to install OpenCV, specifically libcv-dev, libcvaux-dev, and libhighgui-dev. They depend on libavcodec-dev, libavformat-dev, libavutil-dev, which clashes with ffmpeg as I've compiled following this guide.

    So, I get these errors:-
    Code:
    E: /var/cache/apt/archives/libavutil-dev_3%3a0.svn20080206-12ubuntu3_amd64.deb: trying to overwrite `/usr/lib/pkgconfig/libavutil.pc', which is also in package ffmpeg
    E: /var/cache/apt/archives/libavcodec-dev_3%3a0.svn20080206-12ubuntu3_amd64.deb: trying to overwrite `/usr/lib/pkgconfig/libavcodec.pc', which is also in package ffmpeg
    E: /var/cache/apt/archives/libavformat-dev_3%3a0.svn20080206-12ubuntu3_amd64.deb: trying to overwrite `/usr/lib/pkgconfig/libavformat.pc', which is also in package ffmpeg
    Any way I can tell the package to simply reuse what's available? Or do I need to recompile OpenCV itself from source?
    In answer to my own question, I discovered that the ffmpeg executable that's built within ~/ffmpeg in this guide is fully useable even without being installed. That saves me a lot of headache dealing with the packaging system and all, only difference being I have to call the ffmpeg executable directly (I could also symlink into /usr/bin I guess).

  2. #282
    Join Date
    Feb 2005
    Location
    London
    Beans
    121
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Quote Originally Posted by FakeOutdoorsman View Post

    Using ffmpeg and x264
    The easiest method for high quality video encoding is by using the ffmpeg presets that are included with the source code. First copy the presets to your home folder. This will create a folder that may be hidden in your file manager because it is preceded with a period. Use "ls -al" in the terminal or "ctrl + h" in Nautilus to view the folder if it is hidden.
    Code:
    mkdir ~/.ffmpeg
    Now copy the presets to the folder you just created:
    Code:
    cp ~/ffmpeg/ffpresets/* ~/.ffmpeg
    Now you can use the presets. This example uses the fastfirstpass and hq presets for a two-pass encode:
    Code:
    ffmpeg -y -i input.avi -pass 1 -vcodec libx264 -vpre fastfirstpass -s 640x480 -b 512k -bt 512k -threads 0 -bf 16 -f mp4 -an /dev/null && ffmpeg -i input.avi -pass 2 -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre hq -s 640x480 -b 512k -bt 512k -threads 0 -f mp4 output.mp4
    You will have to add -bf 16 to your first-pass command or bf=16 to ~/.ffmpeg/libx264-fastfirstpass.ffpreset when used with the normal, max, and hq presets.
    I also had to add -bf 16 to my second pass command when using the presets, or FFMpeg exists with an error that the second pass is using a different number of B Frames - 4 vs 16 in the the first pass.

  3. #283
    Join Date
    Sep 2006
    Beans
    3,713

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Quote Originally Posted by philc View Post
    I also had to add -bf 16 to my second pass command when using the presets, or FFMpeg exists with an error that the second pass is using a different number of B Frames - 4 vs 16 in the the first pass.
    Thanks for the update. The presets were modified three days ago to:
    Be consistent and use b-frames throughout the presets to avoid confusion about whether they have to be specified in the first pass as well.
    All of the non-lossless presets, including fastfirstpass, now use -bf 4. I have updated the guide. In addition, new lossless presets have been added, but I haven't used these yet. Has anyone tried lossless x264 encoding yet?

  4. #284
    Join Date
    Apr 2008
    Location
    Dublin
    Beans
    2
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Thumbs down Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Quote Originally Posted by ymark View Post
    "ffmpeg: symbol lookup error: /usr/local/lib/libavcodec.so.52: undefined symbol: av_lfg_init"
    I'm also getting this error.

    The output of

    Code:
    dpkg --get-selections | grep libav
    is

    Code:
    libavahi-client3                install
    libavahi-common-data                install
    libavahi-common3                install
    libavahi-compat-libdnssd1            install
    libavahi-core5                    install
    libavahi-glib1                    install
    libavahi-gobject0                install
    libavahi-ui0                    install
    libavc1394-0                    install
    libavcodec-unstripped-51            install
    libavcodec51                    deinstall
    libavdevice-unstripped-52            install
    libavformat-unstripped-52            install
    libavformat52                    deinstall
    libavutil-unstripped-49                install
    libavutil49                    deinstall
    Any help would be appreciated. Thanks.

  5. #285
    Join Date
    Sep 2007
    Location
    Cambs, UK
    Beans
    51
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Following this guide on 8.10, I don't seem to get a .so file for libx264. I have /usr/lib/libx264.a but that's all.

  6. #286
    Join Date
    Sep 2006
    Beans
    3,713

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Quote Originally Posted by Kinetic^ View Post
    I'm also getting this error.

    ...

    Any help would be appreciated. Thanks.
    You have one or several packages that are conflicting with the compiled ffmpeg. Try removing them:
    Code:
    sudo apt-get purge libavcodec-unstripped-51 libavdevice-unstripped-52 libavformat-unstripped-52 libavutil-unstripped-49
    Quote Originally Posted by tsh View Post
    Following this guide on 8.10, I don't seem to get a .so file for libx264. I have /usr/lib/libx264.a but that's all.
    Did you use ./configure --enable-shared for x264? It should install as:
    Code:
    /usr/local/lib/libx264.so.65

  7. #287
    Join Date
    Sep 2006
    Beans
    3,713

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Install FFmpeg and x264 on Ubuntu Dapper Drake 6.06 LTS.

    Dapper is unsupported and this guide will not be updated.

    1. Make sure the Ubuntu universe and multiverse repositories are enabled. For help doing this, refer to Adding the Universe and Multiverse Repositories on the Ubuntu Wiki.

    2. Uninstall x264-bin, libx264-dev, and ffmpeg if they are already installed. Open a terminal and run the following:
    Code:
    sudo apt-get remove ffmpeg x264-bin libx264-dev
    3. Next, get all of the packages you will need to install ffmpeg and x264:
    Code:
    sudo apt-get update
    sudo apt-get install build-essential subversion git-core checkinstall texi2html libfaac-dev libsdl1.2-dev libx11-dev libxfixes-dev libxvidcore4-dev zlib1g-dev
    4. Install yasm:
    Code:
    cd
    wget http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz
    tar xzvf yasm-1.1.0.tar.gz
    cd yasm-1.1.0
    ./configure
    make
    sudo checkinstall --pkgname=yasm --pkgversion "1.1.0" --backup=no --default
    5. Install x264:
    Code:
    cd
    git clone git://git.videolan.org/x264.git
    cd ~/x264
    ./configure
    make
    sudo checkinstall --pkgversion "1:0.cvs`date +%Y%m%d`-0.0ubuntu1" --default
    6. Install libopencore-amr. This will allow you to decode and encode AMR audio:
    Code:
    cd
    wget http://transact.dl.sourceforge.net/project/opencore-amr/opencore-amr/0.1.2/opencore-amr-0.1.2.tar.gz
    tar xvf opencore-amr-0.1.2.tar.gz
    cd opencore-amr-0.1.2
    ./configure -disable-shared
    make
    sudo checkinstall --pkgname="libopencore-amr" --pkgversion="0.1.2" --backup=no --default
    7. Install libtheora to encode to Theora, the video type usually found in OGG files. The repository libtheora is too old, so it must be compiled. Alternatively, you could skip this step and omit --enable-libtheora in step 8 if you don't plan on encoding to Theora video:
    Code:
    sudo apt-get install libogg-dev
    cd
    wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
    tar xzvf libtheora-1.1.1.tar.gz
    cd libtheora-1.1.1
    ./configure --disable-shared
    make
    sudo checkinstall --pkgname=libtheora --pkgversion "1.1.1" --backup=no --default
    8. Install ffmpeg:
    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-libx264 --enable-libxvid --enable-x11grab
    make
    sudo checkinstall --pkgversion "3:0.cvs`date +%Y%m%d`-5ubuntu1.2" --default
    hash x264 ffmpeg
    That's it! Now head back to the FFmpeg guide for usage instructions and more.

    To Revert Changes Made by This Guide
    Code:
    sudo apt-get remove build-essential subversion git-core checkinstall texi2html libfaac-dev libopencore-amr libsdl1.2-dev libtheora libx11-dev libxfixes-dev libxvidcore4-dev zlib1g-dev x264 ffmpeg
    Last edited by FakeOutdoorsman; October 18th, 2011 at 08:58 PM.

  8. #288
    Join Date
    Sep 2006
    Location
    Pretoria, South-Africa
    Beans
    471
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    I followed your guide to get ffmpeg. Everything is working as it should, except that I dont have PNG codec anymore. I used to use ffmpeg to create a thumbnail of a movie, and save it as mpeg, but now I get a error.

    Code:
    ffmpeg -y -i /home/andre/Projects/ask/ask/ask.media/videos/IT_Pro.wmv -vframes 1 -ss 00:00:02 -an -vcodec png -f rawvideo -s 320x240 /home/andre/Projects/ask/ask/ask.media/videos/flv/test.png
    Ffmpeg resulting output:
    Code:
    FFmpeg version SVN-r16661, Copyright (c) 2000-2009 Fabrice Bellard, et al.
      configuration: --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid
      libavutil     49.13. 0 / 49.13. 0
      libavcodec    52.11. 0 / 52.11. 0
      libavformat   52.24. 1 / 52.24. 1
      libavdevice   52. 1. 0 / 52. 1. 0
      libpostproc   51. 2. 0 / 51. 2. 0
      built on Jan 17 2009 23:46:11, gcc: 4.3.2
    [wmv3 @ 0xa476130]Extra data: 8 bits left, value: 0
    
    Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 15.00 (15/1)
    Input #0, asf, from '/home/andre/Projects/ask/ask/ask.media/videos/IT_Pro.wmv':
      Duration: 00:02:35.84, start: 5.000000, bitrate: 154 kb/s
        Stream #0.0: Audio: wmav2, 16000 Hz, mono, s16, 16 kb/s
        Stream #0.1: Video: wmv3, yuv420p, 320x240, 134 kb/s, 15.00 tb(r)
    Unknown encoder 'png'
    I tried to see if maybe the name chaned with the new version and did:
    Code:
    $ ffmpeg -formats | grep png
    FFmpeg version SVN-r16661, Copyright (c) 2000-2009 Fabrice Bellard, et al.
      configuration: --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid
      libavutil     49.13. 0 / 49.13. 0
      libavcodec    52.11. 0 / 52.11. 0
      libavformat   52.24. 1 / 52.24. 1
      libavdevice   52. 1. 0 / 52. 1. 0
      libpostproc   51. 2. 0 / 51. 2. 0
      built on Jan 17 2009 23:46:11, gcc: 4.3.2
    .... as you can see with no result

    Manually digging through the -formats output, and I didn't find anything related to png.

    Do you perhaps know what the issue is here?

    EDIT: sorry forgot to say, I'm running 8.10 32-bit on Macbook 4,1

    Thanks,
    WW
    Last edited by WinterWeaver; January 19th, 2009 at 03:21 PM.

  9. #289
    Join Date
    Sep 2006
    Beans
    3,713

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Quote Originally Posted by WinterWeaver View Post
    Do you perhaps know what the issue is here?
    You need to install the zlib1g-dev package then reinstall ffmpeg:
    Code:
    sudo apt-get purge ffmpeg
    cd ~/ffmpeg
    make distclean
    svn up
    ./configure --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid
    make
    sudo checkinstall --fstrans=no --install=yes --pkgname=ffmpeg --pkgversion "3:0.svn`date +%Y%m%d`-12ubuntu3"
    This will enable the following encoders/decoders: camtasia, dxa, flashsv, png, zlib, zmbv. I will add this to the guide.

  10. #290
    Join Date
    Sep 2006
    Location
    Pretoria, South-Africa
    Beans
    471
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    GREAT! That works

    Thank a million!

    Too bad the thanks feature is not working on the forum atm

Page 29 of 241 FirstFirst ... 1927282930313979129 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •