Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

alex_free

macrumors 65816
Original poster
Feb 24, 2020
1,060
2,246
Finally, a media player almost on par with Mac OS X's performance for PPC OpenBSD. If you have a 1.42GHZ G4 or better this will work very well for up to 360p x264 MP4 files.

Make sure you have the OpenBSD 6.6 or 6.7 ports in /usr/ports, download the attached patches for either 6.6 or 6.7 and run

Code:
#Next 2 commands attempt to install dependencies as binaries for faster build.

pkg_add mplayer

pkg_delete ffmpeg mplayer

#6.6
patch /usr/ports/graphics/ffmpeg/Makefile obsd66_ffmpeg_altivec_makefile_patch.txt

patch /usr/ports/x11/mplayer/Makefile obsd66_mplayer_altivec_makefile_patch.txt


#6.7
patch /usr/ports/graphics/ffmpeg/Makefile obsd67_ffmpeg_altivec_makefile_patch.txt

patch /usr/ports/x11/mplayer/Makefile obsd67_mplayer_altivec_makefile_patch.txt

cd /usr/ports/graphics/ffmpeg


export FLAVOR=“altivec”
make install

cd /usr/ports/x11/mplayer

export FLAVOR=“altivec”
make install

When playing back a file, set the screen resolution to 640x480 (AltiVec optimized swscale is unscaled)

Code:
xrandr -s 640x480


then use these parameters in your command

Code:
mplayer -vo x11 -ao sndio -fs
To return the screen resolution (replace example 1360x768 with your resolution)

Code:
xrandr -s 1360x768

My Xorg.conf looks like this

Code:
Section "OutputClass"
Identifier "Radeon"
MatchDriver "radeon"
Driver "radeon"
EndSection

Section “Device”
Identifier “devname”
Driver “radeon”
Option “MigrationHeuristic” “greedy”
Option “ColorTiling” “on”
EndSection

Section “Monitor”
Identifier “Monitor0”
ModelName “TV”
EndSection

Section “Screen”
Identifier “Screen0”
Device “radeon”
Monitor “Monitor0”
SubSection “Display”
ViewPort 0 0
Modes “1360x768”
EndSubSection
EndSection

My sysctl.conf looks like this

Code:
machdep.allowaperture=2
 

Attachments

  • obsd66_ffmpeg_altivec_makefile_patch.txt
    194 bytes · Views: 131
  • obsd66_mplayer_altivec_makefile_patch.txt
    190 bytes · Views: 105
  • obsd67_ffmpeg_altivec_makefile_patch.txt
    267 bytes · Views: 111
  • obsd67_mplayer_altivec_makefile_patch.txt
    333 bytes · Views: 122
Last edited:

wicknix

macrumors 68030
Jun 4, 2017
2,616
5,296
Wisconsin, USA
Only up to 360p? Is openbsd really that bad for gfx drivers / video playback? My 1.5ghz mini g4 can do 720p mp4 via mplayer in Linux without breaking a sweat.
[automerge]1590102028[/automerge]
As seen here:
 

alex_free

macrumors 65816
Original poster
Feb 24, 2020
1,060
2,246
Only up to 360p? Is openbsd really that bad for gfx drivers / video playback? My 1.5ghz mini g4 can do 720p mp4 via mplayer in Linux without breaking a sweat.
[automerge]1590102028[/automerge]
As seen here:

My mini has half the VRAM as yours but I doubt it matters especially for X11 vo which is all software rendering and AltiVec optimizations anyways .


I’m happy with the performance, QuickTime 7 only does up to 480p x264 in OS X anyways so 360p x264 in OpenBSD is fine to me.
 
Last edited:
  • Like
Reactions: wicknix

alex_free

macrumors 65816
Original poster
Feb 24, 2020
1,060
2,246
6.7 patches now available, and have been submitted to the OBSD FFmpeg maintainer. Hopefully they will be included in ports by default.
 
  • Like
Reactions: Amethyst1 and z970

Lastic

macrumors 6502a
Mar 19, 2016
879
757
North of the HellHole
My 12" iBook G4 1.07Ghz has been compiling for a full 24h now on building ffmpeg , it is spending a lot of time compiling gcc-8.3 ,as a prerequisite I presume ?

@alex_free how long did the compiling take on your machine ?
 

2984839

Cancelled
Apr 19, 2014
2,114
2,241
My 12" iBook G4 1.07Ghz has been compiling for a full 24h now on building ffmpeg , it is spending a lot of time compiling gcc-8.3 ,as a prerequisite I presume ?

@alex_free how long did the compiling take on your machine ?

