PDA

View Full Version : HOWTO: Install and use the latest FFmpeg and x264



Pages : 1 2 3 4 5 6 7 8 9 [10]

qyot27
July 31st, 2013, 10:04 PM
On July 23rd, x265 (http://forum.doom9.org/showthread.php?p=1637971#post1637971) was announced (also here (http://forum.doom9.org/showthread.php?p=1637970#post1637970) for more discussion). This has the tentative blessing of the x264 devs, and the hope is to eventually integrate it with the other projects on Videolan. It's still in an early stage (and pretty slow at the moment), and actively in the process of taking the HM reference code and rewriting/optimizing it to properly be GPL rather than the 3-clause BSD, but it is possible to generate samples with it that Mediainfo recognizes as HEVC/H.265.

[snipped out]

The remaining pieces that need to fall into place for proper support of the format are the decoder currently in OpenHEVC's libav branch (https://github.com/OpenHEVC/libav) to get committed (and then make its way into FFmpeg, most likely through qatar), and for the draft that MPEG put out for putting HEVC into MP4 to be officially approved, which will allow L-SMASH to implement it (GPAC already has somewhat, but they aren't known for being absolutely spec-compliant; plus, GPAC is ridiculously bloated and finicky to cross-compile). The method for storing it in MP4 will also be necessary for it being officially added to Matroska.

