Page 230 of 236 FirstFirst ... 130180220228229230231232 ... LastLast
Results 2,291 to 2,300 of 2358

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

  1. #2291
    Join Date
    Jun 2007
    Beans
    13,891

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

    Just to mention (& possibly not all that useful..
    In preparing a new x264 package I noticed Ubuntu now builds x264 for both 8 & 10 bit, the 10 bit .so goes into for example -
    /usr/lib/x86_64-linux-gnu/x264-10bit/libx264.so.142
    The question here was how to use it when desired (with a static ffmpeg built off of

    Using an exported LIBRARY_PATH=blah,blah or starting ffmpeg with an env is ineffectual, ffmpeg uses the default 8 bit .so, but this does seem to work ok
    export LD_PRELOAD='/usr/lib/x86_64-linux-gnu/x264-10bit/libx264.so.142'
    ffmpeg -i ect., ect.

  2. #2292
    Join Date
    Nov 2013
    Beans
    1

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

    I was getting an ld error that 'dlopen' is not found. I had to add -ldl to ld flags to fix that:

    Code:
    ./configure --prefix=$HOME/ffmpeg_build --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-ldl -L$HOME/ffmpeg_build/lib" --bindir=$HOME/bin --enable-gpl --enable-libass --enable-libfaac --enable-libfdk-aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264  --enable-nonfree
    After that I was able to configure and compile ffmpeg and use it for x264 codecs. My OS is Debian/Sid.

  3. #2293
    Join Date
    Dec 2006
    Beans
    7,164

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

    Had another look at FFmpeg and x265 and I have to say that things ae looking very nice at the moment. Most striking thing since last time I had a decent look is that there has been a huge encoding speed increase, the following took 47m32.668s:

    Code:
    ffmpeg -y -ss 00:48:58 -t 00:04:42 -i matrix_working_version.mkv \
           -map_metadata -1 \
           -metadata title="Matrix: Sparring Scene" \
           -metadata comment="FFmpeg with libx265 1.1+170-c2ebebb66bf4" \
           -metadata date="June 21, 2014" \
           -metadata encoded_by="andrew.46" \
           -c:v libx265 -preset veryslow -x265-params crf=28 -threads 0 \
           -vf "yadif=0:-1:0,crop=1920:784:0:148,scale=1024:trunc(ow/a/2)*2" \
           -c:a libfdk_aac -b:a 128k -ac 2 \
           -af aresample=resampler=soxr -ar 44100 \
           -af "volume=1.25" \
           sparring_1.1+170-c2ebebb66bf4.mkv
    Feel free to pick holes in the syntax I have used, still looking at making the audio filters syntax a little cleaner . I have left the output file here for any who are interested:

    http://www.datafilehost.com/d/80ef585f

    Looks pretty reasonable on my system...
    You think that's air you're breathing now?

  4. #2294
    Join Date
    Sep 2006
    Beans
    3,570

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

    Hi Andrew,

    Quote Originally Posted by andrew.46 View Post
    ...still looking at making the audio filters syntax a little cleaner
    Since I know little of libx265 I'll try to help with the filters with an untested example:

    Code:
    ffmpeg -y -ss 00:48:58 -t 00:04:42 -i matrix_working_version.mkv \
           -map_metadata -1 \
           -metadata title="Matrix: Sparring Scene" \
           -metadata comment="FFmpeg with libx265 1.1+170-c2ebebb66bf4" \
           -metadata date="June 21, 2014" \
           -metadata encoded_by="andrew.46" \
           -filter_complex "[0:v]yadif=0:-1:0,crop=1920:784:0:148,scale=1024:-2[vid]; [0:a]aresample=44100:resampler=soxr,volume=1.25[aud]" \
           -map "[vid]" -map "[aud]"
           -c:v libx265 -preset veryslow -x265-params crf=28 -threads 0 \
           -c:a libfdk_aac -vbr 5 -ac 2 \
           sparring_1.1+170-c2ebebb66bf4.mkv
    • I tend to use one instance of -filter_complex instead of -vf and -af. In fact, I've never even tried using both -vf and -af or with multiple instances of each, so I don't know how ffmpeg behaves with multiples.
    • The "-2" option for scale is handy: "If one of the values is -n with n > 1, the scale filter will also use a value that maintains the aspect ratio of the input image, calculated from the other specified dimension. After that it will, however, make sure that the calculated dimension is divisible by n and adjust the value if necessary." For those who don't know, libx264 requires that width and height be divisible by 2 for YUV 4:2:0 chroma subsampled outputs.
    • Maybe you can declare the audio rate in aresample without the need for -ar and tell it to use soxr, but I didn't get to try and could be wrong.
    • I prefer to explicitly map my filtergraph inputs and outputs so the defaults don't do something unexpected, but most of the time the defaults work fine for most users.
    • I changed -b:v 128k to -vbr 5 just for an example to show another method.

  5. #2295
    Join Date
    Dec 2006
    Beans
    7,164

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

    FakeOutDoorsman you are the man!!

    1. I have not used filter_complex before but I can see that I will from here on in. I presume the [vid] and [aud] labels are simply arbitrary labels that you then map into the output container?
    2. Should I have abandoned the complex maths and been using -2 for the scaling some time ago?
    3. You are perfectly correct with the aresample syntax and it is encoding as we speak.
    4. VBR fdk_aac had a few warnings:

      Code:
      [libfdk_aac @ 0xe07260] Note, the VBR setting is unsupported and only works with some parameter combinations
      but I could find no information regarding these parameter combinations, only a few mutterings which pretty much echoed the FFmpeg warning.


    Thanks for the tips, I am head down and tail up in the filtering documentation at the moment....
    Last edited by andrew.46; June 21st, 2014 at 12:23 PM.
    You think that's air you're breathing now?

  6. #2296
    Join Date
    Mar 2014
    Beans
    10

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

    Hello, and thank you for keep supporting latest ffmpeg compilation.

    I followed the guide in: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

    I obtained yasm 1.3.0 and compiled it without problems.
    I don't know if it was needed, but I copied it under /user/bin, renaming previous version.

    I then compiled libx264 (latest x264-r2453 from Videolan) with no problems.

    I also compiled libxml2-2.9.1.

    I then downloaded libbluray-0.6.0 and compiled it with
    Code:
    PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig"
    export PKG_CONFIG_PATH
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/ffmpeg_build/bin" --disable-shared
    make
    make install
    make distclean
    And it did also compile without a problem.

    But when I then try to compile ffmpeg with libbluray support, it fails.
    If I try:
    Code:
    PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig"
    export PKG_CONFIG_PATH
    ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" \
       --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/ffmpeg_build/bin" --extra-libs=-ldl --enable-gpl \
       --enable-libass --enable-libmp3lame --enable-libtheora --enable-libbluray \
       --enable-libvorbis --enable-libx264 --enable-nonfree --enable-x11grab
    It complains that cannot find libbluray.
    And if I use:
    Code:
    --extra-libs='-ldl -lxml2'
    instead of just -ldl, as advised in Zeranoe forum some time ago, and adjust libbluray.pc, it then complains taht GCC cannot create an executable...

    I also tried with previous libbluray-0.5.0 version with the same result.
    I managed some time ago, with libbluray-0.4.0 and Zeranoe's forum recomendation, but it is not working with current versions.

    How can I compile latest ffmpeg with --enable-libbluray?.
    My ubuntu version is Precise.

  7. #2297
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    9,508
    Distro
    Kubuntu 14.04 Trusty Tahr

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

    Where did it put libbluray? If it's not in a standard location, you may need to add an entry in /etc/ld.so.conf.d/. You might also try running "sudo ldconfig" before compiling ffmpeg.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  8. #2298
    Join Date
    Mar 2014
    Beans
    10

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

    --deleted, wrong post format--

  9. #2299
    Join Date
    Mar 2014
    Beans
    10

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

    Thank you SeijiSensei for your answer.

    I have libbluray.a and libbluray.la in HOME/ffmpeg_build/lib folder, and a libbluray folder (with bluray.h and so) in HOME/ffmpeg_build/include folder.
    That's where --extra-cflags and --extra-ldflags are pointing in ./configure

    And it worked with previous libbluray and ffmpeg versions, locally, without further messing my system.

    Did you manage to compile ffmpeg with libbluray?

  10. #2300
    Join Date
    Sep 2006
    Beans
    3,570

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

    Seems to work for me (up to make install at least).

    libbluray:
    Code:
    sudo apt-get install libxml2-dev
    cd ~/ffmpeg_sources
    wget ftp://ftp.videolan.org/pub/videolan/libbluray/0.6.0/libbluray-0.6.0.tar.bz2
    tar xjvf libbluray-0.6.0.tar.bz2
    cd libbluray-0.6.0
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/ffmpeg_build/bin" --disable-shared
    make
    make install
    ffmpeg:
    Code:
    $ cd ffmpeg
    PATH="$PATH:$HOME/bin" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
      --prefix="$HOME/ffmpeg_build" \
      --extra-cflags="-I$HOME/ffmpeg_build/include" \
      --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
      --bindir="$HOME/bin" \
      --enable-libbluray
    make
    make install
    I do not own a blu-ray player so I could not test.

    Update: Nevermind. I was building in and pointing to unclean and incorrect directories causing it to link to the wrong (shared) libbluray libraries. It's been a long time since I've used Ubuntu and forgot how much of a slob I was in my VM. I ran out of time now, so I'll have to take a look later.
    Last edited by FakeOutdoorsman; August 25th, 2014 at 08:17 PM.

Page 230 of 236 FirstFirst ... 130180220228229230231232 ... 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
  •