Why not install gcc-8.3 from packages rather than compiling it?
 
  • Like
Reactions: alex_free

Lastic

macrumors 6502a
Mar 19, 2016
879
757
North of the HellHole
Why not install gcc-8.3 from packages rather than compiling it?

Yes that is the obvious way to go but it was the port install of ffmpeg who decided to install gcc-8.3 from ports.
So I cancelled my almost 2 days compile of gcc-8.3 and did a pkg_add of it.

Then first did a make clean under graphics/ffmpeg , started the make install again from the ffmpeg port and looked like it started again with gcc.
as such went into /lang/gcc and did a make clean there and now we're back to square one.
ffmpeg port just starts building gcc again ???

How can I check the dependencies of a port ?
 

2984839

Cancelled
Apr 19, 2014
2,114
2,241
Yes that is the obvious way to go but it was the port install of ffmpeg who decided to install gcc-8.3 from ports.
So I cancelled my almost 2 days compile of gcc-8.3 and did a pkg_add of it.

Then first did a make clean under graphics/ffmpeg , started the make install again from the ffmpeg port and looked like it started again with gcc.
as such went into /lang/gcc and did a make clean there and now we're back to square one.
ffmpeg port just starts building gcc again ???

How can I check the dependencies of a port ?

Try this:
Code:
$ pkg_info -f package_name | grep depend

Then you can just pkg_add your way through that list to get most of the work out of the way.

You can also check the package Makefile's BUILD_DEPENDS variable for the build dependencies and pkg_add those if possible.

edit: In this case, I would just pkg_add the package you're trying to build. This will pull in all of its dependencies, and its dependencies' dependencies automagically. Next, pkg_delete it. It will leave the dependencies installed and just get rid of that specific package. Now just build your custom port.
 
Last edited:

alex_free

macrumors 65816
Original poster
Feb 24, 2020
1,060
2,246
Try this:
Code:
$ pkg_info -f package_name | grep depend

Then you can just pkg_add your way through that list to get most of the work out of the way.

You can also check the package Makefile's BUILD_DEPENDS variable for the build dependencies and pkg_add those if possible.

edit: In this case, I would just pkg_add the package you're trying to build. This will pull in all of its dependencies, and its dependencies' dependencies automagically. Next, pkg_delete it. It will leave the dependencies installed and just get rid of that specific package. Now just build your custom port.

Could not of said this better, as I do the same. The compile time dependencies won’t be added of course but most will. You can always abort big programs and install their compiled equivalents as well, although this isn’t very elegant.
 

Lastic

macrumors 6502a
Mar 19, 2016
879
757
North of the HellHole
I guess gcc is a subdependency of the dependencies


snowwhite$ doas pkg_info -f ffmpeg | grep depend
@depend archivers/bzip2:bzip2-*:bzip2-1.0.8
@depend archivers/xz:xz-*:xz-5.2.4
@depend audio/gsm:gsm-*:gsm-1.0.18
@depend audio/lame:lame-*:lame-3.100p1
@depend audio/libvorbis:libvorbis-*:libvorbis-1.3.6
@depend audio/opus:eek:pus-*:eek:pus-1.3.1
@depend audio/speex:speex-*:speex-1.2.0
@depend converters/libiconv:libiconv-*:libiconv-1.16p0
@depend devel/sdl2:sdl2-*:sdl2-2.0.10
@depend multimedia/aom:aom-*:aom-1.0.0.20190901
@depend multimedia/dav1d:dav1d-*:dav1d-0.4.0
@depend multimedia/libass:libass-*:libass-0.14.0p0
@depend multimedia/libtheora:libtheora-*:libtheora-1.2.20190601p0
@depend multimedia/libv4l:libv4l-*:libv4l-1.16.7
@depend multimedia/libvpx:libvpx-*:libvpx-1.8.1v0
@depend multimedia/x264:x264-*:x264-20190720p0
@depend multimedia/x265:x265-*:x265-3.2
@depend multimedia/xvidcore:xvidcore-*:xvidcore-1.3.5p0
@depend textproc/libxml,-main:libxml-*:libxml-2.9.9

Will pkg_add these and see how it goes, thanks for the insights.
Have a nice day , off to work now
 

Lastic

macrumors 6502a
Mar 19, 2016
879
757
North of the HellHole
Weird stuff altough gcc was already installed (and this wasn't listed as an dependecy of ffmpeg)
I found the culprit , frei0r-plugins kept reinstalling gcc.

Once I pkg_added frei0r-plugins, all dependencies have been fullfilled and now ffmpeg is compiling.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.