[PATCH] libdav1d support

Andrew Randrianasulu <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <[email protected]>
Hello.

I tried to add libdav1d support into mplayer/ffmpeg.
It works as in - shows picture from webm/mp4 and allow me to seek around. 
But my check for header (like in ALSA check) may be not good (ffmpeg only 
supports libdav1d >=0.2.1)

MPlayer svn  38140
ffmpeg git commit 1eb54323c82ff6eff18553fd3f2788a695bdf812

MPlayer emit this warning, I assume for removing it whole interface between 
mplayer and  libavcodec's decoders must be upgraded?

./mplayer /dev/shm/av1_svt_0.5_2100frames-7.webm
MPlayer SVN-r38140-5.5.0 (C) 2000-2019 MPlayer Team
224 audio & 465 video codecs

Playing /dev/shm/av1_svt_0.5_2100frames-7.webm.
libavformat version 58.27.103 (internal)
libavformat file format detected.
[libdav1d @ 0x5774cb00]libdav1d 0.3.1
[lavf] stream 0: video (libdav1d), -vid 0
VIDEO:  [AV01]  1280x720  0bpp  30.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 58.52.102 (internal)
[libdav1d @ 0x5774cb00]libdav1d 0.3.1
Selected video codec: [av1] vfm: ffmpeg (AV1)
==========================================================================
Clip info:
 ENCODER: Lavf58.27.103
Load subtitles in /dev/shm/
Audio: no sound
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vdpau] 1280x720 => 1280x720 Planar YV12
V:   0.2   0/  0 ??% ??% ??,?% 0 0
[libdav1d @ 0x5774cb00]The deprecated avcodec_decode_* API cannot return all the frames for this decoder. Some frames will be dropped. Update your code to the new decoding API to fix this.
V:  10.4   0/  0  5% 13%  0.0% 0 0

Exiting... (Quit)

_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
libdav1d_auto.diff (text/x-diff, 1.4 KB)
Index: configure
===================================================================
--- configure	(revision 38140)
+++ configure	(working copy)
@@ -797,6 +797,7 @@
 _joystick=no
 crystalhd=auto
 _xvid=auto
+_libdav1d=auto
 _xvid_lavc=auto
 _x264=auto
 _x264_lavc=auto
@@ -1249,6 +1250,8 @@
   --disable-xvid)       _xvid=no        ;;
   --enable-xvid-lavc)   _xvid_lavc=yes  ;;
   --disable-xvid-lavc)  _xvid_lavc=no   ;;
+  --enable-libdav1d)   _libdav1d=yes  ;;
+  --disable-libdav1d)  _libdav1d=no   ;;
   --enable-x264)        _x264=yes       ;;
   --disable-x264)       _x264=no        ;;
   --enable-x264-lavc)   _x264_lavc=yes  ;;
@@ -7405,6 +7408,25 @@
 fi
 echores "$_xvid"
 
+echocheck "libdav1d"
+if test "$_libdav1d" = auto && test "$ffmpeg_a" = yes ; then
+  _libdav1d=no
+  header_check dav1d/dav1d.h -ldav1d $ld_dl $ld_pthread && _libdav1d=yes
+fi
+
+if test "$_libdav1d" = yes && test "$ffmpeg_a" = yes; then
+  def_libdav1d='#define CONFIG_LIBDAV1D 1'
+  libavdecoders="$libavdecoders LIBDAV1D_DECODER"
+  extra_ldflags="$extra_ldflags -ldav1d"
+else
+  def_libdav1d='#undef CONFIG_LIBDAV1D'
+  #nocodecmodules="libdav1d $nocodecmodules"
+fi
+echores "$_libdav1d"
+
+
+
+
 echocheck "Xvid two pass plugin"
 if test "$_mencoder" = yes && test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
   statement_check xvid.h 'xvid_plugin_2pass2_t s; s.vbv_size = 0' && _xvid_lavc=yes
libdav1d_codecs_conf.diff (text/x-diff, 574 B)
Index: etc/codecs.conf
===================================================================
--- etc/codecs.conf	(revision 38140)
+++ etc/codecs.conf	(working copy)
@@ -8,6 +8,14 @@
 ;=============================================================================
 ;                   VIDEO CODECS
 ;=============================================================================
+videocodec av1
+  info "AV1"
+  status working
+  driver ffmpeg
+  dll libdav1d
+  format 0x31305641
+  format 0x31307661
+  out YV12
 
 videocodec ffiff
   info "FFmpeg IFF ANIM/ILBM/PBM/RGB8/RGBN"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.