Bug 28504 - mplayer can't read video files with dav1d codec; this bugs contains the fix.
Summary: mplayer can't read video files with dav1d codec; this bugs contains the fix.
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: All Linux
Priority: High normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA8-64-OK
Keywords: advisory, validated_update
Depends on: 28412
Blocks:
  Show dependency treegraph
 
Reported: 2021-03-02 01:11 CET by Philippe Didier
Modified: 2021-04-18 20:36 CEST (History)
3 users (show)

See Also:
Source RPM: mplayer-1.4-9.mga8.src.rpm, mplayer-1.4-9.mga8.tainted.src.rpm
CVE:
Status comment:


Attachments
modified spec file for mplayer (65.15 KB, text/x-rpm-spec)
2021-03-25 01:25 CET, Philippe Didier
Details
patch from fedora to have the AV1 decoder from the distrib version of ffmpeg (1.24 KB, patch)
2021-03-25 01:28 CET, Philippe Didier
Details | Diff
patch from fedora to have the AOM-AV1 decoder from the distrib version of ffmpeg (922 bytes, patch)
2021-03-25 01:30 CET, Philippe Didier
Details | Diff
patch to use the distro version of ffmpeg (694 bytes, patch)
2021-03-25 01:31 CET, Philippe Didier
Details | Diff
mageia isation patch (1.71 KB, patch)
2021-03-25 01:32 CET, Philippe Didier
Details | Diff
rtsp extra fixes patch (1.65 KB, patch)
2021-03-25 01:34 CET, Philippe Didier
Details | Diff
format string litteral (443 bytes, patch)
2021-03-25 01:36 CET, Philippe Didier
Details | Diff
prevent dvd crash (553 bytes, patch)
2021-03-25 01:38 CET, Philippe Didier
Details | Diff
to use ffmpeg headers (1.61 KB, patch)
2021-03-25 01:40 CET, Philippe Didier
Details | Diff
fix live test (598 bytes, patch)
2021-03-25 01:41 CET, Philippe Didier
Details | Diff
to build on arm (1.46 KB, patch)
2021-03-25 01:43 CET, Philippe Didier
Details | Diff
configure dvdread (799 bytes, patch)
2021-03-25 01:44 CET, Philippe Didier
Details | Diff
prevent seg fault (577 bytes, patch)
2021-03-25 01:46 CET, Philippe Didier
Details | Diff
allow specifying alsa hw devices in particular form (457 bytes, patch)
2021-03-25 01:48 CET, Philippe Didier
Details | Diff
prevent gif crash (799 bytes, patch)
2021-03-25 01:49 CET, Philippe Didier
Details | Diff
adapt to aarch64 (1.99 KB, patch)
2021-03-25 01:50 CET, Philippe Didier
Details | Diff
don't know if it is ueseful !!! (664 bytes, patch)
2021-03-25 01:52 CET, Philippe Didier
Details | Diff
a cleaner spec file for mplayer (66.53 KB, text/x-rpm-spec)
2021-03-25 20:52 CET, Philippe Didier
Details
spec file including the last commit from kekepower (66.68 KB, text/x-rpm-spec)
2021-03-27 15:42 CET, Philippe Didier
Details
at least good spec file (66.76 KB, text/x-rpm-spec)
2021-03-28 17:54 CEST, Philippe Didier
Details

Description Philippe Didier 2021-03-02 01:11:19 CET
Hi

How to reproduce :
try to read the file proposed here https://bugs.mageia.org/show_bug.cgi?id=28363#c4
The VLC bug was caused by a missing option in the spec file

That sounds a little more complex to resolve
mplayer seems to be built with a bundled version of ffmpeg (4.1.6) which didn't yet afford the dav1d codec

NB : a contrario the mageia8 version of ffmpeg (4.3.1-6) can read these files ...

As a consequence neither Kmplayer-0.12.0b (built with mplayer -1.4-9) can't read the problematic file

But astonishingly smplayer-20.6.0 can read fluently the file !!!? 
That's a mystery
Comment 1 Lewis Smith 2021-03-02 10:37:39 CET
Thank you for the report.
> try to read the file proposed  [in bug 28363 c4]
 http://dl.free.fr/fbsv6Dydu     [which may not endure for long]
If that is the file Nightwish.mkv, I have just tried it with:
 mplayer-1.4-9.mga8.tainted

$ mplayer /mnt/common/downloads/Nightwish.mkv 
MPlayer 1.4-9.mga8.tainted-10 (C) 2000-2019 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /mnt/common/downloads/Nightwish.mkv.
libavformat version 58.45.100 (external)
Mismatching header version 58.20.100
libavformat file format detected.
[libdav1d @ 0x7fd96e206960]libdav1d 0.8.0
[lavf] stream 0: audio (opus), -aid 0, -alang eng
[lavf] stream 1: video (libdav1d), -vid 0
VIDEO:  [AV01]  620x360  0bpp  24.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Cannot find codec matching selected -vo and video format 0x31305641.
==========================================================================
Clip info:
 ENCODER: Lavf58.16.100
