September 23, 2021, 11:09:17 PM

News:

--


[SOLVED] 2.7.9 and missing video decoders

Started by jklug, May 17, 2021, 05:38:05 AM

Previous topic - Next topic

jklug

May 17, 2021, 05:38:05 AM Last Edit: May 18, 2021, 07:57:00 AM by jklug
I moved off of 2.6 because the batch feature did not work.  My system (Ubuntu 16) has Python 3.  Don't know if the batch feature in 2.6 requires Python 2.  Don't know where the error log for the batch resides.

I followed the 2.6 instructions to build 2.7, and I see no video decoders in the client UI.  I know during the build it said this:

-- Checking for NVENC
-- *****************
-- Checking for module 'ffnvcodec'
--  No package 'ffnvcodec' found
-- FFNVENC not found, you can get it from here https://github.com/FFmpeg/nv-codec-headers


The problem with this package is the tags of nv-codec-headers don't line up with ffmpeg versions.  No idea which tag I should use, or even if this is the cause of my issue.

For instance I have this on my system:
ii  libavcodec-dev:amd64                                7:2.8.17-0ubuntu0.1 

The tags in nv-codec-headers run from 8.x to 11.x.

Any suggestions on how to get video codecs in avidemux 2.7?  Do I need a newer version of Ubuntu?

eumagga0x2a

Quote from: jklug on May 17, 2021, 05:38:05 AMMy system (Ubuntu 16) has Python 3.  Don't know if the batch feature in 2.6 requires Python 2.

The internal tinyPy scripting in Avidemux doesn't depend on or use any external Python interpreters. The command line interface of Avidemux doesn't require any specific shell, you can invoke it from any script interpreter you like. I'm not sure which one you mean by "batch feature".

Quote from: jklug on May 17, 2021, 05:38:05 AMI followed the 2.6 instructions to build 2.7, and I see no video decoders in the client UI.

Decoders? Do you mean encoders? Decoders were never exposed in the 2.7 UI.

Apart from that, I am not sure what "2.6 instructions" mean. There is a convenience script "createDebFromSourceUbuntu.bash" which installs build dependencies (and by default also performs the build in one go) for this purpose. Please clarify whether you want to install Avidemux system-wide or just for yourself. If it is the latter, you don't need to install Avidemux at all: you can run it from the "install" directory of the source tree (copy it whenever you want or leave it where it is, edit run_avidemux_template.sh and run_jobs_template.sh to match its location, copy them, renamed to your liking, to a directory in your $PATH and make them executable).

Regarding NVENC (NVIDIA encoder), the problem is that the bundled FFmpeg v4.4 requires a very recent interface (nv-codec-headers) version which in turn requires a very recent NVIDIA driver version. Ubuntu 16.xx is really very old, thus it may pose a problem to find a working combination.

jklug

Sorry about this.  I realize most of my post was just a misunderstanding.

I upgraded to Ubuntu 20.04. What I called "batch" should have been called "jobs" or "avidemux3_jobs_qt5".  It didn't work until I went to Ubuntu 20.

I now understand that the video decoder is established after you load the input file.  So it is expected that there is no decoder listed in "avidemux3_qt5" before the file is loaded, and the XXX near the Video Decoder disappears when an input video file is loaded.

The only thing left of interest is that the program avidemux3_jobs_qt5 puts timeout messages regularly for output every two seconds.  I assume this is normal, and certainly doesn't hurt anything:

 [pollMessage] 07:36:52-484  Timeout on socket
 [pollMessage] 07:36:54-485  Timeout on socket
 [pollMessage] 07:36:56-486  Timeout on socket
 [pollMessage] 07:36:58-488  Timeout on socket
 [runOneJob] 07:36:59-489  Got a new message 3

jklug


eumagga0x2a

Quote from: jklug on May 18, 2021, 07:51:57 AMThe only thing left of interest is that the program avidemux3_jobs_qt5 puts timeout messages regularly for output every two seconds.  I assume this is normal

Yes, it is absolutely normal, just ugly to watch.

The 2.6 build instructions are mostly outdated, partially still valid. Nowadays on Ubuntu, you should clone the source, then cd avidemux2 and run

bash createDebFromSourceUbuntu.bash --help
to learn about available options. Please note that you need to install nv-codec-headers manually in advance as there is still no official Ubuntu package, an unbelievable omission.

jklug

I never did install nv-codec-headers because I was uncertain which version to install.  I expected an error in the build, but never got one.

I did install this package:
    libavcodec-dev:amd64                              7:4.2.4-1ubuntu0.1

I did this:
    ./bootStrap.bash --deb --with-core --with-cli --with-qt --with-plugins

I then installed the deb packages that were created.


eumagga0x2a

Quote from: jklug on May 19, 2021, 04:13:20 AMnever did install nv-codec-headers because I was uncertain which version to install.

FFmpeg 4.4 seems to accept anything newer than 8.1.24.11. You should only make sure that the NVENC API version is compatible with the NVIDIA graphics driver version used on your system. The function nvenc_print_driver_requirement() can serve as reference. In general, older API = older driver = less features.

Quote from: jklug on May 19, 2021, 04:13:20 AMI did install this package:
    libavcodec-dev:amd64                              7:4.2.4-1ubuntu0.1

