Bug 234194

Summary: multimedia/ffmpeg: Prefer dav1d for decoding
Product: Ports & Packages Reporter: Ivan Rozhuk <rozhuk.im>
Component: Individual Port(s)Assignee: Thomas Zander <riggs>
Status: Closed FIXED    
Severity: Affects Many People CC: riggs, rozhuk.im
Priority: --- Keywords: needs-qa, performance
Version: LatestFlags: riggs: maintainer-feedback+
Hardware: Any   
OS: Any   
See Also: https://bugzilla.mozilla.org/show_bug.cgi?id=1493397
Bug Depends on:    
Bug Blocks: 235953    
Attachments:
Description Flags
v1 none

Description Ivan Rozhuk 2018-12-20 03:52:31 UTC
Please, make dav1d AV1 decoder default AV1 decoder then ffmpeg build with dav1d and aom.

I take first 2 video in 4k AV1 here https://www.elecard.com/videos
and aom decode it with lags, low rate fps, on ryzen 2700x.
Same time then I build ffmpeg with dav1d and without aom - all ok.
If build with with dav1d and with aom - low fps/drops.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2018-12-20 19:50:02 UTC
dav1d performance on i386 appears to be worse than aom. Tested on Intel i7-6700K (Skylake) via 11.2 i386 jail on 13.0 amd64 host. Neither CPUTYPE?=native nor -tilethreads help much.

$ fetch https://www.elecard.com/storage/video/Stream2_AV1_4K_22.7mbps.webm
$ ffmpeg -c:v libdav1d -i Stream2_AV1_4K_22.7mbps.webm -f null /dev/null
$ ffmpeg -c:v libaom-av1 -i Stream2_AV1_4K_22.7mbps.webm -f null /dev/null
Comment 2 Jan Beich freebsd_committer freebsd_triage 2018-12-20 19:51:58 UTC
Created attachment 200318 [details]
v1

ffmpeg appears to derive default codec based on sorting order.
Comment 3 Ivan Rozhuk 2018-12-20 23:06:21 UTC
Patch work ok, thanks!

libaom-av1 - 425% CPU and 22 FPS
libdav1d - 230-300% CPU and 32-38 FPS
Comment 4 commit-hook freebsd_committer freebsd_triage 2019-03-16 17:30:46 UTC
A commit references this bug:

Author: riggs
Date: Sat Mar 16 17:29:47 UTC 2019
New revision: 495918
URL: https://svnweb.freebsd.org/changeset/ports/495918

Log:
  Prefer dav1d over for decoding

  PR:		234194
  Submitted by:	jbeich (patch)
  Reported by:	rozhuk.im@gmail.com

Changes:
  head/multimedia/ffmpeg/Makefile
  head/multimedia/ffmpeg/files/patch-libavcodec_allcodecs.c