2013-08-04: Removed the -DNO_EARLY_RDO_EXIT option; it's been removed from x265's build system too.
2013-10-15: Updated instructions here (http://ubuntuforums.org/showthread.php?t=786095&p=12817042#post12817042). There's proper install rules now.

FakeOutdoorsman
July 31st, 2013, 10:12 PM
Interesting post, and thanks for the info. Admittedly I haven't been following this very closely...yet.

jgcsd
September 9th, 2013, 09:21 AM
I tried the compilation guide on the ffmpeg website, but it fails on the fdk-aac step.


Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf line 195.
Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf line 195.
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
Makefile.am:31: Libtool library used but `LIBTOOL' is undefined
Makefile.am:31: The usual way to define `LIBTOOL' is to add `LT_INIT'
Makefile.am:31: to `configure.ac' and run `aclocal' and `autoconf' again.
Makefile.am:31: If `LT_INIT' is in `configure.ac', make sure
Makefile.am:31: its definition is in aclocal's search path.
autoreconf: automake failed with exit status: 1

Anybody know what's up, or how I can fix it?

FakeOutdoorsman
September 10th, 2013, 06:55 PM
What's your Ubuntu version? The "Get the Dependencies" step installs libtool. Did this not get installed? Try this:

sudo apt-get update
sudo apt-get install libtool
cd ~/ffmpeg_sources/fdk-aac
make distclean
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean

qyot27
October 15th, 2013, 03:53 PM
x265 recently got proper install rules (finally) and some of the asm-related commits seemed to speed things up pretty well on my ancient PIII-era Celeron (I was pulling about 0.20 fps with the default settings, up from something like 0.04 fps some time ago), so here's a new set of instructions:

EDIT 2014-02-13: Updated instructions here. (http://ubuntuforums.org/showthread.php?t=786095&p=12928004#post12928004)

The decoder is getting closer and closer to being committed, as frustrating as it is having to wait for it. Testing with the development branches, though, x265's output can be decoded just fine. L-SMASH and GPAC both support muxing HEVC into MP4 now, and the Matroska devs are fleshing it out also (although the mailing list is still silent since the last posts on this topic back in September; the DivX team's branch of mkvmerge has a draft of it). Part of the dev branches for getting the decoder in libav include patches for playing it from MP4 and MKV. The MP4-related ones weren't working when I tested, but MKV did (as did playing back the .265 files straight out of the encoder). There is also a patch that adds libx265 to libavcodec's external libs, but I have a feeling that it'll be held back even further than the decoder is and won't get committed at the same time.

qyot27
October 16th, 2013, 01:32 AM
Speak of the devil...

So, the HEVC decoder got committed on FFmpeg's side first, just about an hour or so ago. It's there in git right now.

mc4man
January 3rd, 2014, 01:05 AM
For a small personal project that will likely stay that way, (personal ppa), am curious about some other deps that i've see in various places.
The one I can't figure is there any real use to libbz2 in ffmpeg? (libbz2-dev

The other thing that does come up is texi2html is being obsoleted in favor of textinfo. It appears that to use textinfo some change would be needed in ffmpeg source ??, though atm it doesn't really matter as texi2html is still available.

FakeOutdoorsman
January 3rd, 2014, 01:28 AM
...is there any real use to libbz2 in ffmpeg? (libbz2-dev
As far as I know it is suggested, but not required, by the Matroska demuxer. I'm guessing it's for compressed (data) streams but I'm not totally sure. I don't have any samples with these characteristics but I'm not really into "the scene".


The other thing that does come up is texi2html is being obsoleted in favor of textinfo. It appears that to use textinfo some change would be needed in ffmpeg source ??, though atm it doesn't really matter as texi2html is still available.

See ticket #3232: Use texi2any instead of texi2html for documentation generation (https://trac.ffmpeg.org/ticket/3232).

mc4man
January 3rd, 2014, 03:00 AM
As far as I know it is suggested, but not required, by the Matroska demuxer. I'm guessing it's for compressed (data) streams but I'm not totally sure. I don't have any samples with these characteristics but I'm not really into "the scene".



See ticket #3232: Use texi2any instead of texi2html for documentation generation (https://trac.ffmpeg.org/ticket/3232).
Thanks, may or may not include it (bz2
(- for various reasons have decided to let LP build/store/organize most changes or add. things I want rather to do so locally. FFmpeg (binary) was the exception so am exploring what a static FFmpeg debian ppa package (https://launchpad.net/~mc3man/+archive/trusty-prop) entails. Actually works out ok, the libs/includes are somewhat worthless as is & while I've no intention of using them because ppa's are public may go ahead & make them usable by adding a static x264 package
Better current option for no build users are the FFmpeg standalone binaires or there are a couple of ffmpeg shared ppa's

Side note -
not sure if anyone actually reads manpages anymore, I do but not thru a terminal (too many lines, ect.) & I assume there is an online version somewhere or users can open the .html files in a browser instead.
Another option for those following the current wiki who want access, - I've found non standard man locations can be easily added to /etc/manpath.config in various ways

FakeOutdoorsman
January 3rd, 2014, 03:37 AM
I assume there is an online version somewhere or users can open the .html files in a browser instead.
HTML formatted documentation should be available in ~/ffmpeg_build/share/doc/ffmpeg for those who compile. Or you can get the FFmpeg source code and run "make doc" after configuring (assuming you have texi2html). Or simply refer to the online docs if you're using a very recent build (these docs are re-generated and synced to code nightly).


Another option for those following the current wiki who want access, - I've found non standard man locations can be easily added to /etc/manpath.config in various ways

This is something I meant to deal with but never did altough it isn't really a complicated task...I just keep forgetting or putting it off. I wanted "man ffmpeg" and such to work without too much trouble. I was messing around with adding MANPATH to .pam_environment instead of .profile, but AFAICT it required a re-login as opposed to using .profile and just sourcing it. pam was also annoying because it was no longer accepting $PATH (http://askubuntu.com/questions/304976/path-is-not-affected-by-pam-environment) as expected resulting in different behavior between Ubuntu releases. Admittedly, I don't remember why I was trying .pam_environment.

I didn't use /etc/manpath because I wanted to limit the need for superuser and I didn't want to mess with system stuff.

mc4man
January 3rd, 2014, 01:45 PM
For local builds make install or checkinstall don't mind split up prefixes so I've used this to put the mans in an accessible place (the .html go to ffmpeg's install dir.
--mandir=/usr/local/share/man
--datadir=/usr/local/share/ffmpeg

qyot27
January 5th, 2014, 10:37 PM
Only thing I'd suggest is to use --enable-avisynth. There's really not much of a reason not to include it, IMO.



In other news, x264 mainlined support for L-SMASH (http://git.videolan.org/?p=x264.git;a=commitdiff;h=7664b45570e4262c4d22bb8 9f4d395edcb4a639e) with the big commit push back in October, so MP4 muxing doesn't have to rely on GPAC anymore. It prefers L-SMASH if it finds it, and only links to GPAC if L-SMASH isn't present or the user disables it with the --disable-lsmash option.

spvkgn
January 6th, 2014, 05:56 PM
Hello! I'm a newbie and looking for some help. I've compiled latest ffmpeg, x264, ffms2 and avxsynth from git. Is there a way to input .avs with ffmpeg and x264 ? I've tried as follows but have no success.


$ x264 --preset ultrafast --crf 18 -v -o out.mkv ./test.avs
avs [error]: failed to load avisynth
x264 [error]: could not open input file `./test.avs'

$ x264 --version
x264 0.140.2 1ca7bb9
(libswscale 2.5.101)
(libavformat 55.22.102)
(ffmpegsource 2.18.0.0)
built on Jan 6 2014, gcc: 4.6.3
configuration: --bit-depth=8 --chroma-format=all
x264 license: GPL version 2 or later
libswscale/libavformat/ffmpegsource license: GPL version 3 or later


$ ffmpeg -i ./test.avs -v debug
ffmpeg version N-40499-g4ced5d7 Copyright (c) 2000-2014 the FFmpeg developers
built on Jan 6 2014 13:16:27 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --prefix=/home/pavel/apps/ffmpeg_build --extra-cflags=-I/home/pavel/apps/ffmpeg_build/include --extra-ldflags=-L/home/pavel/apps/ffmpeg_build/lib --bindir=/home/pavel/apps/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab --enable-avisynth --enable-libbluray --enable-libquvi
libavutil 52. 62.100 / 52. 62.100
libavcodec 55. 47.100 / 55. 47.100
libavformat 55. 22.102 / 55. 22.102
libavdevice 55. 5.102 / 55. 5.102
libavfilter 4. 0.103 / 4. 0.103
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument './test.avs'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file ./test.avs.
Successfully parsed a group of options.
Opening an input file: ./test.avs.
[avisynth @ 0x9d3dec0] Format avisynth probed with size=2048 and score=50
[AVIOContext @ 0x9d47fc0] Statistics: 180 bytes read, 0 seeks
./test.avs: Unknown error occurred



AVS script file contains:

FFVideoSource("/path/to/file.mkv")
And the script works fine when I launch it with avxsynth as "avxFrameServer ./test.avs"

Sorry, English is not my native language. Thanks.

qyot27
January 7th, 2014, 03:45 AM
Did you run 'sudo ldconfig' after installing AvxSynth? Did you build FFMS2 as static (it has to be built as shared)? And there's no reason to use ./ before the name of the script - AviSynth scripts aren't executed like shell scripts.

andrew.46
January 7th, 2014, 08:09 AM
In other news, x264 mainlined support for L-SMASH (http://git.videolan.org/?p=x264.git;a=commitdiff;h=7664b45570e4262c4d22bb8 9f4d395edcb4a639e) with the big commit push back in October, so MP4 muxing doesn't have to rely on GPAC anymore. It prefers L-SMASH if it finds it, and only links to GPAC if L-SMASH isn't present or the user disables it with the --disable-lsmash option.

Thanks for that tip, I have built l-smash and recompiled x264:



andrew@skamandros~$ x264 --help | head -n 12
x264 core:140 r2377 1ca7bb9
Syntax: x264 [options] -o outfile infile

Infile can be raw (in which case resolution is required),
or YUV4MPEG (*.y4m),
or Avisynth if compiled with support (yes).
or libav* formats if compiled with lavf support (yes) or ffms support (no).
Outfile type is selected by filename:
.264 -> Raw bytestream
.mkv -> Matroska
.flv -> Flash Video
.mp4 -> MP4 if compiled with GPAC or L-SMASH support (lsmash)


and now I will have a closer look at it. The muxer for l-smash is simply called 'muxer' I note :)

andrew.46
January 12th, 2014, 11:06 AM
Perhaps this might be a starting point for anybody interested in exploring l-smash?



sudo apt-get -y install build-essential git-core checkinstall && \
mkdir -pv $HOME/l-smash_build && cd $HOME/l-smash_build && \
git clone https://code.google.com/p/l-smash/ && cd l-smash && \
./configure && make && \
mkdir -vp doc-pak && cp -v LICENSE doc-pak && \
sudo checkinstall --pakdir "$HOME/l-smash_build" --backup=no --deldoc=yes --pkgname lsmash \
--pkgversion "0:$(git rev-list --count HEAD)-g$(git rev-parse --short HEAD)" \
--fstrans=no --deldesc=yes --delspec=yes --default --strip=yes --stripso=yes \
--addso=yes && \
make distclean



Edit: Altered the checkinstall syntax as suggested by qyot27 && FO......

qyot27
January 12th, 2014, 03:47 PM
IMO, it's preferable to stop using the the wc -l method and just use git itself:

git rev-list --count HEAD
returns the revision number, and

git rev-parse --short HEAD
returns the 7-character abbreviated git hash.

For example (slightly adapted from my cross-compiling instructions for it),

sudo checkinstall --pkgname=lsmash --pkgversion="0:$(git rev-list --count HEAD)-g$(git rev-parse --short HEAD)" --backup=no --deldoc=yes --delspec=yes --deldesc=yes --strip=yes --stripso=yes --addso=yes --fstrans=no --default
(if I'm not mistaken, --addso will automatically run sudo ldconfig)

FakeOutdoorsman
January 12th, 2014, 07:26 PM
git rev-list --count HEAD
returns the revision number, and

git rev-parse --short HEAD
returns the 7-character abbreviated git hash.


I use the same commands in PKGBUILD files for Arch Linux.

andrew.46
January 12th, 2014, 11:33 PM
Sounds like a great improvement so I have not only altered the checkinstall syntax as suggested but I will use the git commands for my slackbuild script of l-smash:). I am typing this surreptitiously from work on a Windows computer so I will test when I get home just to be sure...

qyot27
January 13th, 2014, 12:09 AM
I use the same commands in PKGBUILD files for Arch Linux.
Truth be told, I initially found out about the --count parameter from seeing it used in either some of your PKGBUILD files or from divVerent's PKGBUILD for mpv-git. One of these days I'll have to actually do something with Arch...probably when I finally manage to get my hands on a Raspberry Pi.

andrew.46
January 13th, 2014, 01:25 AM
One of these days I'll have to actually do something with Arch...

Don't forget the real action is with Slackware :)

andrew.46
January 24th, 2014, 04:51 AM
L-SMASH and GPAC both support muxing HEVC into MP4 now, [...]

Hmmm... I have just tried to use l-smash with a raw hevc file into mp4:



andrew@ilium~/shared/youtube$ muxer -i hero.h265 -o test.mp4
MP4 muxing mode
[HEVC: Info]: IDR: 1, I: 168, P: 2444, B: 3782, Unknown: 0
Error: there is no media that can be stored in output movie.
Error: failed to open input files.


This is an hevc file I created myself, ffprobe identifies it as:



Input #0, hevc, from 'hero.h265':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: hevc (Main), yuv420p(tv), 320x240, 25 fps, 25 tbr, 1200k tbn, 25 tbc


Could be I have missed something here, so my apologies in advance...

qyot27
January 24th, 2014, 07:58 AM
Yeah, the HEVC support in L-SMASH got disabled a couple weeks after that post in October (http://repo.or.cz/w/L-SMASH.git/commit/153572b12eed094fbf68c6770c753810d49e5a3a), since the official specs for putting it in MP4 hadn't come out (I still don't know if they've been published). So it's sort of a case where work is being done on it, but the users are kept away from it for the time being.

Muxing it with mp4box is currently the only method I know of at the moment to put HEVC into MP4. So long as it's built from SVN, anyway.

andrew.46
January 24th, 2014, 08:40 AM
OIC! Thanks for guiding me to my first muxed h.265 file:



andrew@ilium~/shared/youtube$ muxer -i hero.h265 -o hero.mp4
MP4 muxing mode
[HEVC: Info]: IDR: 1, I: 103, P: 2281, B: 4010, Unknown: 0
Track 1: H.265 High Efficiency Video Coding (for testing purposes only)
Muxing completed!
andrew@ilium~/shared/youtube$


It is very exciting to see the whole hevc experience growing...

andrew.46
January 27th, 2014, 10:51 AM
Slow work on a big file, even with my newish build:



andrew@ilium~/media/lossless$ x265 --preset veryslow --crf 30 --threads 8 elephants_dream_480p24.y4m -o elephant.hevc
y4m [info]: 704x480 24Hz C420, frames 0 - 15690 of 15691
x265 [info]: using cpu capabilities: MMX2 SSE SSE2Fast SSSE3 SSE4.2 AVX XOP FMA4 FMA3 LZCNT BMI1
x265 [info]: HEVC encoder version 0.6+324-237bf6667405
x265 [info]: build info [Linux][GCC 4.8.2][64 bit] 8bpp
x265 [info]: Main profile, Level-3 (Main tier)
x265 [info]: WPP streams / pool / frames : 8 / 8 / 3
x265 [info]: CU size : 64
x265 [info]: Max RQT depth inter / intra : 3 / 3
x265 [info]: ME / range / subpel / merge : star / 60 / 4 / 4
x265 [info]: Keyframe min / max : 250 / 250
x265 [info]: Rate Control / AQ-Strength / CUTree : CRF-30.0 / 1.0 / 1
x265 [info]: Lookahead / bframes / badapt : 40 / 8 / 2
x265 [info]: b-pyramid / weightp / refs : 1 / 1 / 5
x265 [info]: tools: rect amp rd=6 lft sao-lcu sign-hide
x265 [info]: frame I: 144 kb/s: 1633.08
x265 [info]: frame P: 15532 kb/s: 174.87
x265 [info]: frame B: 15 kb/s: 35.85
x265 [info]: global : 15691 kb/s: 188.11
x265 [info]: 3329 of 15532 (21.43%) P frames weighted

encoded 15691 frames in 8045.54s (1.95 fps), 188.11 kb/s


A little over 2 hours for this effort.

@qyot27 I read your question on Doom 9 about the 16bit internal depth setting, have you experimented with this? I will recompile and compare over the next few days but my eye is not sharp for what will probably be fine detail :(

qyot27
January 27th, 2014, 01:11 PM
If memory serves, I never got an actual answer. But that was also before 10bit encoding was actually added to the HIGH_BIT_DEPTH build. Now that it has the ability to output in 10bit, the question of the internal processing is not really relevant.

Unless they've rejiggered the crf scale like x264 did so that the crf values are the same across bit depths, the difference in crf values between 8bit and 10bit is something like 12 points. So if you use --crf 30 for 8bit, you'd have to use --crf 18 for a comparable encode in 10bit (or in my case, since I'd normally use --crf 18 or --crf 14, it'd be --crf 6 or --crf 2 for 10bit). Yes, this means that 10bit would take negative crf values for some quality levels, and I'm sure the weirdness of that is what prompted x264 to adjust the crf scaling for 10bit so that you can use the same values you would for 8bit. I wonder if/when x265 will do the same.

Also, there are more caveats involved with high bit depth content. Notably, x265 still hasn't added support for FFmpeg's extended y4m format from what I can see from my RSS feeds, so the only way to input >8bit content is to pipe it in raw or use a raw .yuv stream, and then specify the resolution, bit depth, and framerate parameters manually.

I expect that, as with x264, inputting 8bit and outputting with 10bit will still provide a benefit in filesize reduction@same quality or quality increase@same bitrate. But no, I haven't done any real testing with x265's high bit depth stuff; it's probably still not comparable to x264's 10bit abilities right now because there are things like the psy optimizations and AQ that may not be totally up to speed yet. The encode time will also be slower than on 8bit due to less assembly optimizations for high bit depths.

The biggest benefit (aside from being able to save bits) is the effect on banding artifacts - the higher the bit depth, the less obvious/severe the banding will be, or can even possibly be avoided. The problem, though, is that the average user doesn't have access to real high bit depth content - Xiph's media archives (http://media.xiph.org/) for Sintel and Tears of Steel (or the SVT samples (http://media.xiph.org/svt/)) are notable exceptions as they provide 16bit TIFF or 16bit SGI files, but understandably, the filesizes are monstrous.

For normal consumer content that's only available in 8bit, you'd have to dither and upsample it first to try and eliminate any banding that might be present in the source, and then give the dithered upsampled file to x265 (or x264) for encoding in 10bit. This does have the benefit of not needing to download a huge amount of data since you can accomplish the dithering/upsampling with either AviSynth under Wine or VapourSynth (AvxSynth isn't an option here since the dithering filters were never ported for it). The AviSynth method actually requires the use of a patched x264 to take the result of the upsampled script and encode it to lossless H.264 @ 10bit first, and then you can give that file to ffmpeg to pipe to x265 as a high bit depth input. VapourSynth can just output right to the extended y4m format, so you'd still need to pipe over to ffmpeg and then pipe it raw to x265, but it can be done that way I guess.

The dithering/upsampling isn't actually necessary to output in 10bit. Giving it 8bit and telling it to output in 10bit is fine; giving it 10bit and telling it to output in 10bit is simply a nice flourish and can have some additional benefit because you did pre-processing to try and eliminate banding.

FakeOutdoorsman
January 27th, 2014, 07:57 PM
Unless they've rejiggered the crf scale like x264 did so that the crf values are the same across bit depths...

I must have missed this. When did x264 do this?

qyot27
January 28th, 2014, 08:57 AM
I'm guessing it was this commit (http://git.videolan.org/?p=x264.git;a=commit;h=d0406d4e3dc2b0953390857ac6e fa0b5a9d5ba8f). There's also multiple threads that bring up the subject on Doom9, like this one (http://forum.doom9.org/showthread.php?t=165072&highlight=crf+10bit).

Although, maybe I'm remembering the exact details (RE: negative crf) incorrectly for x264. But the quant scale is different between them (8bit is 0-51, 10bit is 0-63), and --crf 0 ceased to be equivalent to --qp 0. The more I try to think about it, the more confused I end up getting; all I know is that on some recent encodes that I did (back in July), crf14 in 10bit looked roughly equal or better than crf14 in 8bit while hitting just about the same filesize, so that's part of what I was considering.

qyot27
February 13th, 2014, 09:57 AM
...And now FFmpeg officially has the ability to use libx265. Use the --enable-libx265 option to tell FFmpeg to link it in.

hg clone https://bitbucket.org/multicoreware/x265
cd x265/source
cmake . -DENABLE_SHARED:bool=off
make
sudo checkinstall --pkgname=x265 --pkgversion="$(grep \
X265_VERSION common/CMakeFiles/common.dir/flags.make | \
cut -f3 -d =)" --backup=no --deldoc=yes --delspec=yes --deldesc=yes \
--strip=yes --stripso=yes --addso=yes --fstrans=no --default

# Use -DHIGH_BIT_DEPTH:bool=on to enable builds that can output 10-bit and (in the future) 12-bit.
The big caveat is that if you build the high bit depth version and link that in, you can't encode 8-bit content with it - it actually stops you and tells you so. This is something carried over from x265 itself, as you can't output 8-bit encodes with a 16bpp build (and because x265 doesn't do internal upsampling, it requires high bit depth input into such a build anyway). Of course, this all just means that if you need to input 8-bit and output 10-bit, use -pix_fmt to upsample it.

So the issue of not having AviSynth input or support for FFmpeg's extended Y4M format are partially resolved now - you just have to use FFmpeg with libx265 support enabled. It would still be nice to have it in the x265 CLI too, but at least this is something.

FakeOutdoorsman
February 13th, 2014, 07:56 PM
-crf hasn't been mapped (yet) as a private option for libx265, but it is still possible via -x265-params:

-x265-params crf=22

andrew.46
February 28th, 2014, 12:29 AM
I am searching for a reliable way to download a specific FFmpeg revision for the vlc guide (http://ubuntuforums.org/showthread.php?t=2141949)that I run. Currently running with the nightly snapshot but of course this will change every 24 hours and potentially lead to breakages when compiling with vlc. I have been looking at something like the following:



wget "http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=fbf9837;sf=tgz" -O \
ffmpeg.fbf9837.tgz


and of course this will be able to be checked directly from git-web with the following address:

http://git.videolan.org/?p=ffmpeg.git;a=commit;h=fbf9837

What I am a little unsure about is:


Is there a better way to do this?
Is it safe enough to use the short hash rather than the long?
More importantly will this gather the correct versions of libavcodec / libavformat / libavfilter / libavutil / libswscale / libswresample etc even when this particular revision is weeks old?



Thanks for any input...

qyot27
February 28th, 2014, 04:13 AM
FFmpeg 2.2 shouldn't be too far off, judging from the mailing list. If it needs to be newer than 2.1.3 (2.1.4 now) due to API changes, then 2.2 would be sufficient whenever it's released.

Otherwise, to be best of my knowledge, the short hash should be safe to use.

As to whether there's a better way, it is possible to use 'git checkout <hash>' to jump to a particular commit in the extant cloned git repo. I prefer to use the long hash when doing this, but the short hash has worked whenever I've been pressed for time. You can branch this to a specific name with 'git checkout -b <newbranchname> <hash>', which makes it more resilient for general managing. And yes, this will result in the versions of lib[avcodec|avformat|avfilter|avutil|avresample|swscal e|swresample] that were current at the time of the commit in question (whether the version numbers are high enough for a particular use is a question of whether they were at that time; it'll use the versions from that commit, not the current versions @ HEAD).

Of course, the question of if a full clone and then checking out a specific revision is preferable to grabbing a snapshot tarball from git-web is a separate issue.



As an aside, regarding x265's instructions, the YASM patch is no longer needed because YASM applied a fix to their git repo which increases it 8x more than the patch did (patch = 511, git = 4096). I've also taken to using Ninja (http://martine.github.io/ninja/manual.html), although I've yet to do any conclusive speed tests - that change seemed to make it fly in comparison to make -j4 on the OSX machine I have access to, though. Ninja is supposed to use multiple cores more efficiently than plain old Make does, as well as being better about inter-dependent source files (again, supposedly). I'd always wondered what it was whenever I saw it listed in CMake's Generator list, but it took a couple years before I actually looked into it more closely. Seems it was initially written for Chrom[e|ium] to use. An example of usage with x265:

sudo apt-get install ninja-build
cd x265/source
cmake -G "Ninja" <other options>
ninja
sudo ninja install
(as with other alternate install systems, you can use it with checkinstall by appending 'ninja install' to the end of the checkinstall command)

umithaz
February 28th, 2014, 03:56 PM
Thanks for the guide guys.

andrew.46
March 1st, 2014, 04:11 AM
FFmpeg 2.2 shouldn't be too far off, judging from the mailing list.

http://git.videolan.org/?p=ffmpeg.git;a=commit;h=e4a6310cce5c1663f68253c50 f364fc0c055f05a

:)

andrew103
March 17th, 2014, 03:34 PM
after trying with yasm , managed to fix the issue. great tip...thanks

andrew.46
March 21st, 2014, 02:50 AM
Latest x265 and FFmpeg seem at the very least usable, a sample here:

http://www.datafilehost.com/d/18528ddd

The encoder likes a fast cpu for sure :)

mc4man
March 21st, 2014, 11:24 PM
Latest x265 and FFmpeg seem at the very least usable, a sample here:

http://www.datafilehost.com/d/18528ddd

The encoder likes a fast cpu for sure :)
Actually looks pretty good for the bitrate, at least at default size.
Was getting some h tearing in players other than mplayer though have fixed that.
(was that from the dvd source?

andrew.46
March 22nd, 2014, 12:03 AM
(was that from the dvd source?

Bluray :)

FakeOutdoorsman
March 22nd, 2014, 07:12 PM
The FFmpeg releases (and occassional usage tip) are also announced on Twitter (https://twitter.com/FFmpeg) (but instead of using releases, general users are still recommended to use the most recent ffmpeg they can from git master via compiling (http://trac.ffmpeg.org/wiki/UbuntuCompilationGuide) or downloading a recent build (http://ffmpeg.org/download.html#LinuxBuilds)).

andrew.46
April 29th, 2014, 07:24 AM
I have compiled my copy of FFmpeg against libsoxr (https://trac.ffmpeg.org/wiki/FFmpeg%20and%20the%20SoX%20Resampler)and started using it for re-sampling. Is anybody else using this, any comments about its usage?

mc4man
May 18th, 2014, 06:05 AM
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.

oleg2
June 5th, 2014, 11:26 PM
I was getting an ld error that 'dlopen' is not found. I had to add -ldl to ld flags to fix that:


./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.

andrew.46
June 21st, 2014, 03:59 AM
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:



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...

FakeOutdoorsman
June 21st, 2014, 05:57 AM
Hi Andrew,


...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:



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 (https://ffmpeg.org/ffmpeg-filters.html#scale-1) 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.

andrew.46
June 21st, 2014, 11:02 AM
FakeOutDoorsman you are the man!!


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?
Should I have abandoned the complex maths and been using -2 for the scaling some time ago?
You are perfectly correct with the aresample syntax and it is encoding as we speak.
VBR fdk_aac had a few warnings:


[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 (https://trac.ffmpeg.org/wiki/Encode/AAC#fdk_vbr) 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....

digitall.h
August 25th, 2014, 12:09 AM
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

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:

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:

--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.
:)

SeijiSensei
August 25th, 2014, 04:37 PM
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 (http://linux.die.net/man/8/ldconfig)" before compiling ffmpeg.

digitall.h
August 25th, 2014, 06:21 PM
--deleted, wrong post format--

digitall.h
August 25th, 2014, 06:23 PM
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?

FakeOutdoorsman
August 25th, 2014, 07:59 PM
Seems to work for me (up to make install at least).

libbluray:

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:

$ 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.

digitall.h
August 25th, 2014, 10:53 PM
@FakeOutdoorsman (http://ubuntuforums.org/member.php?u=162846),
As I was reading your post I was more on the edge of the chair...

I'll wait for your time, thank you.

qyot27
August 26th, 2014, 02:57 AM
It's perfectly fine to disable libxml2 in libbluray and then you won't have to deal with it at all (libxml2 is used in 'metadata parsing', which I assume from other contexts in libbluray's ./configure that it's more relevant to the Java environment being able to display the BD-J menus - but I'm not aware of any libbluray-based media player that even displays menus for Blu-ray...unless VLC can do it, but to my knowledge neither FFplay nor mpv can). Thus obviating the need to use --extra-cflags/ldflags or --extra-libs:


Dependency: libbluray
=====================

cd ~/mpv-build-deps
git clone git://git.videolan.org/libbluray.git
cd libbluray
./bootstrap
CPPFLAGS="-mfpmath=sse -march=pentium3 -msse -mtune=pentium3" \
PKG_CONFIG_PATH=/usr/i686-w64-mingw32/lib/pkgconfig ./configure \
--prefix=/usr/i686-w64-mingw32 --disable-examples --without-libxml2 \
--enable-silent-rules --disable-shared --disable-doxygen-doc \
--disable-doxygen-dot --build=i686-w64-mingw32 --host=i686-w64-mingw32
make
sudo checkinstall --pkgname=libbluray-mingw --pkgversion="$(grep Version \
src/libbluray.pc | sed 's/Version: //g')-git" --backup=no --deldoc=yes \
--delspec=yes --deldesc=yes --strip=yes --fstrans=no --default
(these are, of course, cross-compilation instructions, hence the 'mingw' stuff)

Regarding yasm, the advisable method of installing it would be with checkinstall (assuming that you're using the tarball):

sudo checkinstall --pkgname=yasm --pkgversion="3:$(cat version)-git" --backup=no --deldoc=yes --delspec=yes \
--deldesc=yes --strip=yes --stripso=yes --addso=yes --fstrans=no --default

It installing to /usr/local by default isn't an issue.

And more generally speaking, --bindir isn't necessary to specify unless you're putting it somewhere other than in the --prefix. Setting --prefix to $HOME/ffmpeg_build and then --bindir to $HOME/ffmpeg_build/bin does nothing - the bins are already going to go there anyway. If you wanted the bins in $HOME/bin like FakeOutdoorsman's instructions have, while letting everything else go into their respective subdirs in $HOME/ffmpeg_build, that's when you use --bindir.

digitall.h
August 26th, 2014, 05:09 PM
Hi qyot27, very complete your answer.
Thank you for the advise related to compilation. I understood that it is not needed to specify a bindir when it is inside the prefix path.

I was not having any problem regarding yasm compilation, even I'm not sure if I'm really compiling with it. Just the hassle to rename yasm version in /usr/bin

I also had no problem compiling libbluray.
I compiled it like FakeOutdoorsman's instructions, but adding before ./configure the PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" instruction.
I did not understand the need of cross-compilation instructions, I'm going to use the binaries in the same computer I'm compiling.
Is it needed to then enable libbluray when compiling ffmpeg?.

I did not understand if after the code you posted you manage to compile ffmpeg with --enable-libbluray.

I will try to compile again libbluray without libxml2 (do I have to add to configure the --without-libxml2 thing?) and try to compile ffmpeg against this libbluray version.

mc4man
August 27th, 2014, 03:03 AM
I understood that it is not needed to specify a bindir when it is inside the prefix path.


I did not understand if after the code you posted you manage to compile ffmpeg with --enable-libbluray.

I will try to compile again libbluray without libxml2 (do I have to add to configure the --without-libxml2 thing?) and try to compile ffmpeg against this libbluray version.

No need for a bindir when compiling a library..
What version of Ubuntu are you using?, libbluray @ 0.6.0 is available for 14.04 & can't see any reason to statically link to ffmpeg (if there is any reason to enable it in ffmpeg in the first place..
Also note the latest libbluray is 0.6.1

(edit: I can assure you that ffmpeg will build with --enable-libbluray if libbluray is shared (libxml2 is not a factor) -

ffmpeg -protocols
ffmpeg version 2.3.3 Copyright (c) 2000-2014 the FFmpeg developers
built on Aug 27 2014 02:08:11 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-x11grab --enable-libpulse --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libbluray --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr
libavutil 52. 92.100 / 52. 92.100
libavcodec 55. 69.100 / 55. 69.100
libavformat 55. 48.100 / 55. 48.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.100 / 4. 11.100
libavresample 1. 3. 0 / 1. 3. 0
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Supported file protocols:
Input:
bluray
cache
..ect


ldd /usr/bin/ffmpeg |grep libbluray.so.1
libbluray.so.1 => /usr/lib/x86_64-linux-gnu/libbluray.so.1 (0x00007fa4a64d1000

digitall.h
August 27th, 2014, 08:03 PM
No need for a bindir when compiling a library..
What version of Ubuntu are you using?, libbluray @ 0.6.0 is available for 14.04 & can't see any reason to statically link to ffmpeg (if there is any reason to enable it in ffmpeg in the first place..
Also note the latest libbluray is 0.6.1 (edit: I can assure you that ffmpeg will build with --enable-libbluray if libbluray is shared (libxml2 is not a factor) -

Ubuntu 12.04 here :(
But the problem was not with libluray compilation, it compiled apparently well, with --bindir="$HOME/ffmpeg_build/bin" and --disable-shared.
And as result I find under $HOME/ffmpeg_build/bin the bd_info binary, and under $HOME/ffmpeg_build/lib the files libbluray.a and libbluray.la and pkgconfig folder with libbluray.pc, and finally under $HOME/ffmpeg_build/include a libbluray folder.

I prefer to keep everything locally because I'm afraid that a newer version of libbluray or yasm or ffmpeg can be incompatible with the rest of my system.
And in this link https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu it's explained the way to compile everything locally.
I just want to add latest libbluray support to the compiling process detailed in that link.

qyot27
August 28th, 2014, 05:50 AM
A) There's no reason to go around renaming the yasm binary. 'which yasm' will tell you which one is being used if there's more than one installed. The PATH environment variable prefers /usr/local over /usr, so compiling yasm yourself means that since it goes into /usr/local, it would pick up on that one first.
B) The point of posting those instructions was to illustrate the --without-libxml2 option. Not a recommendation to cross-compile things.
C) Building everything/multiple parts as static very often leads to needing to use the --pkg-config-flags="--static" option when configuring ffmpeg. A static libbluray may need this if it links to a shared libxml2, and the option might not be necessary for libbluray if it was built without libxml2. Or, like mc4man pointed out, building libbluray as shared causes no conflict with a shared libxml2.

mc4man
October 13th, 2014, 08:43 PM
In Debian sid ffmpeg has comeback as binaires & shared though to what actual advantage I really can't see.
As it stands nothing will use the shared libs other than the ffmpeg binaires, to do so they'd need to be rebuilt against FFmpeg. (libavcodec-ffmpeg-dev, ect.
Are they going to offer 'dual' packaging? (I doubt that), so users would need to build themselves or use some semi outside pre-built packages. (deb-multimedia or ppa's

As far as the binaires this is for example the config on ffmpeg (plus 2 added by me, --enable-nonfree, - libfdk-aac, feels like kitchen sink minus decent aac

$ ffmpeg
ffmpeg version 2.4.2-1 Copyright (c) 2000-2014 the FFmpeg developers
built on Oct 10 2014 15:27:21 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/usr --extra-version=1 --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags=
--libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu
--enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig
--enable-frei0r --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcaca --enable-libcdio
--enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug
--enable-libmp3lame --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp
--enable-libschroedinger --enable-libshine --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
--enable-openal --enable-opengl --enable-x11grab --enable-libxvid --enable-nonfree --enable-libfdk-aac
--enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-libbs2b

Are there any enables here that are to good advantage over what's typically used for static builds?
(am curious about the --enable-opengl one - what for?, (ffplay?

FakeOutdoorsman
October 13th, 2014, 09:23 PM
I'm not sure what the packaging plans are. I haven't been paying attention.

Looks like a lof of extra fluff in there. For example I doubt general users need WebPee support among several others, but I guess they want to be on the "safe side" since you never know what users really want. Personally I haven't used half of those options.

As for the opengl output device (http://ffmpeg.org/ffmpeg-devices.html#opengl) I'm not really familiar with that. Could be useful or interesting for a few application developers I guess. Not a very helpful answer...

mc4man
October 13th, 2014, 11:26 PM
I'm not sure what the packaging plans are. I haven't been paying attention.

Looks like a lof of extra fluff in there. For example I doubt general users need WebPee support among several others, but I guess they want to be on the "safe side" since you never know what users really want. Personally I haven't used half of those options.

As for the opengl output device (http://ffmpeg.org/ffmpeg-devices.html#opengl) I'm not really familiar with that. Could be useful or interesting for a few application developers I guess. Not a very helpful answer...
Yeah, seems like safe side, ect. though don't get their aac deal, only native encoder (maybe it's gotten better?
overall they state - (from rules file
# Enable as many features as possible, as long as the result is still GPLv2+ (and not only GPLv3+).

Also don't get the --enable-libopencv option, both as in value being enabled & because of deps
(- to enable then libopencv-highgui-dev will be installed which deps on libavcodec-dev, libavformat-dev, ect. so the ffmpeg shared libs will dep on libav shared libs

FakeOutdoorsman
October 14th, 2014, 01:33 AM
though don't get their aac deal, only native encoder (maybe it's gotten better?
It's better than libvo_aacenc at least. Improvements have been made in the "AAC mega thread" (https://trac.ffmpeg.org/ticket/2686), but I don't think they've been squashed and committed.


Also don't get the --enable-libopencv option, both as in value being enabled & because of deps
AFAIK this is for the dilate, erode, and smooth filters via the ocv filter (http://ffmpeg.org/ffmpeg-filters.html#ocv). I've never used it and I've never seen any users try it. Almost like the frei0r stuff but probably less useful. I'm guessing, due to your rules file observation, that it was possibly enabled without evaluating its actual usefulness.


(- to enable then libopencv-highgui-dev will be installed which deps on libavcodec-dev, libavformat-dev, ect. so the ffmpeg shared libs will dep on libav shared libs
Might be bug report worthy.

George Heine
October 22nd, 2014, 09:44 PM
First, thanks to Fake O. for maintaining this great tutorial - have used it several times now.

QUESTION: Assuming you've got three non-networked systems with the same version of the same OS (e.g., Ubuntu 14.04 LTS), and you've
compiled ffmpeg on one system, what do you need to copy, besides the file in ~/bin, to the other systems to give them a working ffmpeg?

dannyboy79
October 26th, 2014, 06:14 AM
If i follow this guide how do I make kdenlive (or any other software which relies on ffmpeg, obs-studio etc etc) use this version of ffmpeg which is installed in my home directory?

FakeOutdoorsman
October 26th, 2014, 08:56 PM
Assuming you've got three non-networked systems with the same version of the same OS (e.g., Ubuntu 14.04 LTS), and you've
compiled ffmpeg on one system, what do you need to copy, besides the file in ~/bin, to the other systems to give them a working ffmpeg?
Sorry for the delay; I was traveling. Give it a try, but I can't say for sure if it will work or not due to potential differences between each computer. You will only need ~/bin/ffmpeg unless you also want the man pages. If it doesn't work just post the error here and we can try to help.


If i follow this guide how do I make kdenlive (or any other software which relies on ffmpeg, obs-studio etc etc) use this version of ffmpeg which is installed in my home directory?
Do they use the FFmpeg libraries and/or the binary? I think Kdenlive uses the ffmpeg binary to export files. Does it use your PATH to find ffmpeg, or does it look in a specific directory? Has it been patched by the maintainers to specifically look for avconv instead? Maybe it has a setting to allow you to choose where the binary is? Sorry, I'm away from my usual computer and can't test.

If they require the libraries then it will be more challenging because:

there may be major API differences between the repository offerings and your new, compiled FFmpeg
the repo package may be old and may require an older API version
this guide does not install (shared) libraries to the system


You would probably have to compile each program, or maybe there is a PPA that offers a solution. I may be wrong, but I don't think there is one. This type of more cutting-edge/customized-compiled usage may be better suited with a different distro.

mc4man
October 26th, 2014, 09:53 PM
First, thanks to Fake O. for maintaining this great tutorial - have used it several times now.

QUESTION: Assuming you've got three non-networked systems with the same version of the same OS (e.g., Ubuntu 14.04 LTS), and you've
compiled ffmpeg on one system, what do you need to copy, besides the file in ~/bin, to the other systems to give them a working ffmpeg?

As a bit of an add-on to FO's reply -
On your other installs you'll need to have installed any packages that provide whatever shared libs your current FFmpeg source binaries are using. It's quite possible your transferred to installs will have most, if not all, already installed. Easily checked by - after copying over run
ldd /path/to/ffmpeg
(if copying over the other ffmpeg binaries ck. them also

Anything that shows => not found will have to be rectified by installing whatever package provides the missing .so

mc4man
October 26th, 2014, 10:04 PM
If i follow this guide how do I make kdenlive (or any other software which relies on ffmpeg, obs-studio etc etc) use this version of ffmpeg which is installed in my home directory?
Again as an add-on -
I don't use kdenlive but what you may need to look at is mlt (libmlt6 specifically), it is a dep of kdenlive that does depend on ffmpeg/libav shared libs. If it is a factor for your task(s) then mlt had to be rebuilt for the libav10/11 API , ect.
(and may only work with shared libs..

mc4man
November 2nd, 2014, 03:05 AM
With the addition of 3 options in configure -
--enable-libxcb enable X11 grabbing using XCB [auto]
--enable-libxcb-shm enable X11 grabbing shm communication [auto]
--enable-libxcb-xfixes enable X11 grabbing mouse rendering [auto]
wonder if anyone has tried & to what extent should be enabled (all 3 ?
library versions should all be supported in 14.04+

FakeOutdoorsman
November 2nd, 2014, 08:55 PM
I haven't tried it yet.

I suppose it's autodetected, so you may not need to add any of those options if the deps are available: libxcb1-dev, libxcb-shm0-dev, ibxcb-xfixes0-dev.

From Nicolas George in [FFmpeg-cvslog] xcbgrab: XCB-based screen capture (https://ffmpeg.org/pipermail/ffmpeg-cvslog/2014-October/082585.html):

Technically, XCB is slightly lower-level but more efficient than Xlib.

From an user's point of view, whether an application uses XCB or Xlib should
not matter. This is even truer nowadays, because most users have X.org's
implementation of Xlib, which is a wrapper around XCB.

mc4man
November 2nd, 2014, 09:40 PM
I haven't tried it yet.

I suppose it's autodetected, so you may not need to add any of those options if the deps are available: libxcb1-dev, libxcb-shm0-dev, ibxcb-xfixes0-dev.

From Nicolas George in [FFmpeg-cvslog] xcbgrab: XCB-based screen capture (https://ffmpeg.org/pipermail/ffmpeg-cvslog/2014-October/082585.html):
The autodetect works ok, min. I guess would be libxcb1-dev. So then the previous option, --enable-x11grab, would override the auto.. if included in configure
(seems to work ok here, same runtime command, same result.

mc4man
November 18th, 2014, 04:11 PM
So should be showing up in vivid (proposed) shortly, -
https://bugs.launchpad.net/ubuntu/+bug/1393522
I believe it will be semi-neutered as far as aac encoding as no 'extra' packages atm though extra only adds libvo-aacenc, faac & fdkaac are a no go in Debian
So in that regard and for having the latest self or acquired builds will still be 'soup du jour'.

Initially only benefits the FFmpeg binaries as sources would need to be specifically built off of, ex. of that in test ppa linked in report.

FakeOutdoorsman
November 18th, 2014, 09:36 PM
Interesting info, and thanks for the update and your work on this package.

George Heine
November 21st, 2014, 07:39 PM
As a bit of an add-on to FO's reply -
On your other installs you'll need to have installed any packages that provide whatever shared libs your current FFmpeg source binaries are using. It's quite possible your transferred to installs will have most, if not all, already installed. Easily checked by - after copying over run
ldd /path/to/ffmpeg
(if copying over the other ffmpeg binaries ck. them also

Anything that shows => not found will have to be rectified by installing whatever package provides the missing .so

Here is what I've found out so far. On System A, Compiled a working ffmpeg about 30 days ago:


ffmpeg version 2.4.git Copyright (c) 2000-2014 the FFmpeg developersR
built on Oct 23 2014 10:19:13 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)


Copied ~/bin/ffmpeg from System A to System B. (Both systems have Ubuntu 14.04 LTS, updated within the last two weeks). Using ldd on System B as suggested provides a "not found" for one library, libass.so.4. Back to System A, libass.so.4 is in /usr/lib/i386-linux-gnu, (and is actually a link to libass.so.4.1.0 in the same directory.) Running dpkg -S shows that this library is available as part of the repo package libass4:i386. Checking dates, it appears to have been installed at the same time as a previous compilation of ffmpeg, back in 2013. Presumably when I did a new compile in October, one of the "make" scripts found this library already installed, and skipped that process.

I'm guessing the next step would be to install the libass4 repo package on System B. Or is there a custom build of this library that would be
more appropriate?

Thanks for your assistance.

JoeGibken
November 21st, 2014, 09:16 PM
Hi! Thank you for the tutorial. I'm using Linux Mint 13 Xfce which is a variant of Ubuntu 12.04, so the tutorial should hypothetically also work. I have a few questions though:

1. I am not sure what directory should I ran ". ~/.profile" to make a Persistent Evaluation Variables as written here. (https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#Conclusion) Can you just run that command anywhere to make it a Persistent Evaluation Variable? Or is there a specific directory where the command ". ~/.profile" should be run? Also, does making it Persistent Evaluation Variable mean that you can now run the newly compiled ffmpeg anywhere and doesn't matter what directory you are currently working on?

2. Having read this documentation about (https://trac.ffmpeg.org/wiki/Encode/H.265) H.265 / libx265 (https://trac.ffmpeg.org/wiki/Encode/H.265) in (https://trac.ffmpeg.org/wiki/Encode/H.265) the FFmpeg site (https://trac.ffmpeg.org/wiki/Encode/H.265), and compiling x265 from source with these instructions (https://bitbucket.org/multicoreware/x265/wiki/Home), will compiling ffmpeg adding the flag "--enable-libx265" in the final step of the Compilation and Installation section of the tutorial, will now include libx265 and can also be used for encoding?

Thank you in advance.

mc4man
November 22nd, 2014, 03:58 PM
Hi! Thank you for the tutorial. I'm using Linux Mint 13 Xfce which is a variant of Ubuntu 12.04, so the tutorial should hypothetically also work. I have a few questions though:

1. I am not sure what directory should I ran ". ~/.profile" to make a Persistent Evaluation Variables as written here. (https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#Conclusion) Can you just run that command anywhere to make it a Persistent Evaluation Variable? Or is there a specific directory where the command ". ~/.profile" should be run? Also, does making it Persistent Evaluation Variable mean that you can now run the newly compiled ffmpeg anywhere and doesn't matter what directory you are currently working on?

2. Having read this documentation about (https://trac.ffmpeg.org/wiki/Encode/H.265) H.265 / libx265 (https://trac.ffmpeg.org/wiki/Encode/H.265) in (https://trac.ffmpeg.org/wiki/Encode/H.265) the FFmpeg site (https://trac.ffmpeg.org/wiki/Encode/H.265), and compiling x265 from source with these instructions (https://bitbucket.org/multicoreware/x265/wiki/Home), will compiling ffmpeg adding the flag "--enable-libx265" in the final step of the Compilation and Installation section of the tutorial, will now include libx265 and can also be used for encoding?

Thank you in advance.
Users of Ubuntu have no need for that ~./profile deal as it's already in your ~/.profile
After ~/bin is created just restart or run

. ~/.profile
Whether that also applies to Mint don't know - read your existing file to see...

mc4man
November 22nd, 2014, 04:02 PM
Here is what I've found out so far. On System A, Compiled a working ffmpeg about 30 days ago:



Copied ~/bin/ffmpeg from System A to System B. (Both systems have Ubuntu 14.04 LTS, updated within the last two weeks). Using ldd on System B as suggested provides a "not found" for one library, libass.so.4. Back to System A, libass.so.4 is in /usr/lib/i386-linux-gnu, (and is actually a link to libass.so.4.1.0 in the same directory.) Running dpkg -S shows that this library is available as part of the repo package libass4:i386. Checking dates, it appears to have been installed at the same time as a previous compilation of ffmpeg, back in 2013. Presumably when I did a new compile in October, one of the "make" scripts found this library already installed, and skipped that process.

I'm guessing the next step would be to install the libass4 repo package on System B. Or is there a custom build of this library that would be
more appropriate?

Thanks for your assistance.
Just install libass4
(- If you are building on i386 then I wouldn't bother trying to use on amd64 or vice-versa

JoeGibken
November 22nd, 2014, 10:13 PM
Users of Ubuntu have no need for that ~./profile deal as it's already in your ~/.profile
After ~/bin is created just restart or run

. ~/.profile
Whether that also applies to Mint don't know - read your existing file to see...

So it does not matter if I ran ". ~/.profile" anywhere?

And also, this is what is written my .profile:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi

Re-asking this question:
2. Having read this documentation about (https://trac.ffmpeg.org/wiki/Encode/H.265) H.265 / libx265 (https://trac.ffmpeg.org/wiki/Encode/H.265) in (https://trac.ffmpeg.org/wiki/Encode/H.265) the FFmpeg site (https://trac.ffmpeg.org/wiki/Encode/H.265), and compiling x265 from source with these instructions (https://bitbucket.org/multicoreware/x265/wiki/Home), will compiling ffmpeg adding the flag "--enable-libx265" in the final step of the Compilation and Installation section of the tutorial, will now include libx265 and can also be used for encoding?

So libx265 can also be added in ffmpeg if I compiled x265 adding the flag --enable-libx265?

FakeOutdoorsman
November 23rd, 2014, 04:10 AM
x265 isn't really worth using yet except maybe in very low bitrate situations (but it will still look crappy). You would have to use placebo preset and max almost everything out so it will take a very long time to encode. It is very early, and this implementation isn't there yet.

JoeGibken
November 23rd, 2014, 02:27 PM
x265 isn't really worth using yet except maybe in very low bitrate situations (but it will still look crappy). You would have to use placebo preset and max almost everything out so it will take a very long time to encode. It is very early, and this implementation isn't there yet.
But I would like to experiment still.

As mentioned at this ffmpeg page of h265 (https://trac.ffmpeg.org/wiki/Encode/H.265), I have compiled a binary of x265 using this tutorial (https://bitbucket.org/multicoreware/x265/wiki/Home). I followed your guide and added a --enable-libx265 as mentioned in the ffmpeg page of h265 (https://trac.ffmpeg.org/wiki/Encode/H.265), but it throws out this error:


ERROR: x265 not found

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.

I don't think I can find the config.log in the working directory (~/ffmpeg_sources/ffmpeg).

Any help in fixing this would be appreciated.

mc4man
November 23rd, 2014, 05:25 PM
But I would like to experiment still.

As mentioned at this ffmpeg page of h265 (https://trac.ffmpeg.org/wiki/Encode/H.265), I have compiled a binary of x265 using this tutorial (https://bitbucket.org/multicoreware/x265/wiki/Home). I followed your guide and added a --enable-libx265 as mentioned in the ffmpeg page of h265 (https://trac.ffmpeg.org/wiki/Encode/H.265), but it throws out this error:


ERROR: x265 not found

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.

I don't think I can find the config.log in the working directory (~/ffmpeg_sources/ffmpeg).

Any help in fixing this would be appreciated.

The guide you linked to ends instructions at make, you'd need to install (sudo make install && sudo ldconfig

Or - check here as an example of how to build/install x265 (obviously you're not using vlc_build folder, used twice in command
http://ubuntuforums.org/showthread.php?t=2141949

Or -
While I do provide x265 thru some ppa's it's possible I'm going to drop it as currently don't see the value & don't want to keep up on. In any event this ppa has builds, he seems to know what's he's doing (more than me for sure). I'm not recommending using the ppa itself though it could be ok, (maybe, the ffmpeg build there may not work with other source's current packages other than the inc. vlc), just to get x265 packages from.. (the lib & dev packages
https://launchpad.net/~djcj/+archive/ubuntu/vlc-stable/+packages

JoeGibken
November 23rd, 2014, 06:11 PM
The guide you linked to ends instructions at make, you'd need to install (sudo make install && sudo ldconfig

Or - check here as an example of how to build/install x265 (obviously you're not using vlc_build folder, used twice in command
http://ubuntuforums.org/showthread.php?t=2141949

Or -
While I do provide x265 thru some ppa's it's possible I'm going to drop it as currently don't see the value & don't want to keep up on. In any event this ppa has builds, he seems to know what's he's doing (more than me for sure). I'm not recommending using the ppa itself though it could be ok, (maybe, the ffmpeg build there may not work with other source's current packages other than the inc. vlc), just to get x265 packages from.. (the lib & dev packages
https://launchpad.net/~djcj/+archive/ubuntu/vlc-stable/+packages

Thanks! The first instructions did the trick :) Will try and consider your other suggestions maybe next time :)

andrew.46
November 25th, 2014, 04:01 AM
Thanks! The first instructions did the trick :)

Mind you whoever runs that vlc guide is a little behind the times as x265 has a 1.4 'release' version in place now...

mc4man
November 28th, 2014, 04:22 AM
This could be a dumb question but here goes -
What does building x264 off of either gpac or l-smash accomplish?
Asking because if built shared libx264 does not link to either of those sources libs. (neither does the x264 binary

andrew.46
November 28th, 2014, 04:57 AM
Certainly allows muxing output to mp4 from the x264 commandline but ldd shows no link and strace gives no secrets away either during a successful output to mp4.... The source shows the 2 muxers in /output as mp4.c for gpac and mp4_lsmash.c for l-smash where it uses lsmash.h.

qyot27
November 29th, 2014, 06:49 AM
libx264 only contains the relevant bits for encoding the H.264 streams themselves, it's the x264 CLI application that links to liblsmash or libgpac. In the same way, libx264 wouldn't contain anything related to Matroska.

And as already stated, GPAC and L-SMASH are MP4 muxers. The difference between them is in their organization: both are mature libraries, but generally the pressure is to switch to L-SMASH because it's a lightweight, far easier to build library that sticks closer to the MP4 standard than GPAC (which is incredibly bulky and often difficult to build) does. There were some cases where audio sync was not being honored if GPAC was used, but L-SMASH would handle it correctly (although this is also sometimes dependent on the particular audio format or audio encoder). That may have been fixed in the months since, but still. The reason both of them are options is because GPAC has been around for a long time, while L-SMASH only appeared back in...2010? I think it was 2010 (the support for using it in x264 wasn't merged upstream until October 2013, though). And the concern is that a lot of distros may not have suitable L-SMASH packages yet, so the solution is to support both, at least for the time being.

andrew.46
November 29th, 2014, 08:16 AM
I see some debian packaging in the multimedia place (http://multimedia.debian.cergy.eisti.fr/dists/stable-backports/main/binary-kfreebsd-amd64/package/l-smash) but I don't know how the path goes from there to mainstream debian and then to Ubuntu. Slackware does not have a mainstream build script but most will make their own anyway :)

frank90
December 3rd, 2014, 03:15 AM
How come the wiki guide URL at the front page no longer works?

FakeOutdoorsman
December 3rd, 2014, 05:21 AM
Works for me. Do you get an error message? Anyway, I updated the link to the actual page.

mc4man
December 4th, 2014, 03:02 PM
I see it's still built in ffmpeg (not libav
Do people still use, eg. is there any value there?

FakeOutdoorsman
December 4th, 2014, 08:34 PM
I've never used ffserver myself. It seems that some people are using it, or at least I often see questions involving ffserver. Unfortunately, due to my ignorance of ffserver, I am unable to provide help. It would be interesting to read about some successful use cases.

As for development there has been some recent (http://git.videolan.org/?p=ffmpeg.git;a=history;f=ffserver_config.c;hb=302 ed9c43f2d2a0764a9f9d2a4b2e512d2c9592f) activity (http://git.videolan.org/?p=ffmpeg.git;a=history;f=ffserver.c;hb=8b0226f2a6 d71d47c7578681e2580cb6b337adb9) and a few bug (https://trac.ffmpeg.org/ticket/1275) fixes (https://trac.ffmpeg.org/ticket/1461). There is a listed maintainer; not too much ffserver specific coding activity lately, but is occassionally active on the mailing-list and IRC.

mc4man
December 5th, 2014, 12:43 AM
I've never used ffserver myself. It seems that some people are using it, or at least I often see questions involving ffserver. Unfortunately, due to my ignorance of ffserver, I am unable to provide help. It would be interesting to read about some successful use cases.

As for development there has been some recent (http://git.videolan.org/?p=ffmpeg.git;a=history;f=ffserver_config.c;hb=302 ed9c43f2d2a0764a9f9d2a4b2e512d2c9592f) activity (http://git.videolan.org/?p=ffmpeg.git;a=history;f=ffserver.c;hb=8b0226f2a6 d71d47c7578681e2580cb6b337adb9) and a few bug (https://trac.ffmpeg.org/ticket/1275) fixes (https://trac.ffmpeg.org/ticket/1461). There is a listed maintainer; not too much ffserver specific coding activity lately, but is occassionally active on the mailing-list and IRC.
Thanks, - I decided to to ahead & directly link it (/usr/bin) for that static release build I provide.
Though I suspect not many use as I've never received any query's as to where it is from a user base of about 15k on the static.

andrew.46
December 10th, 2014, 01:02 PM
Hmmm... I am getting consistent segfault with libilbc, anybody can duplicate this? I am using libilbc 2.0.0.

FakeOutdoorsman
December 10th, 2014, 07:39 PM
I can give it a try. How can I duplicate this issue?

mc4man
December 10th, 2014, 08:15 PM
Does every time.
sample backtrace though may be useless

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff3418d25 in WebRtcSpl_AutoCorrelation () from /usr/local/lib/libilbc.so.1
#2 0x00007ffff3416c2e in WebRtcIlbcfix_SimpleLpcAnalysis () from /usr/local/lib/libilbc.so.1
#3 0x00007ffff3415522 in WebRtcIlbcfix_LpcEncode () from /usr/local/lib/libilbc.so.1
#4 0x00007ffff34126f2 in WebRtcIlbcfix_EncodeImpl () from /usr/local/lib/libilbc.so.1
#5 0x000000000087bc16 in ilbc_encode_frame (avctx=<optimized out>, avpkt=0x7fffffffd620, frame=0x19571c0,
got_packet_ptr=0x7fffffffd61c) at /home/doug/Desktop/ffmpeg/2.5/ffmpeg/ffmpeg/libavcodec/libilbc.c:172
#6 0x00000000009f26a0 in avcodec_encode_audio2 (avctx=avctx@entry=0x199fc40, avpkt=avpkt@entry=0x7fffffffd620,
frame=frame@entry=0x19571c0, got_packet_ptr=got_packet_ptr@entry=0x7fffffffd61c )
at /home/doug/Desktop/ffmpeg/2.5/ffmpeg/ffmpeg/libavcodec/utils.c:1872
#7 0x0000000000492386 in do_audio_out (frame=0x19571c0, ost=0x199faa0, s=0x199ebc0)
at /home/doug/Desktop/ffmpeg/2.5/ffmpeg/ffmpeg/ffmpeg.c:780
#8 reap_filters () at /home/doug/Desktop/ffmpeg/2.5/ffmpeg/ffmpeg/ffmpeg.c:1278
#9 0x00000000004786b2 in transcode_step () at /home/doug/Desktop/ffmpeg/2.5/ffmpeg/ffmpeg/ffmpeg.c:3721
#10 transcode () at /home/doug/Desktop/ffmpeg/2.5/ffmpeg/ffmpeg/ffmpeg.c:3764
#11 main (argc=<optimized out>, argv=<optimized out>) at /home/doug/Desktop/ffmpeg/2.5/ffmpeg/ffmpeg/ffmpeg.c:3941

mc4man
December 10th, 2014, 08:34 PM
I can give it a try. How can I duplicate this issue?

Andrew would know better so in general -
get the source ( i choose this, maybe more suitable?? - https://github.com/TimothyGu/libilbc
unpack, cd to source, then a cmake build, (build deps, again no clue, seemed ok with what I've already got
Then

mkdir build && cd build
cmake ..
build ffmpeg with --enable-libilbc
ffmpeg command ?? used this -
-i /home/doug/Music/luckynight.wav -c:a libilbc -b:a 15k -ar 8000 -ac 1 test.lbc (& test.caf, same thing

andrew.46
December 10th, 2014, 09:42 PM
mc4man has done exactly as I have done, although I was lazy with libilbc and used autotools rather than cmake:



mkdir $HOME/Desktop/testing && cd $HOME/Desktop/testing && \
wget https://github.com/TimothyGu/libilbc/releases/download/v2.0.0/libilbc-2.0.0.tar.gz && \
tar xvf libilbc-2.0.0.tar.gz && cd libilbc-2.0.0 && \
./configure && make && \
mkdir -vp doc-pak && cp -v COPYING INSTALL doc-pak && \
sudo checkinstall --pakdir "$HOME/Desktop/testing" --backup=no --deldoc=yes \
--pkgname libilbc --pkgversion "2.0.0" --fstrans=no \
--deldesc=yes --delspec=yes --default && \
sudo ldconfig


This builds static and shared by default. The seg fault comes with the syntax that mc4man has suggested:



andrew@ilium~/media/luckynight$ ffmpeg -i luckynight.wav -ac 1 -ar 8000 -b:a 12k test.lbc
ffmpeg version N-68362-gae93965 Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 11 2014 07:32:16 with gcc 4.8.2 (GCC)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/doc/ffmpeg --mandir=/usr/man --enable-postproc --enable-avfilter --enable-pthreads --enable-shared --disable-static --disable-ffserver --enable-libvorbis --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libopus --enable-libfdk-aac --enable-libilbc --enable-zlib --enable-libfreetype --disable-x11grab --enable-nonfree --enable-gpl --enable-version3 --enable-libsoxr
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 14.100 / 56. 14.100
libavformat 56. 15.103 / 56. 15.103
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 2.103 / 5. 2.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'luckynight.wav':
Duration: 00:01:00.48, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s
Output #0, ilbc, to 'test.lbc':
Metadata:
encoder : Lavf56.15.103
Stream #0:0: Audio: ilbc (libilbc), 8000 Hz, mono, s16, 12 kb/s
Metadata:
encoder : Lavc56.14.100 libilbc
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> ilbc (libilbc))
Press [q] to stop, [?] for help
Segmentation fault
andrew@ilium~/media/luckynight$


I am in the process of resurrecting my old web site and for the MPlayer page I used to have instructions for building libillbc + a link to a sample ilbc file, which I created myself. Exasperatingly enough the FFmpeg seg fault has prevented this, I was hoping that somebody would see something that I have missed rather than having to jump through the hoops for an FFmpeg bug report :(.

andrew.46
December 10th, 2014, 10:00 PM
Interestingly enough an older version of libilbc works fine. On my other distro (http://slackbuilds.org/repository/14.1/libraries/libilbc/) I have used an earlier git version (git20131002) and this has produced a working file. I attach it to this post...

FakeOutdoorsman
December 10th, 2014, 11:37 PM
Thank you both for the info. This should be reported as a bug (using both a minimally configured ffmpeg and libilbc from current git master, check if there is an exisiting report first). Do you know if this a regression? The ffbisect tool may help with that. I believe it helps deal with the merges somehow and skips revisions that don't include the needed tools. I think this is how to use it:

cd ffmpeg
tools/bisect-create
tools/ffbisect start
tools/ffbisect need ffmpeg
Then you need to specify one bad commit:

tools/ffbisect bad master
...and one good commit (that can be the hard part) :

tools/ffbisect good <commit hash>
or

git checkout <hash>
tools/ffbisect good
Then continue like a normal git-bisect (http://git-scm.com/docs/git-bisect) (but with ffbisect tool).

If you want to report the bug and find that it is a regression please add the keyword "regression", set priority as important, version to git-master, and include your command, complete console output, (or gdb output as shown in http://ffmpeg.org/bugreports.html).

mc4man
December 11th, 2014, 01:40 AM
I'm in no position to do local builds to any extent due to my only means of Ubuntu is on what was a high performing ext. ssd drive that I likely screwed up. Being it's usb3 vs. esata(ata) there's nothing I can do to fix or force garbage collection.
Anyway - I think you could assume based on commit title that on & about 09/18/14 the current git masters of both sources worked.
If so then between then & now in one or the other
http://git.videolan.org/?p=ffmpeg.git;a=commit;h=59af5383c18c8cf3fe2a4b5cc 1ebf2f3300bdfe5

andrew.46
December 11th, 2014, 07:43 AM
Hmmmm.... not exactly a small job.....

FakeOutdoorsman
December 11th, 2014, 09:24 PM
This is now bug #4181 (https://trac.ffmpeg.org/ticket/4181). Thanks for reporting it.

andrew.46
December 11th, 2014, 11:07 PM
This is now bug #4181 (https://trac.ffmpeg.org/ticket/4181). Thanks for reporting it.

Thanks for going to the trouble of putting the bug report together, I will admit to not relishing the often bruising task of reporting a bug. Perhaps the FFmpeg developers are less irascible than others :)

Edit: And so quickly, with a point release for iLBC the issue is resolved! Thanks Fakeoutdoorsman for going in to bat on this one :).

mc4man
December 12th, 2014, 03:47 AM
Seems fixed now (used the git ilbc with the commit)

(-only weird thing was the libilbc.pc file was strangely empty in the path section, edited in though didn't ck. if it needed..
Can't figure how to get a good configure from configure.ac, autoconf doesn't work right

andrew.46
December 12th, 2014, 04:07 AM
Seems fixed now (used the git ilbc with the commit)

(-only weird thing was the libilbc.pc file was strangely empty in the path section, edited in though didn't ck. if it needed..
Can't figure how to get a good configure from configure.ac, autoconf doesn't work right

Indeed works fine now and the update is on my MPlayer web page :). I used the release version 2.0.1 and autotools works fine there although I errored out with cmake (I did not pursue this as ./configure .. make works fine).

mc4man
December 12th, 2014, 04:38 AM
Indeed works fine now and the update is on my MPlayer web page :). I used the release version 2.0.1 and autotools works fine there although I errored out with cmake (I did not pursue this as ./configure .. make works fine).

Yeah , the whole thing & your recent mplayer thread post reminded me about " Winds of change". Then I noticed we'd gone thru some ilbc stuff some time ago concerning cmake, ect
(releases come with files needed for ./configure, git doesn't

andrew.46
December 12th, 2014, 06:06 AM
Yeah , the whole thing & your recent mplayer thread post reminded me about " Winds of change".

Indeed, I am assembling some of my old guides for posterity as time moves on (http://www.andrews-corner.org/ubuntu/)... Mind you I love mucking around with html / css and I am having a great time rebuilding this site!

Great to see the ilbc issue is resolved, I will be a little less wary of bug reports and terse developers next time perhaps :)

FakeOutdoorsman
December 12th, 2014, 06:25 AM
Can't figure how to get a good configure from configure.ac, autoconf doesn't work right
I just ran "autoreconf -fiv" and then the resulting configure seemed to work for me.


Great to see the ilbc issue is resolved, I will be a little less wary of bug reports and terse developers next time perhaps :)
I still managed to report it to the wrong project since I wasn't sure where the problem was, and was short of time and knowhow to properly figure that out.

andrew.46
December 12th, 2014, 06:54 AM
I still managed to report it to the wrong project since I wasn't sure where the problem was, and was short of time and knowhow to properly figure that out.

But when iLBC takes over the InterWebs you will have your name in the changelogs :).

mc4man
December 15th, 2014, 01:27 AM
I just ran "autoreconf -fiv" and then the resulting configure seemed to work for me.

Thanks - I tend to forget about such things, in this case the f & i options

andrew.46
January 18th, 2015, 06:08 AM
I see some debian packaging in the multimedia place (http://multimedia.debian.cergy.eisti.fr/dists/stable-backports/main/binary-kfreebsd-amd64/package/l-smash) but I don't know how the path goes from there to mainstream debian and then to Ubuntu. Slackware does not have a mainstream build script but most will make their own anyway :)

But now Slackware does:

http://slackbuilds.org/repository/14.1/multimedia/l-smash/

:)

gralfus2
May 30th, 2015, 06:26 PM
I just finished purging and reinstalling ffmpeg based on the guide but enabling shared. It all seems to configure and make fine, but then I get an error about a shared library when I try to run ffmpeg.
"ffmpeg: error while loading shared libraries: libavdevice.so.56"

The library doesn't seem to exist at all on my system, so I'm not sure where I'm supposed to get it (or how to tell ffmpeg to not use it)

Ubuntu 14.04 LTS (Trusty)
/usr/local/lib contains
libavdevice.a
libavdevice.so
libavdevice.so.55
libavdevice.so.55.1.0
but no reference to 56

ldd `which ffmpeg` yields the following not found:
libavdevice.so.56 => not found
libpostproc.so.53 => not found
libswresample.so.1 => not found

mc4man
June 1st, 2015, 04:30 AM
I just finished purging and reinstalling ffmpeg based on the guide but enabling shared. It all seems to configure and make fine, but then I get an error about a shared library when I try to run ffmpeg.
"ffmpeg: error while loading shared libraries: libavdevice.so.56"

The library doesn't seem to exist at all on my system, so I'm not sure where I'm supposed to get it (or how to tell ffmpeg to not use it)

Ubuntu 14.04 LTS (Trusty)
/usr/local/lib contains
libavdevice.a
libavdevice.so
libavdevice.so.55
libavdevice.so.55.1.0
but no reference to 56

ldd `which ffmpeg` yields the following not found:
libavdevice.so.56 => not found
libpostproc.so.53 => not found
libswresample.so.1 => not found
You would have needed to alter that how-to a bit more than just enabling shared. Maybe you did once before but not last time? Or didn't yet run an ldconfig which isn't needed in the guide?
(the guide as is installs to $HOME/ffmpeg_build & $HOME/bin..
What are you planning to gain with a shared ffmpeg anyway?

gralfus2
June 12th, 2015, 06:31 AM
Originally enabling shared had something to do with another error I was getting, and all advice pointed to enabling certain flags. But after much beating my head against this, I simply followed the guide using static and it seems to be working just fine now. The other part of the issue was that I didn't understand the meanings of static and shared libraries, but have a much better understanding now, so not a total waste of time.

mc4man
June 29th, 2015, 07:32 PM
Seems good arguments here, figure Debian will not maintain both so a decision will have to be made at some point
https://wiki.debian.org/Debate/libav-provider/ffmpeg

hotel_Peru_hostal
July 7th, 2015, 12:24 AM
Great in depth job on this one.

FakeOutdoorsman
July 8th, 2015, 10:18 PM
Seems good arguments here, figure Debian will not maintain both so a decision will have to be made at some point
https://wiki.debian.org/Debate/libav-provider/ffmpeg

"Debian Multimedia Maintainers team, have finally decided to switch from Libav to FFmpeg as provider for the libav* multimedia libraries".
https://lists.debian.org/debian-devel-announce/2015/07/msg00001.html

andrew.46
July 9th, 2015, 01:12 AM
"Debian Multimedia Maintainers team, have finally decided to switch from Libav to FFmpeg as provider for the libav* multimedia libraries".
https://lists.debian.org/debian-devel-announce/2015/07/msg00001.html

So perhaps the whole sorry saga is coming to an end?

mc4man
July 9th, 2015, 03:06 AM
So perhaps the whole sorry saga is coming to an end?
It will be interesting, the next decision of some curiosity will be what does gstreamer do. Currently they use libav. If they switch back then how does libav react?

One good thing for Debian/Ubuntu is once the switch occurs then the build-deps for FFmpeg will no longer include some libav headers (seems crazy but true..
And then maybe they'll see fit to have ffmpeg-extra packages & not totally neuter aac encoding

QDR06VV9
July 9th, 2015, 01:34 PM
It will be interesting, the next decision of some curiosity will be what does gstreamer do. Currently they use libav. If they switch back then how does libav react?

One good thing for Debian/Ubuntu is once the switch occurs then the build-deps for FFmpeg will no longer include some libav headers (seems crazy but true..
And then maybe they'll see fit to have ffmpeg-extra packages & not totally neuter aac encoding
+1;)

mc4man
July 9th, 2015, 06:14 PM
It will be interesting, the next decision of some curiosity will be what does gstreamer do. Currently they use libav. If they switch back then how does libav react?

Seems gstreamer already decided to also go back to FFmpeg -

https://bugzilla.gnome.org/show_bug.cgi?id=751607

mc4man
July 13th, 2015, 05:40 PM
Is there a command to print (display in terminal), for example from today -
N-73602-g39bbdeb
git rev-parse --short HEAD gives the 39bbdeb

FakeOutdoorsman
July 13th, 2015, 06:59 PM
version.sh may have some clues.

mc4man
July 14th, 2015, 12:35 AM
version.sh may have some clues.
Thanks - was quite simple
(- cd to ffmpeg source > run version.sh, it prints it out in terminal.

edit: just for clarification to no one in particular -
if a full clone then it prints as above - ex. - N-73632-g39a04eb
if a depth 1 clone then - git-2015-07-13-39a04eb

andrew.46
July 14th, 2015, 03:45 AM
Installed FFmpeg version extraction:



andrew@ilium:~$ ffmpeg -version | head -n 1 | cut -d ' ' -f 3
N-73541-g944a1aa


but looks like this is not really what you are after. Using the 'space' delimiter for cut means it may also work for ' git-2015-07-13-39a04eb' ( if the string generated by head -n 1 is similar).

mc4man
July 14th, 2015, 04:37 AM
Installed FFmpeg version extraction:



andrew@ilium:~$ ffmpeg -version | head -n 1 | cut -d ' ' -f 3
N-73541-g944a1aa


but looks like this is not really what you are after. Using the 'space' delimiter for cut means it may also work for ' git-2015-07-13-39a04eb' ( if the string generated by head -n 1 is similar).
It is in regards to a ppa build I provide. Atm I use a 'modular' script based build method, it currently just uses whatever is in the ffmpeg source > RELEASE file for what is shown when ffmpeg is run from cli. Currently git clones have 2.6.git in that file which is a little misleading to anyone using that package.

So rather than figure out how to get the build to use version.sh I just edit that file to suit. I figure maybe when there is more free time i'll look into, (I've taken on caring for an old best friend whose time is sadly ending...), the script based build is easier atm then more traditional methods.
Also makes it easy to add or remove static elements, currently just dcadec & libvpx-1.4 - screen

So this is the terminal

$ ffmpeg
ffmpeg version N-73632-g39a04eb Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
ect...

andrew.46
July 14th, 2015, 08:44 AM
"Debian Multimedia Maintainers team, have finally decided to switch from Libav to FFmpeg as provider for the libav* multimedia libraries".
https://lists.debian.org/debian-devel-announce/2015/07/msg00001.html

And doubtless buoyed up by this change of heart in the Debian camp I see that one of the abcde developers has added in FFmpeg to abcde:

http://git.einval.com/cgi-bin/gitweb.cgi?p=abcde.git;a=commit;h=c2bb8c913716dfe7 e2d0fd855c9d949a03538c15

with a nod towards avconv as well...

FakeOutdoorsman
July 18th, 2015, 12:10 AM
Thanks - was quite simple
(- cd to ffmpeg source > run version.sh, it prints it out in terminal.
Good. I couldn't remember what exactly it outputs and I was, and still am, unable to test. I'm on a fishing trip.


Currently git clones have 2.6.git in that file which is a little misleading to anyone using that package.
This is a known issue; there may be a ticket in trac.


edit: just for clarification to no one in particular -
if a full clone then it prints as above - ex. - N-73632-g39a04eb
if a depth 1 clone then - git-2015-07-13-39a04eb
IIRC, it changes to something different once you git pull the shallow repo.


And doubtless buoyed up by this change of heart in the Debian camp I see that one of the abcde developers has added in FFmpeg to abcde

Good to see work on abcde continues.

sudodus
July 18th, 2015, 08:12 AM
... I'm on a fishing trip.
...

Enjoy the fishing, RealOutdoorsman :-)

mc4man
July 30th, 2015, 01:45 PM
As of 15.10 the -dev packages (libavcodec-dev, libavformat-dev, ect) will be based on ffmpeg. So all new builds of sources using such will use ffmpeg over libav.
(the actual shared libs will remain suffixed -ffmpeg for a bit longer.

mc4man
September 7th, 2015, 01:45 AM
I see 2.8 was cut yesterday, how long generally till an official release?

FakeOutdoorsman
September 7th, 2015, 02:16 AM
Historically, a day or two. However, there is a lot of other activity going on right now (that won't be in the release, AFAIK), such as removing Libav ABI compatibility workarounds and merging the recent Libav major bump, that may case a delay.

In other news the native AAC encoder should soon be out of experimental status. I'm guessing 2-4 weeks, but who knows.

andrew.46
September 7th, 2015, 09:10 AM
In other news the native AAC encoder should soon be out of experimental status..

Looks like a huuuuge amount of work (http://git.videolan.org/?p=ffmpeg.git&a=search&h=HEAD&st=commit&s=aac) has been done on the aac encoder lately, it will be interesting to sample this work once the dust has settled!

andrew.46
October 3rd, 2015, 11:37 PM
abcde version 2.7.1 will be out in a few days and as mentioned previously in this thread it now features support for FFmpeg or avconv. Some excerpts from the changelog:



* Support added for encoding to MPEG-1 Audio Layer II (mp2)
with either twolame or FFmpeg / avconv. Tagging with mid3v2.
* Encoding to WavPack with FFmpeg. Some slight changes to WavPack
syntax with backward compatibility built in for abcde 2.7.
* Encoding to m4a container with FFmpeg or avconv. This allows
for alac encoding with FFmpeg's reverse engineered alac encoder.


There are not so many native FFmpeg audio encoders as I found, although I would like to add support for the FFmpeg aac encoder when it is officially declared non-experimental.

mc4man
February 8th, 2016, 09:21 PM
Is there any reason to continue to enable the external dcadec?
(- thought maybe I saw some instances where the ext. 'acted' better..

FakeOutdoorsman
February 8th, 2016, 11:01 PM
Not that I know of, and I was told the new native decoder (based on libdcadec and by the same author, foo86), should be faster. There is no more substantial development planned for libdcadec (https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2016-January/186366.html).

mc4man
February 9th, 2016, 02:27 AM
Not that I know of, and I was told the new native decoder (based on libdcadec and by the same author, foo86), should be faster. There is no more substantial development planned for libdcadec (https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2016-January/186366.html).
Thanks, am going to get rid of the external support
(- turns out 'issue' was not ffmpeg's.

lewdposter
March 9th, 2016, 05:31 AM
Any news?

FakeOutdoorsman
March 9th, 2016, 06:39 PM
See https://trac.ffmpeg.org/wiki/HWAccelIntro

goofprog
March 9th, 2016, 08:30 PM
there is one. When AC3 is used on the original file, I am forced to use the experimental one. AAC is default for a MP4 file.

mc4man
April 25th, 2016, 08:34 PM
Have gotten some requests about providing for 16.04, I'm a bit ambivalent about that atm. 16.04 has FFmpeg already in a reasonable state & likely some sources that use the binary are also in decent shape.
A 3.x.x ffmpeg, while obviously superior, would possibly break those sources that use the binary & would break qt-faststart which is in the ffmpeg package. (now FFmpeg has 3 packages not including the shared ones, ffmpeg, ffmpeg-doc & ffmeg-dbg, qt-faststart in in the ffmpeg package.

So for myself have decided to allow both ffmpeg repo & ffmpeg master to co-exist & both be available without any PATH changes. For a little bit the master will be in the below ppa in case anyone wants to check out & comment on method. I'm not too sure how it will 'fly' so to speak.

Basically ffmpeg master is installed completely to /opt, (no change there from previous except for manpages).
The binaries & man's are linked to /usr
To allow both FFmpeg sources the links are named differently, eg. - ffmpeg2, ffprobe2, ffplay2, ffserver2 & man's are called from those names, ie. man ffmpeg2 ect.
The master package is named ffmpeg-static.

No changes to the ffmpeg source except may alter the man comment shown in terminal to reflect how to open the proper man for ffmpeg master.

Ex. in same terminal, the ffmpeg in example is the same as 16.04 repo with a few small changes (added libfaac, libfdkaac, removed ext. info on mpc as it messes with audacious & mpc8 -

~$ ffmpeg
ffmpeg version 2.8.6-1ubuntu2.1~ppa3 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2) 20160413
configuration: --prefix=/usr --extra-version='1ubuntu2.1~ppa3' --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-nonfree --enable-libfdk-aac --enable-libfaac --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

doug@doug-HP-Pavilion-Notebook:~$ ffmpeg2
ffmpeg version N-79593-g2063f3e Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2) 20160413
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab
libavutil 55. 22.101 / 55. 22.101
libavcodec 57. 38.100 / 57. 38.100
libavformat 57. 34.103 / 57. 34.103
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 44.100 / 6. 44.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg2'
Any comments on this use method welcome.

https://launchpad.net/~mc3man/+archive/ubuntu/ffmpeg-test

FakeOutdoorsman
April 27th, 2016, 06:19 PM
A 3.x.x ffmpeg, while obviously superior, would possibly break those sources that use the binary & would break qt-faststart which is in the ffmpeg package.
qt-faststart could possibly be dropped because ffmpeg has the "-movflags +faststart" option. I don't know anyone who uses the qt-faststart tool which is probably not really maintained anymore.


To allow both FFmpeg sources the links are named differently, eg. - ffmpeg2, ffprobe2, ffplay2, ffserver2 & man's are called from those names, ie. man ffmpeg2 ect.
The master package is named ffmpeg-static.
"ffmpeg2" may confuse users into thinking that it is part of the 2.x release branch. Maybe ff*-git? Not great either...


Ex. in same terminal, the ffmpeg in example is the same as 16.04 repo with a few small changes (added libfaac, libfdkaac, removed ext. info on mpc as it messes with audacious & mpc8 -
libfaac support will be removed once the native encoder gets a speedup. As usual there is no timeline for that, however. I see no need for it with aac and libfdk_aac available.

mc4man
April 27th, 2016, 10:21 PM
qt-faststart could possibly be dropped because ffmpeg has the "-movflags +faststart" option. I don't know anyone who uses the qt-faststart tool which is probably not really maintained anymore.


"ffmpeg2" may confuse users into thinking that it is part of the 2.x release branch. Maybe ff*-git? Not great either...


libfaac support will be removed once the native encoder gets a speedup. As usual there is no timeline for that, however. I see no need for it with aac and libfdk_aac available.
I think you're correct, the hope most users would read a ppa page first is wishful. So will just do as before & in 16.04 a master FFmpeg package will replace the current repo ffmpeg package.
Any app that uses the binary & fails on master - if I can fix will present rebuilds, if not then that's a user choice/decision.
or
Set up as install one the other is removed & vice-versa, in other words use a different package name, still undecided there... The upside of that is don't have to care about breaking other sources as they'll be removed. The downside is maybe some would actually still work, at least for a while.
While I'm leaning towards using the same name & presenting replacements as & when possible the other way is much easier & less work..
(- the official list isn't that extensive, not all listed have ffmpeg as an actual depend either. -

~$ apt-cache rdepends ffmpeg
ffmpeg
Reverse Depends:
ffmpeg-dbg
ffmpeg:i386
videotrans
ffmpeg:i386
devede
ffmpeg:i386
|zoneminder
ffmpeg:i386
|youtube-dl
ffmpeg:i386
xwax
ffmpeg:i386
|winff-qt
ffmpeg:i386
|winff-gtk2
ffmpeg:i386
vokoscreen
ffmpeg:i386
view3dscene
ffmpeg:i386
ubuntustudio-video
ffmpeg:i386
stopmotion
ffmpeg:i386
qnapi
ffmpeg:i386
python3-woo
ffmpeg:i386
|python3-pafy
ffmpeg:i386
python3-matplotlib
ffmpeg:i386
python-woo
ffmpeg:i386
python-scitools
ffmpeg:i386
python-matplotlib
ffmpeg:i386
performous-tools
ffmpeg:i386
pencil2d
ffmpeg:i386
pacpl
ffmpeg:i386
multimedia-video
ffmpeg:i386
|mps-youtube
ffmpeg:i386
motion
ffmpeg:i386
mediathekview
ffmpeg:i386
libav-tools
ffmpeg:i386
kphotoalbum
ffmpeg:i386
kmplayer
ffmpeg:i386
kino
ffmpeg:i386
kdenlive
ffmpeg:i386
jsymphonic
ffmpeg:i386
imagination
ffmpeg:i386
|get-iplayer
ffmpeg:i386
imagemagick-6.q16
ffmpeg:i386
connectome-workbench
ffmpeg:i386


As far as libfaac - that was just for a personal rebuild of 2.8.6 as at least one app has not moved off of faac via ffmpeg & I was testing it (the app)
Good to know about faststart as wasn't possible to do in a ppa statically linked binaries ffmpeg

andrew.46
April 28th, 2016, 12:04 AM
libfaac support will be removed once the native encoder gets a speedup. As usual there is no timeline for that, however. I see no need for it with aac and libfdk_aac available.

That is big news, faac has been grumbling along for a long time now....

goofprog
April 28th, 2016, 02:14 AM
It is easy to install the latest ffmpeg by downloading it from ffmpeg.org and adding ffmpeg to /usr/sbin.
Well that is when I believe they use to compile it too but now it is a source code thing. Oh well. I just use wine and ffmpeg like so wine ffmpeg -i thefile.mkv -vf scale=-1:720 thefile.mp4

FakeOutdoorsman
April 28th, 2016, 05:38 PM
It is easy to install the latest ffmpeg by downloading it from ffmpeg.org and adding ffmpeg to /usr/sbin.
Well that is when I believe they use to compile it too but now it is a source code thing.
FFmpeg has never released binaries; just source code. Binaries are available from volunteers and third-parties however. For example, Linux users can get binaries from:
http://johnvansickle.com/ffmpeg/


Oh well. I just use wine and ffmpeg like so wine ffmpeg -i thefile.mkv -vf scale=-1:720 thefile.mp4
There is no need to use Wine to run ffmpeg. Since you're apparently using 15.10, just install ffmpeg from the repo, or download the binary from the link above.

andrew.46
October 1st, 2016, 10:39 AM
I am a little puzzled about nvenc and FFmpeg. I have a GeForce GTX 750 Ti with the binary blob drivers 367.44 and I note that I have access with no further effort to nvenc:



andrew@ilium~$ ffmpeg -encoders 2>/dev/null | grep nvenc
V..... h264_nvenc NVIDIA NVENC H.264 encoder (codec h264)
V..... nvenc NVIDIA NVENC H.264 encoder (codec h264)
V..... nvenc_h264 NVIDIA NVENC H.264 encoder (codec h264)
V..... nvenc_hevc NVIDIA NVENC hevc encoder (codec hevc)
V..... hevc_nvenc NVIDIA NVENC hevc encoder (codec hevc)
andrew@ilium~$


and certainly seems to work well enough although I have not tested efficiency. Why do I have access to this without going through the athletics of downloading the NVidia Codec SDK, manually copying headers etc?

I suspect I am missing something here...

FakeOutdoorsman
October 1st, 2016, 08:24 PM
Unfortunately my hardware is too old to try nvenc so I have no experience with it and am unable to try it.

As a starting point I recommend rooting around in the FFmpeg configure file to see what header files are required, and then see what packages provide these files.

Not very helpful.

Edit: I just remembered that "rooting" is Oz slang for something entirely different. Not what I meant...

andrew.46
October 1st, 2016, 10:40 PM
Edit: I just remembered that "rooting" is Oz slang for something entirely different. Not what I meant...

It is indeed :)

qyot27
October 3rd, 2016, 03:40 AM
It's because the correct header for nvenc got added to compat/ a little over a month ago. (http://git.videolan.org/?p=ffmpeg.git;a=tree;f=compat;hb=HEAD) In other words, FFmpeg supplies their own local copy of it now, removing the need for end users to go spelunking for mystery headers and fiddle with precarious system setups to make sure the headers can be found when required.

The commit itself. (http://git.videolan.org/?p=ffmpeg.git;a=commit;h=325e56479ff64c884f3bcccf9 22a7f7163488b89)

andrew.46
October 3rd, 2016, 04:20 AM
@qyot27 Thanks for that information, you have made my day!! Now to experiment with FFmpeg and nvenc encoding, I knew there was a reason I picked up a decent graphics card! My only regret is that I did not shell out for one of the newer ones with hevc hardware support...

FakeOutdoorsman
October 3rd, 2016, 04:30 PM
That is big news, faac has been grumbling along for a long time now....

libfaac has now been removed. (http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc0f711459e0c682bf9f94ba38d26736e90cff 45)


It's because the correct header for nvenc got added to compat/ a little over a month ago. (http://git.videolan.org/?p=ffmpeg.git;a=tree;f=compat;hb=HEAD)

Makes sense. Didn't even notice that commit.

andrew.46
October 15th, 2016, 05:04 AM
So I have created a little time now in which I would like to test out nvenc and perhaps write up a page of the comparison. I am a little lucky in having a GTX 750 Ti GM107-400-A2 which for me means I have a card with Maxwell microarchitecture and a good run at nvenc.

How to test could get a good start here:

http://developer.download.nvidia.com/compute/redist/ffmpeg/1511-patch/FFMPEG-with-NVIDIA-Acceleration-on-Ubuntu_UG_v01.pdf

but I am curious to know if anybody here has already done some testing?

FakeOutdoorsman
October 15th, 2016, 06:57 AM
I can't contribute much due to being in the Pleistocene epoch (NVIDIA GT 240...queue laugh track).

I'm not sure how much of that patch mentioned in the PDF is outdated. It does provide a scaling filter, nvresize, which was submitted to ffmpeg-devel (see "have some major changes for nvenc support") but never went anywhere, AFAIK.

If you are interested the FFmpeg Wiki could use some more user friendly NVENC related info at:
https://trac.ffmpeg.org/wiki/HWAccelIntro

mc4man
October 18th, 2016, 01:17 AM
So I have created a little time now in which I would like to test out nvenc and perhaps write up a page of the comparison. I am a little lucky in having a GTX 750 Ti GM107-400-A2 which for me means I have a card with Maxwell microarchitecture and a good run at nvenc.

How to test could get a good start here:

http://developer.download.nvidia.com/compute/redist/ffmpeg/1511-patch/FFMPEG-with-NVIDIA-Acceleration-on-Ubuntu_UG_v01.pdf

but I am curious to know if anybody here has already done some testing?
Minor as I'm waiting for a replacement laptop (the vendor was unable to honor orig. warranty in timely fashion so I choose full refund in store credit vs. prorated cash.
So atm only a 775m which seems a bit hobbled here.

Noticed that both a ffmpeg wiki & pdf have some parameters that don't work or don't work on this hardware. Also hardware doesn't seem to support hevc_nvenc so only tried h264. For similar quality encodings nvenc was usually twice as fast though not exactly sure what nvenc full parameters used are as they aren't reported or tagged, at least looking via mediainfo.

ffmpeg reports these for h264_nvenc

Encoder h264_nvenc [NVIDIA NVENC H.264 encoder]:
General capabilities: delay
Threading capabilities: none
Supported pixel formats: yuv420p nv12 p010le yuv444p yuv444p16le bgr0 rgb0
h264_nvenc AVOptions:
-preset <int> E..V.... Set the encoding preset (from 0 to 11) (default medium)
default E..V....
slow E..V.... hq 2 passes
medium E..V.... hq 1 pass
fast E..V.... hp 1 pass
hp E..V....
hq E..V....
bd E..V....
ll E..V.... low latency
llhq E..V.... low latency hq
llhp E..V.... low latency hp
lossless E..V....
losslesshp E..V....
-profile <int> E..V.... Set the encoding profile (from 0 to 3) (default main)
baseline E..V....
main E..V....
high E..V....
high444p E..V....
-level <int> E..V.... Set the encoding level restriction (from 0 to 51) (default auto)
auto E..V....
1 E..V....
1.0 E..V....
1b E..V....
1.0b E..V....
1.1 E..V....
1.2 E..V....
1.3 E..V....
2 E..V....
2.0 E..V....
2.1 E..V....
2.2 E..V....
3 E..V....
3.0 E..V....
3.1 E..V....
3.2 E..V....
4 E..V....
4.0 E..V....
4.1 E..V....
4.2 E..V....
5 E..V....
5.0 E..V....
5.1 E..V....
-rc <int> E..V.... Override the preset rate-control (from -1 to INT_MAX) (default -1)
constqp E..V.... Constant QP mode
vbr E..V.... Variable bitrate mode
cbr E..V.... Constant bitrate mode
vbr_minqp E..V.... Variable bitrate mode with MinQP
ll_2pass_quality E..V.... Multi-pass optimized for image quality (only for low-latency presets)
ll_2pass_size E..V.... Multi-pass optimized for constant frame size (only for low-latency presets)
vbr_2pass E..V.... Multi-pass variable bitrate mode
-rc-lookahead <int> E..V.... Number of frames to look ahead for rate-control (from -1 to INT_MAX) (default -1)
-surfaces <int> E..V.... Number of concurrent surfaces (from 0 to INT_MAX) (default 32)
-cbr <boolean> E..V.... Use cbr encoding mode (default false)
-2pass <boolean> E..V.... Use 2pass encoding mode (default auto)
-gpu <int> E..V.... Selects which NVENC capable GPU to use. First GPU is 0, second is 1, and so on. (from -2 to INT_MAX) (default any)
any E..V.... Pick the first device available
list E..V.... List the available devices
-delay <int> E..V.... Delay frame output by the given amount of frames (from 0 to INT_MAX) (default INT_MAX)
-no-scenecut <boolean> E..V.... When lookahead is enabled, set this to 1 to disable adaptive I-frame insertion at scene cuts (default false)
-b_adapt <boolean> E..V.... When lookahead is enabled, set this to 0 to disable adaptive B-frame decision (default true)
-spatial-aq <boolean> E..V.... set to 1 to enable Spatial AQ (default false)
-temporal-aq <boolean> E..V.... set to 1 to enable Temporal AQ (default false)
-zerolatency <boolean> E..V.... Set 1 to indicate zero latency operation (no reordering delay) (default false)
-nonref_p <boolean> E..V.... Set this to 1 to enable automatic insertion of non-reference P-frames (default false)
-strict_gop <boolean> E..V.... Set 1 to minimize GOP-to-GOP rate fluctuations (default false)
-aq-strength <int> E..V.... When Spatial AQ is enabled, this field is used to specify AQ strength. AQ strength scale is from 1 (low) - 15 (aggressive) (from 1 to 15) (default 8)
-cq <int> E..V.... Set target quality level (0 to 51, 0 means automatic) for constant quality mode in VBR rate control (from 0 to 51) (default 0)