Nux!


Home » Repos » Report a problem or request a package » ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support...
ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3417] Thu, 17 December 2015 17:56 Go to next message
gordan is currently offline  gordan
Messages: 12
Registered: November 2015
Junior Member
As the title says, it would be really handy if ffmpeg came with the following:
1) At least one if not both of libfaac or libfaad
2) Nvidia NVENC video offload support
3) Intel QuickSync video offload support
Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3419 is a reply to message #3417] Thu, 17 December 2015 21:05 Go to previous messageGo to next message
nux is currently offline  nux
Messages: 1662
Registered: January 2012
Senior Member
Administrator

Hi,

I'll check this when I get some more free time.

Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3506 is a reply to message #3419] Tue, 16 February 2016 19:09 Go to previous messageGo to next message
gordan is currently offline  gordan
Messages: 12
Registered: November 2015
Junior Member
I just did this, and it was fairly trivial, most of the support is already there and in the spec file.
Attached is the updated spec file.
The nvenc package has already been pre-packaged by somebody else and is available here (might be an idea to include it along with ffmpeg in the nux repository):
http://negativo17.org/repos/nvidia/epel-7/SRPMS/nvenc-5.0.1- 1.el7.src.rpm

This should make transcoding BR media (typically 25-30Mbit/s) down to a bit rate playable on a Chromecast (at a push 12Mbit/s) much less painful for people who don't have 12+ cores in their machine but have an Kepler or later Nvidia card.
  • Attachment: ffmpeg.spec
    (Size: 30.57KB, Downloaded 806 times)
Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3507 is a reply to message #3417] Wed, 17 February 2016 10:04 Go to previous messageGo to next message
nux is currently offline  nux
Messages: 1662
Registered: January 2012
Senior Member
Administrator

Gordan, thanks!
I'll definitely rebuild it, only it may take a while until I do so, personal life is taking its toll. Smile
Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3509 is a reply to message #3507] Wed, 17 February 2016 13:45 Go to previous messageGo to next message
gordan is currently offline  gordan
Messages: 12
Registered: November 2015
Junior Member
I have attached a further updated .spec file, including update to the latest ffmpeg 2.6 branch which is 2.6.8. That is what I am using at the moment.

I will also look into upgrading a notch further to 2.7.x as that has had some extra nvenc related things fixed and improved but I am not certain at the moment how this might affect other dependencies because there is a libav version bump involved that can have wide reaching knock-on effects (e.g. potentially requiring rebuild of things like mplayer and vlc and other related packages). Additionally, ffmpeg 2.7.x requires more recent libx264 than what is currently in the EL7 repositories.
  • Attachment: ffmpeg.spec
    (Size: 30.70KB, Downloaded 785 times)

[Updated on: Wed, 17 February 2016 13:49]

Report message to a moderator

Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3511 is a reply to message #3417] Wed, 17 February 2016 15:28 Go to previous messageGo to next message
nux is currently offline  nux
Messages: 1662
Registered: January 2012
Senior Member
Administrator

Thanks a lot for that, appreciated.

Bumping the major version doesn't excite me too much, there are quite a few deps that need rebuilding.
Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3539 is a reply to message #3417] Tue, 22 March 2016 16:01 Go to previous messageGo to next message
nux is currently offline  nux
Messages: 1662
Registered: January 2012
Senior Member
Administrator

I finally got to updating ffmpeg, but I wonder how you proceeded with regards to libvpx; do you maintain your own package?

Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3545 is a reply to message #3539] Sat, 26 March 2016 19:54 Go to previous messageGo to next message
gordan is currently offline  gordan
Messages: 12
Registered: November 2015
Junior Member
Awesome, thanks. Smile

Regarding libvpx, the copy on my machine seems to be from CentOS:

# rpm -qi libvpx.x86_64
Name : libvpx
Version : 1.3.0
Release : 5.el7_0
Architecture: x86_64
Install Date: Sat 18 Oct 2014 16:50:04 BST
Group : System Environment/Libraries
Size : 1368856
License : BSD
Signature : RSA/SHA256, Tue 26 Aug 2014 13:47:07 BST, Key ID 24c6a8a7f4a80eb5
Source RPM : libvpx-1.3.0-5.el7_0.src.rpm
Build Date : Tue 26 Aug 2014 13:26:00 BST
Build Host : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://www.webmproject.org/tools/vp8-sdk/
Summary : VP8 Video Codec SDK
Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3546 is a reply to message #3417] Sun, 27 March 2016 11:10 Go to previous messageGo to next message
nux is currently offline  nux
Messages: 1662
Registered: January 2012
Senior Member
Administrator