Not needed for Avidemux build, it uses its own internal FFmpeg (libavcodec, libavformat, libavutil, libswscale and libpostproc).

Quote from: jklug on May 19, 2021, 04:13:20 AMI did this:
    ./bootStrap.bash --deb --with-core --with-cli --with-qt --with-plugins

All options following --deb are default and thus redundant.

Quote from: jklug on May 19, 2021, 04:13:20 AMI then installed the deb packages that were created.

Please be aware that the purpose of auto-generated deb packages is to facilitate uninstall only, the packages include no dependency info. If you choose to follow Avidemux development, you might want to run Avidemux without installation.

jklug

Thanks.  I have been trying out avidemux with no issues using input of Mpeg2 ATSC (Lavcodec RGB) and output of Mpeg4 AVC (x264).

Now I see that NV is Nvidia, and I have no NVIDIA card on the system I am using. So nv-codec-headers would not have helped, and I see that if the headers are not present the build still works, presumably without the Nvidia accelerators.

eumagga0x2a

Quote from: jklug on May 20, 2021, 04:51:57 AMLavcodec RGB

That is bad, you really should find an accelerated video output which works for you. The "RGB" = "Qt" output means the CPU performs all the scaling and color conversion work. This is the last straw when everything else fails.

Quote from: jklug on May 20, 2021, 04:51:57 AMI have no NVIDIA card on the system

This is sort of pity as hw acceleration provided by NVIDIA hardware with closed-source drivers (VDPAU for decoding and display, NVENC when supported by hardware for encoding) works best in Avidemux.

Quote from: jklug on May 20, 2021, 04:51:57 AMSo nv-codec-headers would not have helped

Don't forget that nv-codec-headers only enable the support for NVENC (NVIDIA encoder) in the generated Avidemux binary. This encoder is great when you need to encode something to H.264 (or HEVC with recent graphics cards) really fast despite poor compression rate and, with older cards, a fixed keyframe interval as a tradeoff. So if your CPU is too slow to encode using a high quality encoder (libvpx for VP9, x265 for HEVC, x264 for H.264) at a decent frame rate like mine, NVENC (or VA-API for Intel) to the rescue.

When using Avidemux primarily for editing in copy mode, hw decoding and display suport is what really matters. You should check whether VDPAU or VA-API (libva) are usable on your system.

butterw

May 20, 2021, 07:48:56 AM #9 Last Edit: May 20, 2021, 07:51:26 AM by butterw
x264 and x265 are strictly software encoders, meaning they run on cpu cores only, as opposed to GPU hardware fixed-function encoders.

jklug

QuoteThat is bad, you really should find an accelerated video output which works for you. The "RGB" = "Qt" output means the CPU performs all the scaling and color conversion work. This is the last straw when everything else fails.
Lavcodec is the input codec, not the output, and there appears to be no choice.  Should there be choices?

I didn't really care that the decoding was not real time.  I have Intel video.  That is what MythTV uses for playback.  I am not playing anything back here, except while editing.  I can't complain.  It works well.

For software encoders, is it possible to get x265 working from the UI?  I don't see any, but maybe I don't recognize it.  My system has libx265 from ffmpeg installed.  I don't see HVEC mentioned or x265.  You mentioned that avidemux has its own ffmpeg library, and I don't recall it in the build options.

eumagga0x2a

Quote from: jklug on May 20, 2021, 09:22:45 AMLavcodec is the input codec, not the output, and there appears to be no choice.  Should there be choices?

This is an old topic, but I missed your reply, so just if this still matters: my remark was related to power efficiency. You should not select the "Qt" as display driver in Avidemux unless all other options fail. "Qt" is just the last resort. Yes, it works, but it is wastes energy for no gain.

Avidemux decodes almost all video codecs using internal libavcodec ("Lavcodec") library, notable exceptions are uncompressed bitmaps, uncompressed YUV data and AV1. libavcodec can use interfaces like VDPAU and VA-API on Linux, VideoToolbox on macOS and DXVA2 on Windows for hardware-accelerated decoding of some video codecs. If you have not totally ancient Intel graphics, you should build Avidemux with VA-API enabled (i.e. make sure libva-dev is installed prior to compiling Avidemux) and enable libva as HW decoder and as video display in Avidemux Preferences.

The labels showing the name of the decoder and the name of the video output are purely informational and thus read-only. The controls affecting the selection are exposed in Avidemux Preferences, in the "Display" and "HW Accel" tabs.

Quote from: jklug on May 20, 2021, 09:22:45 AMFor software encoders, is it possible to get x265 working from the UI?

"HEVC (x265)" encoder should be available in the dropdown list directly below the "Video Output" label. If it is not, libx265-dev was not installed prior to compiling Avidemux.

Quote from: jklug on May 20, 2021, 09:22:45 AMMy system has libx265 from ffmpeg installed.

libx265 has nothing to do with FFmpeg. FFmpeg can use libx265 as encoder for HEVC if it has been enabled at compile time. When Avidemux uses libx265, it uses it directly, not via internal FFmpeg.

Quote from: jklug on May 20, 2021, 09:22:45 AMYou mentioned that avidemux has its own ffmpeg library, and I don't recall it in the build options.

There are no build options for that because the internal FFmpeg is a required component (Avidemux compilation will fail if the internal ffmpeg cannot be compiled).