Load subtitles in /mnt/common/downloads/
==========================================================================
Trying to force audio codec driver family libmad...
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 58.91.100 (external)
Mismatching header version 58.35.100
[opus @ 0x7fd96e206960]Could not update timestamps for skipped samples.
AUDIO: 48000 Hz, 2 ch, floatle, 0.0 kbit/0.00% (ratio: 0->384000)
Selected audio codec: [ffopus] afm: ffmpeg (FFmpeg opus)
==========================================================================
AO: [pulse] 48000Hz 2ch floatle (4 bytes per sample)
Video: no video
Starting playback...
A:   0.0 (00.0) of 284.0 (04:43.9) ??,?% 
==========================================================================
Cannot find codec matching selected -vo and video format 0x31305641.
==========================================================================

The last repeated ad infinitum. No graphic, but sound is O/P.

Various maintainers for this package, hence assigning this globally.

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=28363
Source RPM: mplayer-1.4-9 => mplayer-1.4-9.mga8.tainted.src.rpm
Assignee: bugsquad => pkg-bugs

Comment 2 Philippe Didier 2021-03-21 01:44:33 CET
Hi
I got some explanations why mplayer (and kmplayer) can't read correctly the video files with dav1d codec (such as the example I provided)
And why smplayer can !!!

Indeed vlc (now since the last update), dragon player, mpv, ffmpeg can read this file

And smplayer is not simply a mplayer skin : mine as mpv as default multimedia engine instead of mplayer !


The only reason why mplayer can't display the video mkv is that it is built upon the ffmpeg version (4.1.6) bundled in its srpm ! This old version of ffmpeg (november 2018) didn't yet support AV1 decoding which appeared only with 4.2 version (august 2019)

Mplayer ought to be build on the distro version of ffmpeg (4.3.1) 
I tried locally but the mageia spec file is too complex for my skill, 
and trying to transpose the fedora fusion spec file to mageia is not so easy

I would have proposed a new spec file and patches if I had been able to do so
Sorry

This bug remains (but we can always use something else to read these video files that become a standard now... at least on youtube)
Comment 3 Philippe Didier 2021-03-24 18:53:03 CET
Hi everybody

I spent some hours and I could finally build a mplayer able to read videos with 
AV1 codec

The problem is now to provide it to mageia packagers :

Lots of patches

and a spec file totally rewritten (a kind of mix of fedora and mageia spec file)

Is there a way to provide the SRPM to some skilled packager ?

Or must I provide one by one the patches and the spec file (not a diff : it would be larger than the spec file itself !)
Comment 4 Philippe Didier 2021-03-24 18:54:26 CET
PS I kept the changelog in the spec file that I may provide
Comment 5 Philippe Didier 2021-03-24 18:58:36 CET
One more PS
I had some problems with the provide an obsolete rules in the spec file (warnings) but that didn't prevent me build nor to update
Comment 6 Philippe Didier 2021-03-24 19:14:22 CET
One last thing
I didn't try to build with the fdkaac devel 
Maybe it would be intersting to do so...
Comment 7 Philippe Didier 2021-03-25 01:25:09 CET
Created attachment 12499 [details]
modified spec file for mplayer

here is the spec file I propose 
I tried to mix some parts of fedora and some from mageia
No doubts it needs to be corrected by a skilled packager !!!
Particularly for the commented lines from 433 to 448 imported frome fedora whose I don't know if they would be useful (they didn't exist in mageia spec and the package was built without warning)
And for the provides and obsoletes lines 452, 453, 488, 489, 502, 503.
Comment 8 Philippe Didier 2021-03-25 01:28:25 CET
Created attachment 12500 [details]
patch from fedora to have the AV1 decoder from the distrib version of ffmpeg

patch n°4
Comment 9 Philippe Didier 2021-03-25 01:30:00 CET
Created attachment 12501 [details]
patch from fedora to have the AOM-AV1 decoder from the distrib version of ffmpeg

patch n°5
Comment 10 Philippe Didier 2021-03-25 01:31:32 CET
Created attachment 12502 [details]
patch to use the distro version of ffmpeg

patch n°3
Comment 11 Philippe Didier 2021-03-25 01:32:52 CET
Created attachment 12503 [details]
mageia isation patch

patch n° 0
Comment 12 Philippe Didier 2021-03-25 01:34:41 CET
Created attachment 12504 [details]
rtsp extra fixes patch

patch n° 28
Comment 13 Philippe Didier 2021-03-25 01:36:09 CET
Created attachment 12505 [details]
format string litteral

