Bug 270569 - multimedia/mplayer: Various runtime errors with ffmpeg 6
Summary: multimedia/mplayer: Various runtime errors with ffmpeg 6
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks: 261302
  Show dependency treegraph
 
Reported: 2023-03-31 20:49 UTC by George Mitchell
Modified: 2023-05-01 15:57 UTC (History)
1 user (show)

See Also:
riggs: maintainer-feedback+


Attachments
Build log from making mplayer (58.86 KB, application/binary)
2023-04-01 18:17 UTC, George Mitchell
no flags Details
Failed patch to enable vorbis support (609 bytes, text/plain)
2023-04-12 20:37 UTC, George Mitchell
no flags Details
Patch for mplayer (6.73 KB, patch)
2023-05-01 06:38 UTC, Daniel Engberg
no flags Details | Diff
Patch for mplayer v2 (6.08 KB, patch)
2023-05-01 07:58 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description George Mitchell 2023-03-31 20:49:30 UTC
The recent upgrade from 1.5.0.20220924 to 1.5.0.20230321 has introduced a number of spurious error messages.  The most common is:

Too many video packets in the buffer: (3618 in 33559926 bytes).
Maybe badly- or non-interleaved stream/file or the codec failed?
Fix the file or try the -ni option (can cause high memory usage).

Also, mplayer cannot play the audio portion of the file.  Trying the "-ni" option causes it to get stuck for about a minute at the very beginning after saying "Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders".

