Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way around the libavcodec 59 dependency? #1242

Open
codecowboy opened this issue Nov 26, 2024 · 12 comments
Open

Is there a way around the libavcodec 59 dependency? #1242

codecowboy opened this issue Nov 26, 2024 · 12 comments
Labels
state:Backlog This issue will be worked on in the future

Comments

@codecowboy
Copy link

codecowboy commented Nov 26, 2024

I have build the latest ffmpeg on Ubuntu 22.04 LTS and get the following when trying to install video2x


sudo apt install ./video2x-linux-ubuntu2204-amd64.deb  # I also tried with -f flag
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'video2x' instead of './video2x-linux-ubuntu2204-amd64.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 ffmpeg : Depends: libavcodec59 (>= 7:5.0)
          Depends: libavfilter8 (>= 7:5.1)
          Depends: libavformat59 (>= 7:5.1)
 libavdevice59 : Depends: libavcodec59 (>= 7:5.0)
                 Depends: libavfilter8 (>= 7:5.1)
                 Depends: libavformat59 (= 7:5.1.6-0ubuntu1~22.04.sav1)
                 Depends: libsndio7 (>= 1.8.1) but it is not installable

E: Unable to correct problems, you have held broken packages.

I got the same error with the ffmpeg version in the ubuntu repo. Is there a way around this without building ffmpeg again?

ffmpeg version:

ffmpeg version N-117917-gac3f69a4b9 Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
configuration: 
libavutil      59. 47.101 / 59. 47.101
libavcodec     61. 26.100 / 61. 26.100
libavformat    61.  9.100 / 61.  9.100
libavdevice    61.  4.100 / 61.  4.100
libavfilter    10.  6.101 / 10.  6.101
libswscale      8. 12.100 /  8. 12.100
libswresample   5.  4.100 /  5.  4.100
@github-actions github-actions bot added the state:Backlog This issue will be worked on in the future label Nov 26, 2024
@k4yt3x
Copy link
Owner

k4yt3x commented Nov 26, 2024

You have Ubuntu 24.04 but downloaded the 22.04 deb package?

@codecowboy
Copy link
Author

No, sorry, that was a typo.

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 26, 2024

Oh right, for Ubuntu 22.04 you'll also need the Ubuntu Handbook PPA and install FFmpeg 7. The FFmpeg on Ubuntu 22 is just too old and won't work. Try this:

sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg7
sudo apt-get update
sudo apt-get install ffmpeg

Then install video2x again.

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 26, 2024

I admit it's not very well documented. I'll add more docs for it later. The 22.04 version is primarily built for use on Colab, and libplacbeo has some issues with the Ubuntu Handbook build (it can't find the libplacebo filter).

If your situation permits, I'd recommend using this on Ubuntu 24.04. The newer officially built FFmpeg has no problems at all.

@codecowboy
Copy link
Author

To be honest I provisioned an Ubuntu box with an Nvidia GPU to try and avoid issues I was having on macos with ML/AI workloads ( they are painfully slow in most cases and most projects provide mac instructions as an afterthought) and it has proven to be even more frustrating.

FYI a manual build of video2x on Ubuntu 22.04 as per https://docs.video2x.org/building/linux.html gives lots of g++ fatal errors which I'm guessing isn't good

My provider doesn't offer 24.04 so I think I'll try a container and then give up.

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 26, 2024

FYI a manual build of video2x on Ubuntu 22.04 as per https://docs.video2x.org/building/linux.html gives lots of g++ fatal errors which I'm guessing isn't good

I'm expecting make ubuntu2204 to work fine in a ubuntu:22.04 container at least.

For installing on Ubuntu 22.04 I think you're just missing the PPA. Remove video2x, install the PPA and the new FFmpeg, then you should be able to install video2x's 22.04 deb.

@codecowboy
Copy link
Author

I built ffmpeg from source so its recent. The video2x build eventually failed and didn't generate a deb file. I'm not confident a container would be any different.

gmake[3]: Leaving directory '/home/user/video2x/build'
[ 97%] Built target realesrgan
gmake[2]: Leaving directory '/home/user/video2x/build'
gmake[1]: *** [Makefile:136: all] Error 2
gmake[1]: Leaving directory '/home/user/video2x/build'
make: *** [Makefile:110: ubuntu2204] Error 2

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 26, 2024

I'd say don't try building it on Ubuntu anymore, try the FFmpeg from the PPA or just Docker. I'm pretty sure the Docker would at least work.

@codecowboy
Copy link
Author

Thanks. I'll give it a try tomorrow. Can you confirm that the Real-ERSGAN functionality works? I'm not planning on upscaling anime content and don't want to spend more time on it if it won't suit my needs( mostly live action old TV series) There is not much mention of it in the docs. Thanks for getting back to me today - its very much appreciated.

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 26, 2024

Yes RealESRGAN works when I test it on Colab which is Ubuntu 22.04. Just use the realesrgan-plus model. FYI upscaling real-life footage is a lot slower than animation.

@codecowboy
Copy link
Author

Thanks. Is it slower because of the nature of the footage or because it doesn't make use of the GPU? I'm surprised that one is allowed to install custom Ubuntu packages in Google Collab?!

@k4yt3x
Copy link
Owner

k4yt3x commented Nov 29, 2024

I believe the live footage model is slower because it's more complex than anime, so yeah the nature of the video. The quickest way you can check if you're using GPU is to run video2x --list-gpus to see if the GPU is recognized. If it is, you'll see something like:

0. NVIDIA RTX A6000
        Type: Discrete GPU
        Vulkan API Version: 1.3.289
        Driver Version: 565.228.64

If you see your GPU's name, your GPU is recognized and it's fine. If the only one showing up says LLVM, e.g., something like llvmpipe, then it's using the CPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:Backlog This issue will be worked on in the future
Projects
None yet
Development

No branches or pull requests

2 participants