Avidemux Forum

Avidemux => Unix-Like (Linux/Bsd/...) => Topic started by: fullhdfan on July 19, 2020, 11:52:24 PM

Title: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 19, 2020, 11:52:24 PM
I cannot open AV1 videos in the avidemux (tried on linux mint 64 flatpack and appimage). I get an error message(internal error finding codec 0x31307661 on appimage and video not loading properly on flatpack).
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 20, 2020, 02:09:17 AM
The environment used to generate official appImages lacks necessary components for AV1 support in Avidemux. One has to build Avidemux from source with libaom headers installed or use a Linux distribution which ships Avidemux with AV1 decoder enabled (Fedora with the RPM Fusion repository).
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 20, 2020, 06:20:21 AM
Do you intend to add VDPAU-based hardware accelerated deinterlacer in the next release ?
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 20, 2020, 08:37:52 AM
?? The plugin is present since ages, working, some things were refined in March (https://github.com/mean00/avidemux2/commits/master/avidemux_plugins/ADM_videoFilters6/vdpauFilters/ADM_vidVdpauFilterDeint.cpp). Maybe your graphics hardware doesn't support this feature, or you use not the native VDPAU with NVIDIA driver but a VDPAU wrapper for VA-API?
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 20, 2020, 01:27:48 PM
I mean as video filter, not for displaying the video to be encoded. i have never seen it in the avidemux's deinterlacing filters list on my PC, neither on windows, nor on linux. i think my linux uses VDPAU(see attachment)
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 20, 2020, 01:29:02 PM
Sorry it has nothing to do with windows
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 20, 2020, 01:34:51 PM
Quote from: fullhdfan on July 20, 2020, 01:27:48 PM
I mean as video filter, not for displaying the video to be encoded.

It is a video filter.

Quotei have never seen it in the avidemux's deinterlacing filters list on my PC, neither on windows, nor on linux.

It is not available on Windows as VDPAU is Linux-only. It is available on Linux if Avidemux has picked up the VDPAU header at build time.

Quotei think my linux uses VDPAU(see attachment)

Yes, thanks, it does. Your NVIDIA driver is ancient, however. I'm not sure whether it matters for the filter, but you miss out on support for hardware accelerated encoding which AFAIR requires 440.xx or later.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 20, 2020, 01:43:15 PM
A screenshot of the configuration dialog.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 20, 2020, 01:54:35 PM
In other words, please build Avidemux from git master and use the supplied convenience script:

bash createDebFromSourceUbuntu.bash --help

Without "--help" it just installs dependencies, builds Avidemux and installs generated Debian packages. Please note that you have to install nv-codec-headers ahead of building Avidemux manually as they are provided since very recently only for Ubuntu 20.04 and are not yet included into the convenience script*.

If the resulting Avidemux build lacks features, please compress and attach /tmp/log-bootstrap-*.log to your reply.

Avidemux Flatpack packages are third-party.

*) edit: Of course, without an up-to-date NVIDIA driver NVENC still won't work, nvidia-graphics-drivers-440 available from Ubuntu Bionic on (whatever Linux Mint version it corresponds to).
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 20, 2020, 08:35:12 PM
What's wrong here ? Did i reach the point where i made an executable file ?
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 20, 2020, 10:16:34 PM
If you want to run Avidemux (avidemux3_qt5) without installation (i.e. as a portable application), you need to use the wrapper template script (run_avidemux_template.sh) to set library search path to the real location where the libraries are.

Please use copy and paste to post error messages instead of making close-up photos of the display (unless your computer is purposely airgapped, of course).

edit:

QuoteDid i reach the point where i made an executable file ?

Sure, the build succeeded. Details regarding enabled and disabled features are not available as you haven't provided the bootstrap log.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 21, 2020, 10:04:35 AM
When running run_avidemux_template.sh it says :

(Path)/../.../../adm_coreconfig.h not found. Can't determine the relative library directory. Aborting.

There is no bootstrap log file in the /tmp directory (i think you mean system directory).
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 21, 2020, 10:16:27 AM

# This is a script template to run Avidemux on Linux without installation.
# Adjust variables appropriately, copy it to a location included in $PATH
# and make it executable.