Can you try to convert something to webm format and let me know if it works?
I have a hunch it will fail.
Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3547 is a reply to message #3546] Tue, 29 March 2016 10:41 Go to previous messageGo to next message
infestdead is currently offline  infestdead
Messages: 1
Registered: March 2016
Junior Member
It fails Sad
$ ffmpeg -i clip.mp4 -c:v libvpx -b:v 1M -c:a libvorbis output.webm

ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-nonfree --extra-cflags=-I/usr/include/nvenc --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './f61321ad59d38307b78f35266bf69455/tmp.NJalCCOfsQ/clip.mp4':
  Metadata:
    major_brand     : avc1
    minor_version   : 0
    compatible_brands: isomavc1
    creation_time   : 2016-03-27 20:07:54
  Duration: 00:00:13.88, start: 0.000000, bitrate: 313 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 280x180, 310 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2016-03-27 20:07:54
      handler_name    : GPAC ISO Video Handler
Unknown encoder 'libvpx'



# rpm -qa | grep -e vpx -e ffmpeg
libvpx-1.3.0-5.el7_0.x86_64
libvpx-devel-1.3.0-5.el7_0.x86_64
ffmpeg-2.6.8-1.el7.nux.x86_64
ffmpeg-libs-2.6.8-1.el7.nux.x86_64
libvpx-utils-1.3.0-5.el7_0.x86_64

Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3560 is a reply to message #3417] Tue, 19 April 2016 09:41 Go to previous messageGo to next message
nux is currently offline  nux
Messages: 1662
Registered: January 2012
Senior Member
Administrator

Yep, too old vpx. Feel free to complain upstream in the redhat bugzilla.
Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3561 is a reply to message #3417] Wed, 27 April 2016 13:38 Go to previous messageGo to next message
nux is currently offline  nux
Messages: 1662
Registered: January 2012
Senior Member
Administrator

Hi,

Sorry, but I had to rebuild ffmpeg without nvenc, it was causing issues with users on non-nvenc/cuda platforms.

2.6.8-3.el7.nux was rebuilt without nvenc.
Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3562 is a reply to message #3417] Thu, 28 April 2016 09:32 Go to previous messageGo to next message
gordan is currently offline  gordan
Messages: 12
Registered: November 2015
Junior Member
Can you elaborate on what the exact problem is? The driver is the same, and the nvenc functionality shouldn't be getting touched unless the nvenc codec is picked. Can you paste the errors that arise?
Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3563 is a reply to message #3417] Thu, 28 April 2016 13:03 Go to previous messageGo to next message
nux is currently offline  nux
Messages: 1662
Registered: January 2012
Senior Member
Administrator

Hi,

A user complained as such (and I could verify it myself when trying to convert mp4 to mp4 for example).

ffmpeg -i Video.mp4 -c:a copy -vf cropdetect=24:16:0 tmp.mp4

This command worked correctly on el6 and el7, and I get
no errors when run on el6.  Since I accidentally erased
and then reinstalled several packages on el7, I now get
this in the output.

Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (nvenc))
  Stream #0:1 -> #0:1 (copy)
Error while opening encoder for output stream #0:0 - maybe incorrect
parameters such as bit_rate, rate, width or height


I would imagine it works if you have a working nvidia environment etc, but this is not the case for everyone.

[Updated on: Thu, 28 April 2016 13:03]

Report message to a moderator

Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3564 is a reply to message #3417] Thu, 28 April 2016 16:46 Go to previous messageGo to next message
gordan is currently offline  gordan
Messages: 12
Registered: November 2015
Junior Member
Am I missing something or is the c:v spec missing? This isn't a bug, the error is in in the ambiguous invocation. Specify -c:v libx264 if you want libx264 to be doing the encoding.

IMO: - not a bug, plain and simple user error.