Also occasionally "Timing looks severely broken, resetting".  Before the upgrade, these files played without error.  Also, vlc plays the files correctly.
Comment 1 Thomas Zander freebsd_committer freebsd_triage 2023-04-01 12:34:08 UTC
It is very unlikely that this is a problem caused by mplayer, as the functional changes between the two snapshots are tiny. (I'm not saying it's impossible, but my first guess is it's somewhere else.)

Do you use the official FreeBSD package, or do you build mplayer yourself? If the latter, can you provide a poudriere log?

On which arch are you? amd64?

Do you output audio via SPDIF (because that's really the only non-trivial change between the two mplayer versions)? Specifically, do the "broken" files contain DTS audio?
Comment 2 George Mitchell 2023-04-01 18:17:01 UTC
Created attachment 241251 [details]
Build log from making mplayer

I build my packages locally.  I use portmaster.  I'm attaching an xz-compressed script from my build.  I use FreeBSD 13.1-RELEASE-p7 on an amd64.  I have a 63MB video file (clearly too large to attach here, but I can make it available to you) which exhibits the problems.
Comment 3 George Mitchell 2023-04-01 18:23:02 UTC
When playing my test file, in my terminal window, the audio time goes up for about fifteen seconds while the video time stays stuck at 0.8.  Then video time finally starts going until it almost catches up, then it gets stuck again.  Audio time continues running smoothly, but I also get a warning about "Too many video packets in the buffer" and I get the suggestion to use the "-ni" option.
Comment 4 George Mitchell 2023-04-01 19:33:41 UTC
And although my machine has an S/PDIF interface, I don't use it to play audio.
Comment 5 George Mitchell 2023-04-01 22:33:38 UTC
I guess I should mention my compile options:

# This file is auto-generated by 'make config'.
# Options for mplayer-1.5.0.20220924
_OPTIONS_READ=mplayer-1.5.0.20220924
_FILE_COMPLETE_OPTIONS_LIST=AALIB AMR_NB AMR_WB ASS BLURAY CACA CDIO DV DVDNAV ENCA FONTCONFIG FRIBIDI GIF GNUTLS GSM GUI IPV6 JACK JPEG LADSPA LIBMNG LIRC LZO NAS NLS OPENAL OPENGL OPENJPEG OPUS PULSEAUDIO RTCPU RTMP SDL SKINS SMB SNDIO SPEEX SVGALIB V4L VDPAU VPX X11 X11DGA X11VM XINERAMA XVIDEO XVMC
OPTIONS_FILE_UNSET+=AALIB
OPTIONS_FILE_UNSET+=AMR_NB
OPTIONS_FILE_UNSET+=AMR_WB
OPTIONS_FILE_SET+=ASS
OPTIONS_FILE_UNSET+=BLURAY
OPTIONS_FILE_UNSET+=CACA
OPTIONS_FILE_UNSET+=CDIO
OPTIONS_FILE_SET+=DV
OPTIONS_FILE_SET+=DVDNAV
OPTIONS_FILE_UNSET+=ENCA
OPTIONS_FILE_SET+=FONTCONFIG
OPTIONS_FILE_UNSET+=FRIBIDI
OPTIONS_FILE_UNSET+=GIF
OPTIONS_FILE_UNSET+=GNUTLS
OPTIONS_FILE_UNSET+=GSM
OPTIONS_FILE_SET+=GUI
OPTIONS_FILE_SET+=IPV6
OPTIONS_FILE_UNSET+=JACK
OPTIONS_FILE_SET+=JPEG
OPTIONS_FILE_UNSET+=LADSPA
OPTIONS_FILE_UNSET+=LIBMNG
OPTIONS_FILE_UNSET+=LIRC
OPTIONS_FILE_UNSET+=LZO
OPTIONS_FILE_UNSET+=NAS
OPTIONS_FILE_SET+=NLS
OPTIONS_FILE_UNSET+=OPENAL
OPTIONS_FILE_UNSET+=OPENGL
OPTIONS_FILE_UNSET+=OPENJPEG
OPTIONS_FILE_UNSET+=OPUS
OPTIONS_FILE_UNSET+=PULSEAUDIO
OPTIONS_FILE_SET+=RTCPU
OPTIONS_FILE_UNSET+=RTMP
OPTIONS_FILE_UNSET+=SDL
OPTIONS_FILE_UNSET+=SKINS
OPTIONS_FILE_UNSET+=SMB
OPTIONS_FILE_UNSET+=SNDIO
OPTIONS_FILE_SET+=SPEEX
OPTIONS_FILE_UNSET+=SVGALIB
OPTIONS_FILE_UNSET+=V4L
OPTIONS_FILE_UNSET+=VDPAU
OPTIONS_FILE_SET+=VPX
OPTIONS_FILE_SET+=X11
OPTIONS_FILE_SET+=X11DGA
OPTIONS_FILE_SET+=X11VM
OPTIONS_FILE_SET+=XINERAMA
OPTIONS_FILE_SET+=XVIDEO
OPTIONS_FILE_UNSET+=XVMC
Comment 6 George Mitchell 2023-04-02 17:30:45 UTC
More information from "ldd /usr/local/bin/mplayer":
/usr/local/bin/mplayer:
	libncursesw.so.9 => /lib/libncursesw.so.9 (0x801370000)
	libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x8013e3000)
	libz.so.6 => /lib/libz.so.6 (0x801422000)
	libjpeg.so.8 => /usr/local/lib/libjpeg.so.8 (0x80143f000)
	libdvdread.so.8 => /usr/local/lib/libdvdread.so.8 (0x8014e7000)
	libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x801509000)
	libfontconfig.so.1 => /usr/local/lib/libfontconfig.so.1 (0x8015cd000)
	libass.so.9 => /usr/local/lib/libass.so.9 (0x80161b000)
	libbz2.so.4 => /usr/lib/libbz2.so.4 (0x801659000)
	libspeex.so.1 => /usr/local/lib/libspeex.so.1 (0x80166f000)
	libswscale.so.7 => /usr/local/lib/libswscale.so.7 (0x801696000)
	libswresample.so.4 => /usr/local/lib/libswresample.so.4 (0x80176f000)
	libavformat.so.60 => /usr/local/lib/libavformat.so.60 (0x801792000)
	libavcodec.so.60 => /usr/local/lib/libavcodec.so.60 (0x801a00000)
	libavutil.so.58 => /usr/local/lib/libavutil.so.58 (0x802d87000)
	libpostproc.so.57 => /usr/local/lib/libpostproc.so.57 (0x802f60000)
	libdv.so.4 => /usr/local/lib/libdv.so.4 (0x802f73000)
	libthr.so.3 => /lib/libthr.so.3 (0x802faa000)
	libdvdnav.so.4 => /usr/local/lib/libdvdnav.so.4 (0x802fd8000)
	libm.so.5 => /lib/libm.so.5 (0x802ff2000)
	libXext.so.6 => /usr/local/lib/libXext.so.6 (0x80302d000)
	libX11.so.6 => /usr/local/lib/libX11.so.6 (0x803042000)
	libXss.so.1 => /usr/local/lib/libXss.so.1 (0x8019f5000)
	libXv.so.1 => /usr/local/lib/libXv.so.1 (0x80318d000)
	libXinerama.so.1 => /usr/local/lib/libXinerama.so.1 (0x8019fb000)
	libXxf86vm.so.1 => /usr/local/lib/libXxf86vm.so.1 (0x803195000)
	libXxf86dga.so.1 => /usr/local/lib/libXxf86dga.so.1 (0x80319d000)
	libgtk-x11-2.0.so.0 => /usr/local/lib/libgtk-x11-2.0.so.0 (0x8031a6000)
	libgdk-x11-2.0.so.0 => /usr/local/lib/libgdk-x11-2.0.so.0 (0x803610000)
	libpangocairo-1.0.so.0 => /usr/local/lib/libpangocairo-1.0.so.0 (0x8036d1000)
	libatk-1.0.so.0 => /usr/local/lib/libatk-1.0.so.0 (0x8036e2000)
	libcairo.so.2 => /usr/local/lib/libcairo.so.2 (0x803711000)
	libgdk_pixbuf-2.0.so.0 => /usr/local/lib/libgdk_pixbuf-2.0.so.0 (0x80384a000)
	libgio-2.0.so.0 => /usr/local/lib/libgio-2.0.so.0 (0x803871000)
	libpangoft2-1.0.so.0 => /usr/local/lib/libpangoft2-1.0.so.0 (0x803a57000)
	libpango-1.0.so.0 => /usr/local/lib/libpango-1.0.so.0 (0x803a72000)
	libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0 (0x803ae4000)
	libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x803b44000)
	libintl.so.8 => /usr/local/lib/libintl.so.8 (0x803c8d000)
	libharfbuzz.so.0 => /usr/local/lib/libharfbuzz.so.0 (0x803c9b000)
	libc.so.7 => /lib/libc.so.7 (0x803daf000)
	libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0x8041b9000)
	libfribidi.so.0 => /usr/local/lib/libfribidi.so.0 (0x8041e9000)
	libunibreak.so.5 => /usr/local/lib/libunibreak.so.5 (0x80420a000)
	libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x80422f000)
	libssl.so.111 => /usr/lib/libssl.so.111 (0x8042b5000)
	libcrypto.so.111 => /lib/libcrypto.so.111 (0x80434d000)
	libvpx.so.8 => /usr/local/lib/libvpx.so.8 (0x804642000)
	liblcms2.so.2 => /usr/local/lib/liblcms2.so.2 (0x804957000)
	liblzma.so.5 => /usr/lib/liblzma.so.5 (0x8049c3000)
	libaom.so.3 => /usr/local/lib/libaom.so.3 (0x8049ef000)
	libjxl.so.0.8 => /usr/local/lib/libjxl.so.0.8 (0x8051ce000)
	libjxl_threads.so.0.8 => /usr/local/lib/libjxl_threads.so.0.8 (0x80560b000)
	libmp3lame.so.0 => /usr/local/lib/libmp3lame.so.0 (0x805612000)
	libopus.so.0 => /usr/local/lib/libopus.so.0 (0x805697000)
	libtheoraenc.so.1 => /usr/local/lib/libtheoraenc.so.1 (0x80570b000)
	libtheoradec.so.1 => /usr/local/lib/libtheoradec.so.1 (0x805740000)
	libvorbis.so.0 => /usr/local/lib/libvorbis.so.0 (0x805755000)
	libvorbisenc.so.2 => /usr/local/lib/libvorbisenc.so.2 (0x80578c000)
	libx264.so.164 => /usr/local/lib/libx264.so.164 (0x805833000)
	libx265.so.192 => /usr/local/lib/libx265.so.192 (0x805b22000)
	libxvidcore.so.4 => /usr/local/lib/libxvidcore.so.4 (0x806083000)
	libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x8061ac000)
	libXrender.so.1 => /usr/local/lib/libXrender.so.1 (0x8061d9000)
	libXi.so.6 => /usr/local/lib/libXi.so.6 (0x8061e5000)
	libXrandr.so.2 => /usr/local/lib/libXrandr.so.2 (0x8061f7000)
	libXcursor.so.1 => /usr/local/lib/libXcursor.so.1 (0x806204000)
	libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0 (0x806212000)
	libXcomposite.so.1 => /usr/local/lib/libXcomposite.so.1 (0x806218000)
	libXdamage.so.1 => /usr/local/lib/libXdamage.so.1 (0x80621d000)
	libXfixes.so.3 => /usr/local/lib/libXfixes.so.3 (0x806222000)
	libpixman-1.so.0 => /usr/local/lib/libpixman-1.so.0 (0x80624b000)
	libEGL.so.1 => /usr/local/lib/libEGL.so.1 (0x80631c000)
	libdl.so.1 => /usr/lib/libdl.so.1 (0x806334000)
	libxcb-shm.so.0 => /usr/local/lib/libxcb-shm.so.0 (0x806338000)
	libxcb-render.so.0 => /usr/local/lib/libxcb-render.so.0 (0x80633e000)
	libGL.so.1 => /usr/local/lib/libGL.so.1 (0x80634f000)
	libthai.so.0 => /usr/local/lib/libthai.so.0 (0x8063db000)
	libffi.so.8 => /usr/local/lib/libffi.so.8 (0x8063e8000)
	libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x8063f3000)
	libpcre2-8.so.0 => /usr/local/lib/libpcre2-8.so.0 (0x806500000)
	libutil.so.9 => /lib/libutil.so.9 (0x8065b2000)
	libgraphite2.so.3 => /usr/local/lib/libgraphite2.so.3 (0x8065ca000)
	libc++.so.1 => /usr/lib/libc++.so.1 (0x8065f6000)
	libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x8066cd000)
	libmd.so.6 => /lib/libmd.so.6 (0x8066ef000)
	libhwy.so.1 => /usr/local/lib/libhwy.so.1 (0x80670d000)
	libbrotlidec.so.1 => /usr/local/lib/libbrotlidec.so.1 (0x806717000)
	libbrotlienc.so.1 => /usr/local/lib/libbrotlienc.so.1 (0x806726000)
	libogg.so.0 => /usr/local/lib/libogg.so.0 (0x8067c9000)
	librt.so.1 => /usr/lib/librt.so.1 (0x8067d4000)
	libXau.so.6 => /usr/local/lib/libXau.so.6 (0x8067dd000)
	libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x8067e3000)
	libGLdispatch.so.0 => /usr/local/lib/libGLdispatch.so.0 (0x8067eb000)
	libGLX.so.0 => /usr/local/lib/libGLX.so.0 (0x8068a4000)
	libdatrie.so.1 => /usr/local/lib/libdatrie.so.1 (0x8068d9000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x8068e3000)
	libbrotlicommon.so.1 => /usr/local/lib/libbrotlicommon.so.1 (0x8068fd000)
