problem with installing ffmpeg with --enable-libxcb in termux
hello, is there any way to enable libxcb when installing ffmpeg on termux?
i can't seem to directly enable this when installing ffmpeg in termux (
pkg i ffmpeg
), so i resort to rebuilding it from the git repo. but for some reason Error: libxcb is requested, but not found
even though checking on the installed packages, there is libxcb!!!
so i am currently stuck, if anyone have any fixes or ways for this i would appreciate it. thanks!48 Replies
There are some sources stating that --enable-libxcb set as true by default when installing ffmpeg
even just plain
make
doesn't workIf you're trying to build
ffmpeg
on-device you're gonna have a bad time.
It's a very complex package with a lot of compile time dependencies.
Looks like we're not currently building ffmpeg
with --enable-libxcb
.
We do have a libxb
package, so let me make a pull request to enable it on our FFMPEG package.
It looks like libxcb
is only used by the x11grab input device type.
Which seems to do a "direct" capture of the specified X11 display.
Should probably work if enabled.
I'll report back when the PR is open.indeed
i am using ffmpeg as a "direct" capture in an x11 desktop environment. some might suggest to just use the android's build-in recorder, but its far convenient to just record it directly (and how usually i don't have access to keyboard or mouse peripherals, so it will look janky).
i have a prior script that records the x11 using ffmpeg on my proot, it works really great! but i since moved to use termux directly instead of proot, and using the provided
recordmydesktop
package available in termux doesn't seem to be as smooth as ffmpeg
thanks for the help, and I'll be waiting for the new update/fix to thisThe build script could use a little cleanup while I'm here...
Give me like 15 minutes to do some build tests.
GitHub
Ffmpeg enable
libxcb
support. by TomJo2000 · Pull Request #22738 ...This was requested by user qlufotera in Discord.
https://discord.com/channels/641256914684084234/1324260321371885608/1324260321371885608
libxcb is used by the x11grab input device type, used to dir...
Yep that worked.
Haven't tested the actual input type.
If you'd like to test the package before it is merged I have left instructions in the PR.
Awesome
unfortunately as i test it... uhh...
What was the command you used for testing?
oh yeah.
apologies, but i forgot ffmpeg also has pulseaudio option for capturing the audio
here you go
Please be aware that your local copy of the FFMPEG source repo is not going to reflect the flags we use for building the package.
But yeah PulseAudio is also not currently enabled on our FFMPEG package, and would likely require additional patching to work properly.
It's worth a try though.
What does
echo $DISPLAY
return?:1
still
even switching it to target :1
doesn't seem to workSame error?
spits out the same error...
Oh I think I see the problem.
The input format is called
x11grab
not xcbgrab
oh yeah
i got this script with the help of the internet and tweak it a bit (lol)
i used this script on proot, yes it did work great and functional. after moving it to termux, i searched the problem related to that on the internet
apparently
x11grab
is deprecated on newer ffmpeg versionsNot surprising.
is there anything yet that i might've missed?
-c:v h264_v4l2m2m
doesn't seem to exist from what I can tell.ahh
perhaps i should change my script a bit
Using a video codec that exists wouldn't be a bad start.
V4L2 would likely be a non-starter on Termux regardless as Android doesn't usually ship the Video for Linux v2 kernel module.
Alright
used
libx264
sadly... same error
😞I'm no FFMPEG wizard unfortunately.
i understand
but it still questions me how it's not recognized here...
Here's the example from the FFMPEG documentation.
Does that do anything?
Alright ill try
Oof same error
Unknown input format
What's
ffmpeg -devices
spit out?Did you have to cut off the rest or is that all?
Thats all
That's a whole lot of not much.
oh...
Here's what I get on my PC's version of FFMPEG.
Hmm
so what can i do to resolve this?
I'm gonna guess nothing.
This is gonna need further troubleshooting by the looks of it.
How about your own mobile device? (Termux)
Since you explicitly said your PC one?
Only getting
lavfi
on my phone.Huh
so is it the package's problem?
I'm guessing it's an Android limitation.
All of these except
lavfi
(which is a "virtual" input device) use system devices located in /dev
.
Which, we don't get access to on Android.Bummer
interesting how it works on proot though
any reasons why?
https://media.discordapp.net/attachments/414372897109573643/1324005868236181544/recording_2025-01-01_20-19-53.mp4?ex=6776940d&is=6775428d&hm=0b5b63f0a276fcc30b3440d4bafa7b08155596df3cd1de8e68087ff0c3d29181&
Proot fakes some devices and system calls.
Ah
so it doesnt really get the system devices. Just makes one
No wonder to get audio working you need to do it outside proot
It doesn't make one, it "fakes" one.
e.g. it provides a shim
-# https://en.wikipedia.org/wiki/Shim_(computing)
Shim (computing)
In computer programming, a shim is a library that transparently intercepts API calls and changes the arguments passed, handles the operation itself or redirects the operation elsewhere. Shims can be used to support an old API in a newer environment, or a new API in an older environment. Shims can also be used for running programs on different so...
Is it possible to "fake" some in termux/replicate what proot did to some devices?
I don't think so.
Are there any future solutions (based on the new comment on the PR), or this is it?
I'm not sure, and patching
libavdevice
would be out of my range of expertise.