# TOPSRCDIR must match the location of the Avidemux source tree,
# default: ${HOME}/avidemux2
TOPSRCDIR="${HOME}/avidemux2"


Did you check that the location of the source directory in the script (which is meant to be placed in your $PATH) is correct?

QuoteThere is no bootstrap log file in the /tmp directory

On most if not all systems, the content of /tmp is cleared on reboot, so if you have rebooted since then, the file is gone.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 21, 2020, 10:51:24 AM
Judging from the photo of your screen, you need to edit

TOPSRCDIR="${HOME}/avidemux2"

to become

TOPSRCDIR="${HOME}/Desktop/avidemux_2.7.6"

Copy the script to a directory in your $PATH (many distributions append ~/bin to the $PATH via ~/.bash_profile, which is very practical for executables residing in the user's home directory), make it executable and optionally rename it, e.g. to "avidemux".

Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 21, 2020, 01:39:17 PM
I changed the path in the avidemux template file as you said , but it still get the first  error message(from the picture).
I have also replaced {HOME} with /home/myname/... and still got the same. It seems that the problem is elsewhere, because if i write some nonsense to the path  i get the latest (admcoreconfig) error message.

Also changed the location of the template file to avidemux usr directory, but this doesn't work either.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 21, 2020, 04:41:07 PM
I've just noticed that my appimage version got the vdpau filters. Maybe because you said to me to install the nvidia drivers( the default was the open source xserver nouveau). Tried "the keep frames" and "double framerate" option and the images with a lot of motion are still " flickering"(not smooth) . Is there an option to set the field order manually at double framerate or does the filter recognize them automatically or maybe it dosnt matter ? I tried all other filters and none of them converted the motion smoothly as in the original video(they did it more or less, but still noticeable). This matter plagues me for ages  :-\ . I want to convert some videos from my old camera that are interlaced in order to save some disk space, but don't want to distroy their quality.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 21, 2020, 06:03:52 PM
Regarding running self-built Avidemux: please copy and paste the complete uncut textual content of the Terminal from executing the wrapper script.

QuoteAlso changed the location of the template file to avidemux usr directory

Why that?? It should be placed into a directory listed by

echo $PATH

else you have to type the path to the file, not just its name to run it.

Regarding VDPAU deinterlacer filter: it assumes that the top field comes first, unusable with videos where the field order is the other way round. The VA-API deinterlacer (for Intel graphics on Linux) should support also bottom field first type of input. If no Intel hardware is available, Yadif remains the last but very good option.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 21, 2020, 09:07:04 PM
I cannot post the results directly, the forum sofware doesn't allow me to do that, it says it contains contacts or already posted, but there is the attachment.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 21, 2020, 10:28:14 PM
Thanks, would you please attach the modified wrapper script as well as the header file ~/Desktop/avidemux_2.7.6/install/include/avidemux/2.7/ADM_coreConfig.h ?
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 21, 2020, 11:35:45 PM
I changed the name of the admplugins directory in the .h file (i don't know the reason anymore).
Also tested the hardware vdpau deinterlace filter - definetly better than any software counterpart(the best one -yadif- i tested them all), but still a small flickering on images with high speed motion.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 22, 2020, 06:32:52 AM
Quote from: fullhdfan on July 21, 2020, 11:35:45 PM
I changed the name of the admplugins directory in the .h file (i don't know the reason anymore).

The script uses the values of ADM_RELATIVE_LIB_DIR and ADM_PLUGIN_DIR defines to construct the library search path, so your changes preclude it from working. With your changes, it sets the environment for avidemux3_qt5 to look for Avidemux libraries in ${HOME}/Desktop/avidemux_2.7.6/install/usr/usr/lib and plugins in ${HOME}/Desktop/avidemux_2.7.6/install/usr/usr/lib/avidemux_plugins which is obviously wrong.

Probably not of big importance, but ADM_coreConfig.h tells us that the build of NVENC-based HW video encoders was disabled, likely because of nv-codec-headers missing.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 22, 2020, 10:44:43 AM
The relative lib and install directory values in the admcoreconfig.h file were default values. I changed them after your last posting, made
Install as /install/usr and realtive lib as/ lib. The application was launched but cannot open videos and there are no encoders(see the attached terminal output)
Anyway , i will give it up. Just give me a last advice and if it doesn't work I'll stick to the appimage version. My goal was to find extra features to make the conversion and deinterlacing faster and better(my pc is old and i don't expect miracles(but when a 1h fullhd interlaced h264 home video takes 14h to be converted to an h.265 progressive is still an isue doesn't it ?). Can i see somewhere if the hardware decoding is used during the conversion ?
For future release:  could you add the change frame order option to the vdpau deinterlace filter ?
Use dav1d decoder for av1. It's faster.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 22, 2020, 12:30:42 PM
Quote from: fullhdfan on July 22, 2020, 10:44:43 AM
I changed them after your last posting, made Install as /install/usr

This is wrong. The default prefix is /usr, so it should be (and it was correct earlier)

#define ADM_INSTALL_DIR "/usr"

Quoteand realtive lib as/ lib.

I assume there is a mistake in the quote, the correct value should be

#define ADM_RELATIVE_LIB_DIR "lib"

(and don't change ADM_PLUGIN_DIR, it should remain

#define ADM_PLUGIN_DIR "ADM_plugins6"

...)

QuoteThe application was launched but cannot open videos and there are no encoders(see the attached terminal output)

Thanks,

Quote [ADM_initBaseDir] 10:27:46-959  Relative to install plugin mode : </home/deian/Desktop/avidemux_2.7.6/install/usr/bin/../lib/ADM_plugins6>

which means the path supplied to the canonicalize_file_name (https://github.com/mean00/avidemux2/blob/master/avidemux_core/ADM_core/src/ADM_folder_linux.cpp#L42) function was wrong, so it failed, the pointer "simple2" was NULL, and we don't append the trailing directory separator on failure, making the failure fatal :-D

Plugins could not be found due to directory separator missing after ADM_plugins6 following canonicalize_file_name() rejecting the path passed to it.

QuoteAnyway , i will give it up. Just give me a last advice and if it doesn't work I'll stick to the appimage version.

I would recommend to start afresh with git master (I assume git is already installed, else

sudo apt-get update
sudo apt-get install git


should not pose a problem)

cd ~
git clone https://github.com/mean00/avidemux2.git
cd avidemux2
git submodule update --init --recursive
bash bootStrap.bash
bash run_avidemux_template.sh


QuoteCan i see somewhere if the hardware decoding is used during the conversion ?

In the main window below the "Video Decoder" header, the left label indicates the decoder in use, the right one the renderer. On a VDPAU platform, it shows "VDPAU" when the HW accel decoder is used.

QuoteFor future release:  could you add the change frame order option to the vdpau deinterlace filter ?

You mean support for bottom-field-first input? I have not a single sample of this kind, so no development is possible unless you provide a sample. I also don't know whether VDPAU supports this (VDPAU has been deprecated by NVIDIA, so it probably makes more sense to explore its successors).

QuoteUse dav1d decoder for av1. It's faster.

It has ripened now, but libaom was a more reliable solution back then. We will need libaom also when an AV1 encoder ever arrives in Avidemux.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 22, 2020, 01:33:05 PM
I've altered the behaviour of canonize() to always add directory separator (https://github.com/mean00/avidemux2/commit/21355bf73c6249b0694e701ec39e8a47e27dec0a), won't harm.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 22, 2020, 07:04:51 PM
I followed your last advice and it worked (git).
This should have been done from the start.
My first package was a fosshub download(link from your website).
The software was installed with no problems. It took ages to build. The terminal froze sometimes and I thought the process is over, but when I looked at the task manager the CPU was fully loaded . This was maybe the reason why my first build didn't succeed. Perhaps i thought the build is over because apparently there was no activity in the terminal and closed it too early.

You can download a small interlaced sample here . It is bottom field first (mediainfo app info) and very smooth motion - tested on my TV.

https://drive.google.com/file/d/12E8AiilNvTZ6NHCOA9d4M5PiAS49eCsg/view?usp=drivesdk

The link will be active temporarily.

Many thanks and looking forward to new codecs  ;D .
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 22, 2020, 07:47:34 PM
Thank you very much for the sample. It allowed me to verify for the first time that the VA-API deinterlacer works fine with BFF input. Will look into our options for the VDPAU deinterlacer a bit later, I need to move to a different PC for that purpose, not possible ATM.

QuoteThe terminal froze sometimes and I thought the process is over, but when I looked at the task manager the CPU was fully loaded .

The output from make is redirected to a file in /tmp (e.g. /tmp/logbuildCore), it looks as if "nothing happens" while the build is normally progressing.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 23, 2020, 05:40:07 PM
Suport for BFF input in the VDPAU deinterlacer plugin has been added (https://github.com/mean00/avidemux2/commit/695c6ba0c4cf4df9f2923a142adbd2053ca19d4d), please do

cd ~/avidemux2
git pull --recurse
bash bootStrap.bash --rebuild


and try whether it works for you (it works for me with your sample and usual TFF videos).

The option to "keep bottom field" (actually to drop all output deinterlaced pictures with odd number) doesn't seem to produce pleasant results with any of samples I tried, maybe it is better to remove it. The optimal result is mostly achieved when choosing "keep both", but I have a sample where the actual footage is shot in BFF mode, but the ticker on top of it is in TFF mode! This leaves "keep top field" the only viable option in this special case.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: fullhdfan on July 27, 2020, 09:54:59 PM
I've tested the vdpau deinterlace filter in TFF and BFF modes and both work flawlessly. I have also thought so far the software deinterlace filters were bad. An idea crossed my mind : let's test the converted samples on my TV : vdpau, yadif and dgbob (all double framerate). The result : amazing ! Perfectly smooth motion !

I figured out why the motion is not smooth on my PC - it's too slow/old.  50 frames/s - double framerate - is just  too much, no matter whether linux or windows, hardware or software decoding(the software one beeing even faster than the hardware one at this framerate) .

Does the resample fps filter do something special ? I've used it always with my test samples above, because i had problems in the past - the android/pc players and even my TV didn't play the converted (dvd->h.264 interlaced) videos smoothly without it.
Title: Re: AV1 decoder not working on v.2.7.6 ?
Post by: eumagga0x2a on July 27, 2020, 11:45:21 PM
Quote from: fullhdfan on July 27, 2020, 09:54:59 PM
I've tested the vdpau deinterlace filter in TFF and BFF modes and both work flawlessly.

Great, thanks. It is always possible with HW acceleration stuff that a fix is based on assumptions which hold in one environment but not in another, so such feedback is very valuable.

QuoteI have also thought so far the software deinterlace filters were bad.

They are, actually.

QuoteAn idea crossed my mind : let's test the converted samples on my TV : vdpau, yadif and dgbob (all double framerate). The result : amazing ! Perfectly smooth motion !

The smoothness is given from bobbing (from doubling the frame rate). It is the overall quality – how well the reconstruction of missing lines works – which matters.

QuoteDoes the resample fps filter do something special ? I've used it always with my test samples above, because i had problems in the past - the android/pc players and even my TV didn't play the converted (dvd->h.264 interlaced) videos smoothly without it.

During the 2.7.4 – 2.7.6 release cycle, some issues in Avidemux were identified and fixed which resulted in perfectly regular input turning into pseudo-variable (oscillating) frame rate output. In particular, Avidemux tried to use time base (the num/den fraction used to describe timestamps in a video) and frame rate interchangeably, often arriving at wrong time base for many streams. The "Resample" filter helped to counteract these issues. It is still helpful in many cases when the input itself is irregular (the denominator grows huge, the numerator is small and thus the timestamps expressed in multiple of time base are high), but when the input is either perfectly regular (also regular with some frames missing) or the irregularity was caused by an older version of Avidemux, which we are sometimes able to recognize and to correct (https://github.com/mean00/avidemux2/blob/master/avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4Indexer.cpp#L424), it should not be necessary.

Please note that videos produced by most if not all Android smartphones have variable frame rate with time base denominator set to 90 kHz. So VFR should not be a problem on Android as such, but some devices have a fixed max frame rate and issues in time base calculation during codec configuration can result in a stream being rejected if the fps exceeds the limit, see topic x264 incompatible with LG BluRay player (https://avidemux.org/smif/index.php/topic,19166.0.html).