Comment 7 George Mitchell 2023-04-03 14:53:58 UTC
Here is a recipe for creating a file that demonstrates the audio failure, at least.

Pick any good existing file in .vob, .avi, or .mkv format.  (Those are the only types I have on hand and have tested.)

Using ffmpeg 6 (though probably an earlier ffmpeg would do), type:

ffmpeg -i (your file) -ss 0:30 -t 0:30 test.mkv

Running mplayer on test.mkv will produce no audio.  But vlc plays test.mkv  just fine, with audio.  I suppose this could mean ffmpeg has a bug, but I doubt it.

I get the "Possibly bad interleaving detected" error much less often, and only when directly playing a .VOB directly from a DVD (but only certain DVDs and certain .VOBs.)
Comment 8 George Mitchell 2023-04-12 19:35:35 UTC
Here is my explanation of the audio problem: the latest mplayer can't play vorbis audio.  There is no explicit VORBIS option in our Makefile, but mplayer's configure script appears to test for the presence of ivorbiscodec.h and before checking for vorbisenc.h.  My system definitely has vorbisenc.h and libvorbis.so, but not ivorbiscodec.h, so the script erroneously concludes that mplayer shouldn't support vorbis audio.  Reading the configure script (around line 6879) leaves me at a loss as to why the failure of the "tremor" test causes the "vorbis" test to be skipped.  Any ideas?

