Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: Jan Gruuthuse on July 21, 2018, 06:39:51 AM

Title: Testing ffmpeg4x
Post by: Jan Gruuthuse on July 21, 2018, 06:39:51 AM
From https://github.com/mean00/avidemux2
* [new branch]      ffmpeg4x   -> origin/ffmpeg4x
Already up-to-date.

Has this become live? Just did pull git.

This branch is 14 commits ahead of master.
Or is this in progress to become master, and should I wait until Master = ffmpeg4x . Lost it for now

My build shows:
Avidemux v2.7.1 (180721_34fdf5673e4) and does match Master branch 34fdf5673e4?


Title: Re: [new branch] ffmpeg4x
Post by: eumagga0x2a on July 21, 2018, 07:43:40 AM
The ffmpeg4x branch includes my recent work (https://avidemux.org/smif/index.php/topic,18406.msg84542.html#msg84542) on migrating Avidemux to FFmpeg 4.0.x just to prevent that it gets lost if my computer suffers a HDD crash or such. It should compile and most features should work (now including sound and VDPAU hw accel), but as of now, many project scripts generated with the current git master or releases would be incompatible due to changes in FFmpeg structures.

The purpose of the branch is to keep these changes off master for a while. It might be merged into master at a later point.

If you have a computer with Intel graphics (no NVIDIA graphics card) running Linux, you could help by providing feedback whether the libVA hw accel still works with the ffmpeg4x branch.
Title: Re: Testing ffmpeg4x
Post by: Jan Gruuthuse on July 21, 2018, 08:59:19 AM
on Ubuntu amd-64 18.04 LTS when
git checkout ffmpeg4x
git branch
Quote* ffmpeg4x
---------

started build ends:

-- Configuring FFmpeg
CMake Error at ~/avidemux2/cmake/admFFmpegBuild_helpers.cmake:274 (MESSAGE):
  configure returned <1>
Call Stack (most recent call first):
  ~/avidemux2/cmake/admFFmpegBuild_native.cmake:54 (ADM_FF_BUILD_UNIX_STYLE)
  ~/avidemux2/cmake/admFFmpegBuild.cmake:16 (include)
  CMakeLists.txt:96 (include)


CMake Error at ~/avidemux2/cmake/admFFmpegBuild_helpers.cmake:275 (MESSAGE):
  configure output is <ERROR: nvenc requested, but not all dependencies are
  satisfied: ffnvcodec

 

  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 "ffbuild/config.log" produced by configure as this
  will help

  solve the problem.

  >
Call Stack (most recent call first):
  ~/avidemux2/cmake/admFFmpegBuild_native.cmake:54 (ADM_FF_BUILD_UNIX_STYLE)
  ~/avidemux2/cmake/admFFmpegBuild.cmake:16 (include)
  CMakeLists.txt:96 (include)


CMake Error at ~/avidemux2/cmake/admFFmpegBuild_helpers.cmake:276 (MESSAGE):
  An error occured
Call Stack (most recent call first):
  ~/avidemux2/cmake/admFFmpegBuild_native.cmake:54 (ADM_FF_BUILD_UNIX_STYLE)
  ~/avidemux2/cmake/admFFmpegBuild.cmake:16 (include)
  CMakeLists.txt:96 (include)


-- Configuring incomplete, errors occurred!
See also "~/avidemux2/buildCore/CMakeFiles/CMakeOutput.log".
See also "~/avidemux2/buildCore/CMakeFiles/CMakeError.log".
** Failed at cmakeZ**
Title: Re: Testing ffmpeg4x
Post by: Jan Gruuthuse on July 21, 2018, 09:10:32 AM
dpkg -l nvidia*-dev
QuoteDesired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                               Version                Architecture           Description
+++-==================================-======================-======================
ii  nvidia-cuda-dev                    9.1.85-3ubuntu1        amd64                  NVIDIA CUDA development files
un  nvidia-libopencl1-dev              <none>                 <none>                 (no description available)
ii  nvidia-opencl-dev:amd64            9.1.85-3ubuntu1        amd64                  NVIDIA OpenCL development files
Title: Re: Testing ffmpeg4x
Post by: eumagga0x2a on July 21, 2018, 09:14:09 AM
FFmpeg 4.x requires nv-codec-headers for NVENC to be available. These are as it seems not yet "officially" (by Canonical or from the universe repo) packaged for Ubuntu. There are PPAs for that (https://launchpad.net/~mc3man/+archive/ubuntu/prop4me) (this one for 18.04 (https://launchpad.net/~mc3man/+archive/ubuntu/bionic-prop)) or just install from git (https://askubuntu.com/questions/778100/how-to-install-compile-nvenc-in-ubuntu).
Title: Re: Testing ffmpeg4x
Post by: Jan Gruuthuse on July 21, 2018, 09:33:36 AM
Would this work with internal FFmpeg (avidemux)?
QuoteAt the moment these headers must be installed as well as FFmpeg from git to get access to nvenc and friends.
Title: Re: Testing ffmpeg4x
Post by: eumagga0x2a on July 21, 2018, 09:55:54 AM
It needs only the headers.
Title: Re: Testing ffmpeg4x
Post by: Jan Gruuthuse on July 21, 2018, 11:33:27 AM
OK, will look at this next days, time permitting.
Title: Re: Testing ffmpeg4x
Post by: Jan Gruuthuse on July 22, 2018, 09:35:30 AM
~/nv-codec-headers$
make
Quotesed 's#@@PREFIX@@#/usr/local#' ffnvcodec.pc.in > ffnvcodec.pc
sudo make install
Quotesed 's#@@PREFIX@@#/usr/local#' ffnvcodec.pc.in > ffnvcodec.pc
install -m 0755 -d '/usr/local/include/ffnvcodec'
install -m 0644 include/ffnvcodec/*.h '/usr/local/include/ffnvcodec'
install -m 0755 -d '/usr/local/lib/pkgconfig'
install -m 0644 ffnvcodec.pc '/usr/local/lib/pkgconfig'

~/avidemux2$
git branch
Quote* ffmpeg4x
  master
bash bootStrap.bash --deb

Quote-- Build files have been written to: ~/avidemux2/buildCore
** Failed at make, result in /tmp/logbuildCore**

Quotemake[2]: *** No rule to make target 'ffmpeg/build/libpostproc', needed by 'CMakeFiles/libpostproc'.  Stop.
make[2]: Leaving directory '~/avidemux2/buildCore'
CMakeFiles/Makefile2:203: recipe for target 'CMakeFiles/libpostproc.dir/all' failed
make[1]: *** [CMakeFiles/libpostproc.dir/all] Error 2
Title: Re: Testing ffmpeg4x
Post by: eumagga0x2a on July 22, 2018, 11:46:18 AM
I would need the full /tmp/logbuildCore, the excerpt you've posted doesn't contain the actual error.
Title: Re: Testing ffmpeg4x
Post by: Jan Gruuthuse on July 22, 2018, 12:00:51 PM
forwarded
Title: Re: Testing ffmpeg4x
Post by: eumagga0x2a on July 22, 2018, 12:24:22 PM
Thank you. No idea ATM what is going wrong, will investigate later. Builds fine on Fedora 28.
Title: Re: Testing ffmpeg4x
Post by: Jan Gruuthuse on July 22, 2018, 03:58:03 PM
QuoteFFmpeg version of headers required to interface with Nvidias codec APIs.

Corresponds to Video Codec SDK version 8.1.24.

Minimum required driver versions:
Linux: 390.25 or newer
Windows: 390.77 or newer
installed from https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
Title: Re: Testing ffmpeg4x
Post by: Jan Gruuthuse on July 22, 2018, 04:09:32 PM
ffmpeg -encoders 2>/dev/null | grep nvenc
Quote 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)
Title: Re: Testing ffmpeg4x
Post by: eumagga0x2a on July 22, 2018, 07:44:42 PM
First of all, we won't find the NVENC header in /usr/local/include where it is installed by the Makefile in nv-codec-headers by default, please apply the attached patch.
Title: Re: Testing ffmpeg4x
Post by: eumagga0x2a on July 22, 2018, 07:55:43 PM
I installed Ubuntu Bionic from the most recent daily image in a VM using gnome-boxes, installed git, cloned the Avidemux git repo, checked out ffmpeg4x branch, ran

bash createDebFromSourceUbuntu.bash --deps-only

installed the nv-codec-headers from git, libass-dev, liba52-0.7.4-dev, libmad0-dev, libmp4v2-dev, patched cmake/admCheckNvEnc.cmake and ran

bash bootStrap.bash --prefix=/usr/local --with-system-libass --with-system-liba52 --with-system-libmad --with-system-libmp4v2

which succeeded impeccably. The resulting Avidemux build runs fine.
Title: Testing ffmpeg4x: c5dfbb2
Post by: Jan Gruuthuse on July 24, 2018, 05:56:53 AM
update: your post above, July 22, 2018, 07:55:43 PM, just appeared.

c5dfbb2            [ffmpeg] Update to 4.0.2, update the patch for h263dec.c to apply without offset
~/avidemux2$ git branch
Quote* ffmpeg4x
  master

~/avidemux2$ git apply -v cmake-ffnvcodec-local.patch
QuoteChecking patch cmake/admCheckNvEnc.cmake...
Applied patch cmake/admCheckNvEnc.cmake cleanly.

build avidemux:
Quote-- Build files have been written to: /home/jan/avidemux2/buildCore
** Failed at make, result in /tmp/logbuildCore**
forwarded
Title: Re: Testing ffmpeg4x
Post by: Jan Gruuthuse on July 24, 2018, 06:34:38 AM
Quote from: eumagga0x2a on July 22, 2018, 07:55:43 PM
I installed Ubuntu Bionic from the most recent daily image in a VM using gnome-boxes, installed git, cloned the Avidemux git repo, checked out ffmpeg4x branch, ran

bash createDebFromSourceUbuntu.bash --deps-only

installed the nv-codec-headers from git, libass-dev, liba52-0.7.4-dev, libmad0-dev, libmp4v2-dev, patched cmake/admCheckNvEnc.cmake and ran

bash bootStrap.bash --prefix=/usr/local --with-system-libass --with-system-liba52 --with-system-libmad --with-system-libmp4v2

which succeeded impeccably. The resulting Avidemux build runs fine.
Quote-- Build files have been written to: /home/jan/avidemux2/buildCore
** Failed at make, result in /tmp/logbuildCore**
Title: Re: Testing ffmpeg4x
Post by: eumagga0x2a on July 24, 2018, 10:46:57 AM
The log is obviously unchanged. My last post implied that the build failure you see doesn't happen on a clean up-to-date Ubuntu 18.04 install. Do you have old Avidemux headers still installed somewhere in the system? Please remove them prior to running bootstrap script. I would also remove Ubuntu universe provided ffmpeg headers (libpostproc-dev, libavcodec-dev, libswresample-dev etc.) if they are installed on your system.
Title: Re: Testing ffmpeg4x
Post by: eumagga0x2a on July 31, 2018, 04:14:09 PM
Please try the attached patch.

diff --git a/cmake/admFFmpegUtil.cmake b/cmake/admFFmpegUtil.cmake
index e34d93b62..3f113d1e2 100755
--- a/cmake/admFFmpegUtil.cmake
+++ b/cmake/admFFmpegUtil.cmake
@@ -76,7 +76,7 @@ MACRO (registerFFmpeg sourceDir binaryDir installed)
add_custom_target(libavcodec DEPENDS "${binaryDir}/libavcodec/${LIBAVCODEC_LIB}")
add_custom_target(libavformat DEPENDS "${binaryDir}/libavformat/${LIBAVFORMAT_LIB}")
add_custom_target(libavutil DEPENDS "${binaryDir}/libavutil/${LIBAVUTIL_LIB}")
- add_custom_target(libpostproc DEPENDS "${binaryDir}/libpostproc/${LIBAVPOSTPROC_LIB}")
+ add_custom_target(libpostproc DEPENDS "${binaryDir}/libpostproc/${LIBPOSTPROC_LIB}")
add_custom_target(libswscale DEPENDS "${binaryDir}/libswscale/${LIBSWSCALE_LIB}")
add_custom_target(ffmpeg DEPENDS "${binaryDir}/ffmpeg${CMAKE_EXECUTABLE_SUFFIX}")
Title: Re: Testing ffmpeg4x
Post by: Jan Gruuthuse on August 09, 2018, 05:23:35 AM
Big time shortage, and getting worse next months, probably not getting at this stage.
Title: Re: Testing ffmpeg4x
Post by: eumagga0x2a on August 09, 2018, 12:31:56 PM
It's a pity. I've pushed the patch to the branch as is.