patch n°31
Comment 14 Philippe Didier 2021-03-25 01:38:16 CET
Created attachment 12506 [details]
prevent dvd crash

patch n° 35
(an old patch from Mandriva...
Comment 15 Philippe Didier 2021-03-25 01:40:13 CET
Created attachment 12507 [details]
to use ffmpeg headers

patch n° 48
Comment 16 Philippe Didier 2021-03-25 01:41:33 CET
Created attachment 12508 [details]
fix live test

patch n°50
Comment 17 Philippe Didier 2021-03-25 01:43:07 CET
Created attachment 12509 [details]
to build on arm

patch n°54
Comment 18 Philippe Didier 2021-03-25 01:44:15 CET
Created attachment 12510 [details]
configure dvdread

patch n°56
Comment 19 Philippe Didier 2021-03-25 01:46:15 CET
Created attachment 12511 [details]
prevent seg fault

patch n°57
Comment 20 Philippe Didier 2021-03-25 01:48:46 CET
Created attachment 12512 [details]
allow specifying alsa hw devices in particular form

patch n°58

# (cjw) allow specifying alsa hw devices in the form <name>:CARD=<card>,DEV=<dev> e.g. hdmi:CARD=NVidia,DEV=3
#       by writing: -ao alsa:device=<name>=CARD^<card>,DEV^<dev> e.g.: -ao alsa:device=hdmi=CARD^NVidia,DEV^3
#       These devices can be listed using:  aplay -l
Comment 21 Philippe Didier 2021-03-25 01:49:45 CET
Created attachment 12513 [details]
prevent gif crash

patch n° 59
Comment 22 Philippe Didier 2021-03-25 01:50:40 CET
Created attachment 12514 [details]
adapt to aarch64

patch n°61
Comment 23 Philippe Didier 2021-03-25 01:52:24 CET
Created attachment 12515 [details]
don't know if it is ueseful !!!

patch n° 62

the last one...
Comment 24 Philippe Didier 2021-03-25 02:01:44 CET
I just forgot to say I built this on a mageia8 64bits

And tested it on Mageia8 as an update of the original tainted version
I can read videos with AV1 codec

I have not Cauldron so don't know if it can be used as it is on Cauldron

And I don't know if it will be built and will work on other arches
Comment 25 Philippe Didier 2021-03-25 20:52:49 CET
Created attachment 12518 [details]
a cleaner spec file for mplayer

Hi 
I rewrote the mplayer spec file to make it more readable 
(it contains everything from the original file)

It can be used to build packages for core and tainted release

Nevertheless I found a problem :
Mencoder can't be built for x264 :
I get this message :
usr/bin/ld: libmpcodecs/ve_x264.o: undefined reference to symbol 'x264_encoder_close'
/usr/bin/ld: /usr/lib64/libx264.so.157: error adding symbols: DSO missing from command line

and I had to modify the line 110 in plf
%define build_x264      0

This problem never appeared for Mageia ! 
Even when rebuilding for new versions of x264

The reason is that something is missing in the build part of the spec file :
this build option is missing :

%if %build_x264
        --enable-x264 \
%endif

this was never added so the problem has been hidden for a long time...

I added it (ligne 687) but I have to prevent to use it line 110

Hope this will help to be able to read AV1 codecs (it works for me)

And I hope that someone may find the solution for x264 codec


PS this problem seems to be hidden for fedora fusion too ! even if they rebuild for new version of x264 !!! the option to build with x264 is not set...

Attachment 12499 is obsolete: 0 => 1

Comment 26 Philippe Didier 2021-03-27 15:42:21 CET
Created attachment 12536 [details]
spec file including the last commit from kekepower

A cleaner spec file to allow AV1 decoding

I included the last commit from kekepower 
" Use MMX, SSE+SSE2 exclusively on x86_64"

( It was not in the last spec file for Mageia 8 that I used as a basis to create the first one I rewrote and appeared only for the new Cauldron)

I propose it to anyone who want to test

But maybe this work is useless :
No reaction since I opened this bug which was only confirmed by Lewis Smith in comment#3 three weeks ago    
 :-(

Attachment 12518 is obsolete: 0 => 1

Comment 27 Philippe Didier 2021-03-27 15:43:54 CET
my mistake Lewis Smith confirmed in comment#1
Comment 28 Philippe Didier 2021-03-28 17:54:17 CEST
Created attachment 12541 [details]
at least good spec file

here is the last spec

It works : I could build mplayer and mencoder
They can now  read (or encode ) video files with AV1 codec

I had a problem with the building of mencoder for tainted

when it built the mencoder section I got this message :

usr/bin/ld: libmpcodecs/ve_x264.o: undefined reference to symbol
'x264_encoder_close'
/usr/bin/ld: /usr/lib64/libx264.so.157: error adding symbols: DSO
missing from command line


I think I found the reason why :
When building for tainted we use the codec provided by system ffmpeg...

In the spec file line 112 we need to have :
%define build_x264      0

If we have 
%define build_x264      1
we get the error 

By default the configure file already adds this option if x264 is provided by ffmpeg... no need to ask twice for it

I tried the mencoder from the rpm that I built, and indeed it can encode a wmv file to an avi with x264 codec !

Attachment 12536 is obsolete: 0 => 1

Comment 29 Lewis Smith 2021-03-30 20:24:18 CEST
Thank you for all your research and considerable effort, which warrants being heeded. So I have upped the priority to get it looked at.
Let me know again if nothing happens.

Summary: mplayer can't read video files with dav1d codec => mplayer can't read video files with dav1d codec; this bugs contains the fix.
Priority: Normal => High

Comment 30 David GEIGER 2021-03-31 12:56:06 CEST
Should be fixed with mplayer-1.4-9.1.mga8 in Core/Updates_testing and Tainted/Updates_testing repo!

Also it should fix bug 28412

Depends on: (none) => 28412
CC: (none) => geiger.david68210

David GEIGER 2021-03-31 12:57:00 CEST

Assignee: pkg-bugs => qa-bugs

Comment 31 Philippe Didier 2021-03-31 16:22:30 CEST
Hi David 
And thanks to have taken care of this
(huge job to clean the spec file... but it is easier to read now)

I uninstalled my own rpms and installed the original tainted rpms
Then updated from tainted testing 

Everything went right except mplayer-doc that has an invalid signature (there's a warning but I could accept to install itnevertheless...)

Mplayer can read evreything
Mencoder can encode to x264

So this appears OK for mageia8 64bits except the missing signature for mplayer-doc
Comment 32 Philippe Didier 2021-04-02 00:30:08 CEST
Hi again David

You corrected the signature problem 
Version 1.4-9.2 is OK for mplayer mplayer-doc mplayer-gui and mencoder

It's OK for mageia8 64 bits tainted


Besides this

NB Now that mplayer is built upon the system ffmpeg It will have to be rebuilt after ffmpeg  each time when a buildrequire of ffmpeg is revised (x264 for instance) and ffmpeg rebuilt for it

Because mplayer as ffmpeg-devel as BuildRequire and when configuring before building configure looks directly for ffmpeg codecs that are pushed in the BUILD directory...

If mplayer was rebuilt before ffmpeg this new version of a codec will not be integrated : mplayer will use the precedent version, still present in ffmpeg...



As a counterexample : In the past it has been useless to rebuild mplayer for a new version of x264 because it was not used to rebuild it : by default mplayer and mencoder were always and again rebuilt with the old version of x264 brought by the old version of ffmpeg bundled in the SRPM....
Comment 33 Philippe Didier 2021-04-14 12:01:54 CEST
For Qa testing purpose... 
you can always download this mkv file with AV1 codec :

http://dl.free.fr/fbsv6Dydu   which was provided in comment 1
Comment 34 Aurelien Oudelet 2021-04-15 18:03:58 CEST
(In reply to David GEIGER from comment #30)
> Should be fixed with mplayer1.4-9.2.mga8 in Core/Updates_testing and
> Tainted/Updates_testing repo!
> 
> Also it should fix bug 28412

Yes.
Validating.

Advisory:
========================

Updated mplayer packages add dav1d codec and fix issues

The updated mplayer packages add dav1d codec and fix mencoder libavformat and
libavcodec head mismatch version.

references:
https://bugs.mageia.org/show_bug.cgi?id=28504
https://bugs.mageia.org/show_bug.cgi?id=28412
========================

Updated packages from core/updates_testing
========================
mencoder-1.4-9.2.mga8
mplayer-1.4-9.2.mga8
mplayer-doc-1.4-9.2.mga8
mplayer-gui-1.4-9.2.mga8

from SRPM
mplayer-1.4-9.2.mga8

Updates packages from tainted/updates_testing
========================
mencoder-1.4-9.2.mga8.tainted
mplayer-1.4-9.2.mga8.tainted
mplayer-doc-1.4-9.2.mga8.tainted
mplayer-gui-1.4-9.2.mga8.tainted

from SRPM
mplayer-1.4-9.2.mga8.tainted

CC: (none) => ouaurelien

Aurelien Oudelet 2021-04-15 18:26:29 CEST

CC: (none) => sysadmin-bugs
Source RPM: mplayer-1.4-9.mga8.tainted.src.rpm => mplayer-1.4-9.mga8.src.rpm, mplayer-1.4-9.mga8.tainted.src.rpm
Keywords: (none) => advisory, validated_update
Whiteboard: (none) => MGA8-64-OK

Comment 35 Mageia Robot 2021-04-18 20:36:55 CEST
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2021-0088.html

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.