I still don't understand the complaints about bad interleaving, but that doesn't seem to count as a fatal error.
Comment 9 George Mitchell 2023-04-12 20:37:50 UTC
Created attachment 241447 [details]
Failed patch to enable vorbis support

Here is my failing patch to hackishly add vorbis support.  I don't understand why this patch fails, since the resulting build indeed links to libogg and libvorbis as confirmed by ldd.
Comment 10 George Mitchell 2023-04-18 00:22:30 UTC
Updating summary to clarify the problem.
Comment 11 George Mitchell 2023-04-20 02:09:38 UTC
Updating the summary again to clarify that this is an issue after the recent upgrade.
Comment 12 Thomas Zander freebsd_committer freebsd_triage 2023-04-23 09:17:08 UTC
There may be a number of things going wrong, and we need to figure then out.
But I don't agree with our assessment.

Currently, the mplayer port is set up not to use libvorbis itself but use ffmpeg for decoding vorbis. It does so without problems, provided you use the ports tree as is and portmaster didn't screw up your build (which it *always* does, because it can't provide a clean build environment, which is why people should use poudriere).
You said you are using ffmpeg 6, which neither I nor the ports tree do (yet). Maybe the problem lies herein, and mplayer needs some update to resolve them.

The VOB files playback problem should be unrelated to the playback issues. VOBs should not contain vorbis tracks, as the DVD standard does not specify vorbis as a supported audio codec.
Comment 13 George Mitchell 2023-04-23 20:53:22 UTC
It's true, the ports tree is not yet up to ffmpeg 6.  And that was preventing me from compiling qt5-webengine, which is part of what I needed for another project.  But reverting to the previous ffmpeg definitely fixes the vorbis problem and secondarily seems to fix the "too many video packets" and alleged interleaving problems as well.

