[Bug 282188] New port: multimedia/ffmpeg3 (legacy ffmpeg as a dependency for emulators/ppsspp)

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 26 Oct 2024 20:27:38 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282188

--- Comment #4 from Kevin Reinholz <kreinholz@gmail.com> ---
Daniel,

Thanks for your comments! I share many of your concerns, which is why I debated
submitting a proposed new (old) port in the first place. For the past 5-6
months I've been building/rebuilding my local ffmpeg-3.0.2 port and slightly
modified emulators/ppsspp port with synth, and have been quite pleased with the
results. It makes ppsspp usable again, without the need to skip in-game FMVs or
cross my fingers there won't be a crash.

I observed frequent crashes with ppsspp-1.17.1 (and previous versions) when
built against default ffmpeg (6.x)--typically near the end of an in-game FMV.
It's not that the video wouldn't play--it's that a bad packet, missing header,
or some other deviation between the PSP's video API and ffmpeg's would
eventually get reached, and freeze the video/crash ppsspp. This behavior is not
present when ppsspp is built against ffmpeg-3.0.2, the version recommended by
the ppsspp devs.

From what I can tell, "bundled" ffmpeg used in the Mac, Linux, and Windows
builds of ppsspp is just ffmpeg-3.0.2 with a lot of options turned off:

https://github.com/hrydgard/ppsspp-ffmpeg/blob/master/shared_options.sh

I had assumed x264 was needed for mp4 playback, but will try building ffmpeg
with it disabled. A cursory look at the ffmpeg sources led me to (perhaps
wrongly) conclude that libavcodec could take advantage of gpu acceleration,
which is why I kept VAAPI and VDPAU enabled. It shouldn't be a problem to
disable both of those options.

I'd debated between a quick-and-dirty hack to the existing ppsspp port to build
against ffmpeg-3.0.2 shared libs, and hacking the ppsspp port more extensively
to build ffmpeg-3.0.2 static libs and "bundle" them with ppsspp. The following
discussion from 2022 made me wary of trying to bundle:

https://github.com/hrydgard/ppsspp/issues/15969

jbeich pointed out issues with attempting to build ppsspp with bundled-ffmpeg
here:

https://github.com/hrydgard/ppsspp/issues/15308#issuecomment-1529076719

It seems the ppsspp devs have not been successful in incorporating their forked
ffmpeg-3.0.2 sources into the ppsspp build process, but instead build
ffmpeg-3.0.2 separately, dump the libs and header files into a folder, and then
point ppsspp to the precompiled libs as part of their packing build process.
There's no release tarball for their bundled-ffmpeg, either, making it easier
to just grab the official ffmpeg-3.0.2 and build that.

That said, I'm very open to exploring the best way to do this. For starters,
I'll try disabling ASM, VAAPI, VDPAU, and X264, and confirm whether ppsspp
in-game FMV playback still works.

-- 
You are receiving this mail because:
You are the assignee for the bug.