I use libx264 all the time with nvenc enabled ffmpeg, and it works just fine. I use libx264 for long term storage media, and nvenc for realtime streaming, with the same set of ffmpeg binaries.

[Updated on: Thu, 28 April 2016 16:47]

Report message to a moderator

Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3565 is a reply to message #3417] Fri, 29 April 2016 08:47 Go to previous messageGo to next message
nux is currently offline  nux
Messages: 1662
Registered: January 2012
Senior Member
Administrator

Gordan,

I am able to replicate this problem on my computer.
I agree there's a way around it via parameters and so on, but below shows I am breaking defaults, ffmpeg no longer works out of the box and this is not acceptable.
Many users will have no idea how to fix it.

Do you think we could perhaps build a ffmpeg-nvenc subpackage which can distribute the nvenc bits? I am hoping this nvenc support comes in the form of some .so.



ffmpeg -i vodafonexmas.mp4 vodafonexmas2.mp4
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-nonfree --extra-cflags=-I/usr/include/nvenc --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'vodafonexmas.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2015-11-30 13:19:25
  Duration: 00:01:00.00, start: 0.000000, bitrate: 1502 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1307 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s (default)
    Metadata:
      creation_time   : 2015-11-30 13:19:25
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
[nvenc @ 0xd6aac0] Failed loading CUDA library
Output #0, mp4, to 'vodafonexmas2.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    Stream #0:0(und): Video: h264, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 25 fps (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc56.26.100 nvenc
    Stream #0:1(eng): Audio: aac, 0 channels, 128 kb/s (default)
    Metadata:
      creation_time   : 2015-11-30 13:19:25
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
      encoder         : Lavc56.26.100 libfaac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (nvenc))
  Stream #0:1 -> #0:1 (aac (native) -> aac (libfaac))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height


Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3566 is a reply to message #3417] Fri, 29 April 2016 10:23 Go to previous messageGo to next message
gordan is currently offline  gordan
Messages: 12
Registered: November 2015
Junior Member
I don't see anything anywhere that says what the "defaults" should be. I don't think it is sane to make any assumptions on what the codec will be if it isn't specified. This is normal, expected ffmpeg behaviour - if you don't specify what codec you want to use there is no reasonable ground to complain that it doesn't work as expected because there is no reasonable ground for having any expectation.

And no, I don't think codec support is separable.
Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3567 is a reply to message #3417] Sat, 30 April 2016 16:01 Go to previous messageGo to next message
nux is currently offline  nux
Messages: 1662
Registered: January 2012
Senior Member
Administrator

Gordan,

You are right technically, but in practice I'd be breaking expected behaviour that has not changed in many years.
Many users, including myself countless times, do not specify the codec (nor know how to do so); `ffmpeg -i foo.ext bar.ext` needs to work out of the box, it always has.

If you have an idea on how to make nvenc not default, I'm more than willing to give it a try.
Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3568 is a reply to message #3417] Tue, 03 May 2016 13:01 Go to previous messageGo to next message
gordan is currently offline  gordan
Messages: 12
Registered: November 2015
Junior Member
You could try filing it as a bug upstream against ffmpeg, but I suspect you will simply be told it is not a bug.

Note that I didn't actually apply any out of tree patches to ffmpeg to make this work, it was simply an extra option to ./configure at build time, since ffmpeg code already had support for nvenc.

This sort of entrenched user error and accidental functioning has been satirized before:
https://xkcd.com/1172/

[Updated on: Tue, 03 May 2016 13:03]

Report message to a moderator

Re: ffmpeg: It would be really nice if it came with libfaac, libfaad, nvenc and Intel QSV support... [message #3569 is a reply to message #3417] Tue, 03 May 2016 18:52 Go to previous message
nux is currently offline  nux
Messages: 1662
Registered: January 2012
Senior Member
Administrator

Hehe, true.

Well, thanks a lot for your help with this, if you get any idea on how to solve this conundrum, I'm all ears.
Previous Topic: [REQUEST] wink
Next Topic: Creating a local mirror
Goto Forum:
  


Current Time: Fri Dec 06 13:36:08 GMT 2019

Total time taken to generate the page: 0.12419 seconds