However, ffmpeg 6is on its way (bug #261302), and I will add this bug as a dependency for bug #261302.
Comment 14 George Mitchell 2023-04-23 22:14:56 UTC
Correcting summary of bug.
Comment 15 George Mitchell 2023-04-27 20:45:03 UTC
(In reply to Thomas Zander from comment #12)
After https://cgit.freebsd.org/ports/commit/?id=e7f276b2099aee34cbb73dc1dcbd099196b8f3b2, the ports tree is now using ffmpeg 6.
Comment 16 George Mitchell 2023-04-28 18:01:00 UTC
And today multimedia/ffmpeg4 has been added to the ports tree.  Can mplayer be updated to use ffmpeg4 if present, avoiding this problem?  (I assume it would require a dependency update to the Makefile as well as a change in the code.)
Comment 17 Thomas Zander freebsd_committer freebsd_triage 2023-04-30 10:07:24 UTC
(In reply to George Mitchell from comment #16)

I'll look into it!
Comment 18 George Mitchell 2023-04-30 15:46:24 UTC
(In reply to Thomas Zander from comment #17)
Thanks!
Comment 19 Thomas Zander freebsd_committer freebsd_triage 2023-04-30 17:42:21 UTC
I did find a couple of more problems with other codec types. This is definitely not codec specific. Until we have more clarity, we'll continue to use ffmpeg4.
Comment 20 commit-hook freebsd_committer freebsd_triage 2023-04-30 17:42:52 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2df216b41d143e27e251b8d4447586a82e7554a5

commit 2df216b41d143e27e251b8d4447586a82e7554a5
Author:     Thomas Zander <riggs@FreeBSD.org>
AuthorDate: 2023-04-30 14:15:20 +0000
Commit:     Thomas Zander <riggs@FreeBSD.org>
CommitDate: 2023-04-30 17:42:38 +0000

    multimedia/{mplayer|mencoder} Use ffmpeg4 instead of ffmpeg6

    Details: Hopefully temporary workaround to fix a whole bunch of decoding
    problems with various ffmpeg codecs.
    PR:             270569

 multimedia/mencoder/Makefile            | 2 +-
 multimedia/mplayer/Makefile             | 2 +-
 multimedia/mplayer/Makefile.common      | 7 +++++--
 multimedia/mplayer/files/patch-Makefile | 2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)
Comment 21 George Mitchell 2023-04-30 20:20:25 UTC
(In reply to Thomas Zander from comment #19)
Thanks for this commit.  But it doesn't quite work right.  I have both ffmpeg and ffmpeg4 installed on my system, which means that both of these are installed:
/usr/local/ffmpeg4/lib/libavcodec.so.58.134.100 (from ffmpeg4)
/usr/local/lib/libavcodec.so.60.3.100 (from ffmpeg)
I don't know the right way for mplayer to specify it wants the one from ffmpeg4, and consequently it still links to the wrong lib.

Anyway, I'm sorry I did not provide a better summary which I first filed this bug.
Comment 22 Daniel Engberg freebsd_committer freebsd_triage 2023-05-01 06:38:45 UTC
Created attachment 241894 [details]
Patch for mplayer

Find FFmpeg 4 in dirty env
Comment 23 Daniel Engberg freebsd_committer freebsd_triage 2023-05-01 06:39:30 UTC
George can you try to apply my patch on top? This fixing the linking issue on my box at least
Comment 24 Daniel Engberg freebsd_committer freebsd_triage 2023-05-01 07:58:08 UTC
Created attachment 241897 [details]
Patch for mplayer v2

Make Poudriere happy
Comment 25 Thomas Zander freebsd_committer freebsd_triage 2023-05-01 09:37:16 UTC
(In reply to Daniel Engberg from comment #24)

Yep, this one looks good. Committing it now.
Comment 26 commit-hook freebsd_committer freebsd_triage 2023-05-01 09:40:53 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e96c71a078c8227bc09ca6d2e53bac79f04b6520

commit e96c71a078c8227bc09ca6d2e53bac79f04b6520
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-05-01 09:34:57 +0000
Commit:     Thomas Zander <riggs@FreeBSD.org>
CommitDate: 2023-05-01 09:38:22 +0000

    multimedia/{mplayer|mencoder}: Fix ffmpeg4 linking if ffmpeg6 present

    PR:             270569
    Reported by:    george@m5p.com
    Reviewed by:    riggs

 multimedia/mplayer/files/patch-configure | 50 +++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 20 deletions(-)
Comment 27 Daniel Engberg freebsd_committer freebsd_triage 2023-05-01 09:57:58 UTC
The reason I added CFLAGS is because of this:

cc -MMD -MP -D_ISOC99_SOURCE -I. -Iffmpeg -O2 -pipe -march=tigerlake -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -fno-asynchronous-unwind-tables -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/include -I/usr/local/include -DLIBICONV_PLUG -fpie -DPIC -I/usr/local/include -I/usr/local/include/p11-kit-1 -I/usr/local/include -I/usr/local/include -I/usr/local/include/dvdcss -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include -DZLIB_CONST -I/usr/local/ffmpeg4/include -I/usr/local/ffmpeg4/include -I/usr/local/include/gtk-2.0 -I/usr/local/include/pango-1.0 -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -D_THREAD_SAFE -D_THREAD_SAFE -D_THREAD_SAFE -D_THREAD_SAFE -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/atk-1.0 -D_THREAD_SAFE -pthread -D_THREAD_SAFE -D_THREAD_SAFE -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include/dvdcss -c -o libmpcodecs/vf_lavc.o libmpcodecs/vf_lavc.c

Not sure if you get the right headers since -I/usr/local/include is defined before -I/usr/local/ffmpeg4/include ?
Comment 28 George Mitchell 2023-05-01 14:32:10 UTC
Well, I updated my ports tree and it contains the latest commit.  In addition, ldd reports that it's linking to the ffmepg4 library.  But when I try to play an ogg-vorbis file (no video), I get this:

mplayer Gershwin-PorgyAndBess-SymphonicPicture.ogg
MPlayer SVN-r38412-snapshot-13.0.0 (C) 2000-2023 MPlayer Team

Playing Gershwin-PorgyAndBess-SymphonicPicture.ogg.
Cache fill:  4.69% (393216 bytes)   

libavformat version 58.76.100 (external)
Mismatching header version 60.3.100
libavformat file format detected.


MPlayer interrupted by signal 11 in module: demux_open
- MPlayer crashed by bad usage of CPU/FPU/RAM.
  Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
  disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
  It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
  gcc version. If you think it's MPlayer's fault, please read
  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
  won't help unless you provide this information when reporting a possible bug.
Parent process disappeared, exiting cache process.

I'm compiling with portmaster, if that makes a difference.
Comment 29 Daniel Engberg freebsd_committer freebsd_triage 2023-05-01 14:35:03 UTC
This is why I asked you to test with my patch applied :-)
Comment 30 George Mitchell 2023-05-01 14:50:05 UTC
I backed out the diff from the commit and then tried your patch version 2, and it now works!  Thanks to all for the help.

Should the PORTREVISION be bumped again?
Comment 31 Thomas Zander freebsd_committer freebsd_triage 2023-05-01 15:46:33 UTC
(In reply to Daniel Engberg from comment #27)

I didn't intentionally remove the CFLAGS. It just belongs in Makefile.common, not Makefile. I must have screwed up that part while linting, cleaning up my workspace etc. Will add it. Thanks for the ping.
Comment 32 Thomas Zander freebsd_committer freebsd_triage 2023-05-01 15:50:02 UTC
(In reply to George Mitchell from comment #30)

We bump PORTREVISION when the resulting package changes. In this case it doesn't, since the package builders run on poudriere and will produce correct builds. But I'll make an exception and bump it now, otherwise portmaster users may continue to use semi-broken builds and will see strange errors.
Comment 33 commit-hook freebsd_committer freebsd_triage 2023-05-01 15:57:55 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5348dafc8864fb387609b408a94568bb844a7ead

commit 5348dafc8864fb387609b408a94568bb844a7ead
Author:     Thomas Zander <riggs@FreeBSD.org>
AuthorDate: 2023-05-01 15:52:33 +0000
Commit:     Thomas Zander <riggs@FreeBSD.org>
CommitDate: 2023-05-01 15:57:18 +0000

    multimedia/{mplayer|mencoder} Add missing CFLAGS for ffmpeg4 headers

    Details:
    This was missed in the previous commit. Ensure the ffmpeg4 headers are
    included, not the ffmpeg 6 ones.

    PR:             270569
    Reported by:    diizzy
    Tested by:      george@m5p.com, riggs

 multimedia/mencoder/Makefile       | 2 +-
 multimedia/mplayer/Makefile        | 2 +-
 multimedia/mplayer/Makefile.common | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)