View Issue Details

IDProjectCategoryView StatusLast Update
0000214Cinelerra-GG[All Projects] Featurepublic2019-05-15 20:15
ReporterAndrew-RAssigned Togoodguy 
PrioritynormalSeverityminorReproducibilityhave not tried
Status assignedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000214: Please look into adding dav1d AV1 decoder - faster than libAOM
DescriptionHello.

I try to record my 'feature' ideas here so they will be preserved.
In upcoming ffmpeg 4.2 (not yet branched) you can see support for faster AV1 decoder - dav1d

https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/9bf9358b615dbf3d0f81ca2dbfbec6103dc77f25

dav1d 0.3.0 was released in May: https://lwn.net/Articles/787422/
Code repo: https://code.videolan.org/videolan/dav1d

Unfortunately, for me it was not working (or may be ffmpeg was still defaulting to libaom even for decoding?):
https://lists.cinelerra-gg.org/pipermail/cin/2019-May/000648.html
Steps To Reproduceuse -ldav1d for ffmpeg-git configure (hack in thirdparty/Makefile), and add it (as hack) to system_libs += -ldav1d in global_config (after configure was run - proper integration probably will require code similar to https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blobdiff;f=cinelerra-5.1/configure.ac;h=90048a290fa23a145c91eb07be2dfb6cf1988edf;hp=408ed8e73c702c6cb5d078dd701c436030f612be;hb=0e82b3d8a226c7ed906d539db6418c472d542c75;hpb=307d7f624510fcca7a7f6c1e683796cb73637106 )
TagsNo tags attached.

Activities

Andrew-R

Andrew-R

2019-05-15 20:15

reporter   ~0001544

this one even work on both webm (av1) and mp4 (h264) files!

--------------hack!---------
diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
index 3bb9dd8..e87cfa5 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/cinelerra-5.1/cinelerra/ffmpeg.C
@@ -374,7 +374,18 @@ int FFStream::decode_activate()
                }
                while( ret >= 0 && st != 0 && !reading ) {
                        AVCodecID codec_id = st->codecpar->codec_id;
- AVCodec *decoder = avcodec_find_decoder(codec_id);
+ /* hack */
+ // AVCodec *decoder = avcodec_find_decoder(codec_id);
+
+ // const char* lib_aom_name = "libaom-av1";
+ const AVCodecDescriptor *descr = avcodec_descriptor_get(codec_id);
+ AVCodec *decoder = NULL;
+ decoder = avcodec_find_decoder(codec_id);
+ if ( descr->id == AV_CODEC_ID_AV1) {
+ decoder = avcodec_find_decoder_by_name("libdav1d");
+ }
+
+
                        avctx = avcodec_alloc_context3(decoder);
                        if( !avctx ) {
                                eprintf(_("cant allocate codec context\n"));
@@ -1543,6 +1554,7 @@ FFMPEG::FFMPEG(FileBase *file_base)
        has_audio = has_video = 0;
        opts = 0;
        opt_duration = -1;
+ opt_force_video_decoder = 0;
        opt_video_filter = 0;
        opt_audio_filter = 0;
        opt_hw_dev = 0;
@@ -2007,6 +2019,8 @@ int FFMPEG::read_options(FILE *fp, const char *options, AVDictionary *&opts)
                if( !ret ) {
                        if( !strcmp(key, "duration") )
                                opt_duration = strtod(val, 0);
+ else if( !strcmp(key, "force_video_decoder") )
+ opt_force_video_decoder = cstrdup(val);
                        else if( !strcmp(key, "video_filter") )
                                opt_video_filter = cstrdup(val);
                        else if( !strcmp(key, "audio_filter") )
diff --git a/cinelerra-5.1/cinelerra/ffmpeg.h b/cinelerra-5.1/cinelerra/ffmpeg.h
index b4867b8..e13504e 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.h
+++ b/cinelerra-5.1/cinelerra/ffmpeg.h
@@ -329,6 +329,7 @@ public:
        char *opt_video_filter;
        char *opt_audio_filter;
        char *opt_hw_dev;
+ char *opt_force_video_decoder;
        char file_format[BCTEXTLEN];
        int fflags;
-------------end-of-hack---------
Andrew-R

Andrew-R

2019-05-15 11:08

reporter   ~0001534

So, I simply hacked libdav1d as decoder for all streams ...now Cin was decoding this webm much faster!

------hack!-----
diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
index 3bb9dd8..dc6914c 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/cinelerra-5.1/cinelerra/ffmpeg.C
@@ -374,7 +374,9 @@ int FFStream::decode_activate()
                }
                while( ret >= 0 && st != 0 && !reading ) {
                        AVCodecID codec_id = st->codecpar->codec_id;
- AVCodec *decoder = avcodec_find_decoder(codec_id);
+ /* AVCodec *decoder = avcodec_find_decoder(codec_id);
+ hack */
+ AVCodec *decoder = avcodec_find_decoder_by_name("libdav1d");
                        avctx = avcodec_alloc_context3(decoder);
                        if( !avctx ) {
                                eprintf(_("cant allocate codec context\n"));
@@ -1543,6 +1545,7 @@ FFMPEG::FFMPEG(FileBase *file_base)
        has_audio = has_video = 0;
        opts = 0;
        opt_duration = -1;
+ opt_force_video_decoder = 0;
        opt_video_filter = 0;
        opt_audio_filter = 0;
        opt_hw_dev = 0;
@@ -2007,6 +2010,8 @@ int FFMPEG::read_options(FILE *fp, const char *options, AVDictionary *&opts)
                if( !ret ) {
                        if( !strcmp(key, "duration") )
                                opt_duration = strtod(val, 0);
+ else if( !strcmp(key, "force_video_decoder") )
+ opt_force_video_decoder = cstrdup(val);
                        else if( !strcmp(key, "video_filter") )
                                opt_video_filter = cstrdup(val);
                        else if( !strcmp(key, "audio_filter") )
diff --git a/cinelerra-5.1/cinelerra/ffmpeg.h b/cinelerra-5.1/cinelerra/ffmpeg.h
index b4867b8..e13504e 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.h
+++ b/cinelerra-5.1/cinelerra/ffmpeg.h
@@ -329,6 +329,7 @@ public:
        char *opt_video_filter;
        char *opt_audio_filter;
        char *opt_hw_dev;
+ char *opt_force_video_decoder;
        char file_format[BCTEXTLEN];
        int fflags;
--------------------------

./cin
Cinelerra Infinity - built: May 15 2019 07:53:40
git://git.cinelerra-gg.org/goodguy/cinelerra.git
(c) 2006-2018 Heroine Virtual Ltd. by Adam Williams
(c) 2007-2018 cin5 derivative by W.P. Morrow aka goodguy
Cinelerra is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions. There is absolutely no warranty for Cinelerra.

init plugin index: /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/bin/plugins
PluginFFilter::new_ffilter(overlay_opencl)
  err: Ошибка ввода/вывода
PluginFFilter::new_ffilter(xmedian)
  err: Операция не позволена
[openclsrc_682 @ 0xd729a00] OpenCL source requires output dimensions to be specified.
PluginFFilter::new_ffilter(openclsrc)
  err: Недопустимый аргумент
init lv2 index:
[libaom-av1 @ 0xd6772c0] v1.0.0
[libaom-av1 @ 0xd6772c0] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[AVIOContext @ 0xd70bc40] Statistics: 759514 bytes read, 0 seeks
[libaom-av1 @ 0xd6772c0] v1.0.0
[libaom-av1 @ 0xd6772c0] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[libaom-av1 @ 0xd714b00] v1.0.0
[libaom-av1 @ 0xd714b00] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[AVIOContext @ 0xd69c340] Statistics: 759514 bytes read, 0 seeks
[libaom-av1 @ 0xe4708c40] v1.0.0
[libaom-av1 @ 0xe4708c40] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[libaom-av1 @ 0xe510e200] v1.0.0
[libaom-av1 @ 0xe510e200] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[AVIOContext @ 0xd724c40] Statistics: 759514 bytes read, 0 seeks
[libaom-av1 @ 0xe4709680] v1.0.0
[libaom-av1 @ 0xe4709680] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
[libdav1d @ 0xd9f30f40] libdav1d 0.3.0
[libaom-av1 @ 0xdb56c180] v1.0.0
[libaom-av1 @ 0xdb56c180] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
[libdav1d @ 0xe51f3d80] libdav1d 0.3.0
[AVIOContext @ 0xe51fee40] Statistics: 759514 bytes read, 0 seeks
[AVIOContext @ 0xe51099c0] Statistics: 759514 bytes read, 0 seeks
[libaom-av1 @ 0xedcc0540] v1.0.0
[libaom-av1 @ 0xedcc0540] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[libaom-av1 @ 0xd216c280] v1.0.0
[libaom-av1 @ 0xd216c280] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
[libdav1d @ 0xd0c31e00] libdav1d 0.3.0
[matroska,webm @ 0xedcc0e40] Element at 0x36687cb ending at 0x3668d02 exceeds containing master element ending at 0x36687c5
[AVIOContext @ 0xe4780b80] Statistics: 16326314 bytes read, 16 seeks
[AVIOContext @ 0xe47075c0] Statistics: 759514 bytes read, 0 seeks
[AVIOContext @ 0xd2167b80] Statistics: 61175797 bytes read, 13 seeks
[AVIOContext @ 0xedcbedc0] Statistics: 759514 bytes read, 0 seeks
Session time: 0:03:12
Cpu time: user: 0:03:45.552 sys: 0:00:19.488

Obviously it will not work for any other stream! :/ Sorry, not good at all with C/C++ ....
Andrew-R

Andrew-R

2019-05-15 10:34

reporter   ~0001533

Hm, it seems currently Cinelerra-GG has no way to force _video_decoder (out of ones available in ffmpeg for given id).

I tried to figure this part out ..so far added this part into cinelerra/ffmpegc/h:

diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
index 3bb9dd8..3da9f9c 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/cinelerra-5.1/cinelerra/ffmpeg.C
@@ -2007,6 +2007,8 @@ int FFMPEG::read_options(FILE *fp, const char *options, AVDictionary *&opts)
                if( !ret ) {
                        if( !strcmp(key, "duration") )
                                opt_duration = strtod(val, 0);
+ else if( !strcmp(key, "force_video_decoder") )
+ opt_force_video_decoder = cstrdup(val);
                        else if( !strcmp(key, "video_filter") )
                                opt_video_filter = cstrdup(val);
                        else if( !strcmp(key, "audio_filter") )
diff --git a/cinelerra-5.1/cinelerra/ffmpeg.h b/cinelerra-5.1/cinelerra/ffmpeg.h
index b4867b8..e13504e 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.h
+++ b/cinelerra-5.1/cinelerra/ffmpeg.h
@@ -329,6 +329,7 @@ public:
        char *opt_video_filter;
        char *opt_audio_filter;
        char *opt_hw_dev;
+ char *opt_force_video_decoder;
        char file_format[BCTEXTLEN];
        int fflags;

---------------

Now I should reuse this new option somewhere around line 377:
https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blob;f=cinelerra-5.1/cinelerra/ffmpeg.C;h=3bb9dd8018c9075810154bf112e3843e4677dcb9;hb=HEAD

in FFStream::decode_activate()

Apparently, there exist function avcodec_find_decoder_by_name:
https://www.ffmpeg.org/doxygen/4.1/group__lavc__decoding.html#ga776f2359007e8457799503068419e791
PhyllisSmith

PhyllisSmith

2019-05-15 04:02

manager   ~0001531

GG will spend the time to try this. libaom creates wonderful compression and the output looks fantastic but it plays like pond water or as you said: "More normal Cinelerra-GG with 4.1 ffmpeg and libaom-1.0 decodes them OK, but as slideshow".

I downloaded from the internet this file and with its stated frame rate of 25, I usually only got 16 fps:
     Stream2_AV1_4K_22.7mbps.webm
If you have time to compare with aom versus dav1d using Cinelerra, it would be quite convincing to try this here sooner. If we can see how much faster it is, we could kick aom out and put dav1d in instead. No one is going to use aom if it is this slow.
Andrew-R

Andrew-R

2019-05-14 18:59

reporter   ~0001527

Actually, just build ffmpeg (from thirdparty) CAN use libdav1d!

root@slax:/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/bin# ../thirdparty/ffmpeg.git/ffmpeg -benchmark -i /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm -map 0:v:0 -f null -
ffmpeg version N-93862-gf49cec2ba8 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --enable-pthreads --enable-gpl --disable-ffplay --enable-vaapi --enable-vdpau --enable-libtwolame --enable-libopenjpeg --enable-libmp3lame --enable-libaom --enable-libwebp --enable-libopus --enable-libvorbis --enable-libtheora --enable-libvpx --enable-libx264 --enable-libx265 --extra-cflags=' -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/twolame-0.3.13/libtwolame -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/lame-3.100/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libaom-v1.0.0/usr/local/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/openjpeg-2.3.0/src/lib/openjp2 -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libogg-1.3.3/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/opus-1.3/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libtheora-1.1.1/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvpx-1.8.0/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x264-snapshot-20190117-2245-stable/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/source -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/source ' --extra-cxxflags=-D__STDC_CONSTANT_MACROS --pkg-config=true --extra-libs='-Wl,--start-group -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/twolame-0.3.13/libtwolame/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/twolame-0.3.13/libtwolame/.libs/libtwolame.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/lame-3.100/libmp3lame/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/lame-3.100/libmp3lame/.libs/libmp3lame.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/lame-3.100/mpglib/.libs/libmpgdecoder.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libaom-v1.0.0/usr/local/lib /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libaom-v1.0.0/usr/local/lib/libaom.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/lib /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/lib/libwebp.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/lib/libwebpdecoder.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/lib/libwebpdemux.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/lib/libwebpmux.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/openjpeg-2.3.0/bin /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/openjpeg-2.3.0/bin/libopenjp2.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/opus-1.3/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/opus-1.3/.libs/libopus.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libogg-1.3.3/lib/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libogg-1.3.3/src/.libs/libogg.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/lib/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/lib/.libs/libvorbis.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/lib/.libs/libvorbisenc.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/lib/.libs/libvorbisfile.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libtheora-1.1.1/lib/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libtheora-1.1.1/lib/.libs/libtheora.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libtheora-1.1.1/lib/.libs/libtheoradec.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libtheora-1.1.1/lib/.libs/libtheoraenc.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvpx-1.8.0/ /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvpx-1.8.0/libvpx.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x264-snapshot-20190117-2245-stable/ /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x264-snapshot-20190117-2245-stable/libx264.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/ /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/libx265.a -Wl,--end-group -L/usr/X11R7/lib -lm -lstdc++ -pthread -lOpenCL -ldav1d -lva -lva-x11 -lva-drm -ldl' --enable-opencl --enable-libdav1d --extra-ldflags=' -lva -lva-x11 -lva-drm -ldl'
  libavutil 56. 27.100 / 56. 27.100
  libavcodec 58. 52.101 / 58. 52.101
  libavformat 58. 27.103 / 58. 27.103
  libavdevice 58. 7.100 / 58. 7.100
  libavfilter 7. 53.100 / 7. 53.100
  libswscale 5. 4.101 / 5. 4.101
  libswresample 3. 4.100 / 3. 4.100
  libpostproc 55. 4.100 / 55. 4.100
[libaom-av1 @ 0xbde3c40] v1.0.0
Input #0, matroska,webm, from '/mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm':
  Metadata:
    encoder : libwebm-0.2.1.0
  Duration: 00:02:24.12, start: 0.000000, bitrate: 3166 kb/s
    Stream #0:0(eng): Video: av1 (Main), yuv420p(tv), 1280x720, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
[libaom-av1 @ 0xbde4980] v1.0.0
Stream mapping:
  Stream #0:0 -> #0:0 (av1 (libaom-av1) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    encoder : Lavf58.27.103
    Stream #0:0(eng): Video: wrapped_avframe, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
    Metadata:
      encoder : Lavc58.52.101 wrapped_avframe
[matroska,webm @ 0xbde1c80] Element at 0x36687cb ending at 0x3668d02 exceeds containing master element ending at 0x36687c5
frame= 3604 fps= 18 q=-0.0 Lsize=N/A time=00:02:24.16 bitrate=N/A speed=0.73x
video:1394kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
bench: utime=418.219s stime=2.183s rtime=197.479s
bench: maxrss=99192kB

====================================
SPEED libaom-1.0 = 0.73 realtime

root@slax:/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/bin# ../thirdparty/ffmpeg.git/ffmpeg -benchmark -c:v libdav1d -i /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm -map 0:v:0 -f null -
ffmpeg version N-93862-gf49cec2ba8 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --enable-pthreads --enable-gpl --disable-ffplay --enable-vaapi --enable-vdpau --enable-libtwolame --enable-libopenjpeg --enable-libmp3lame --enable-libaom --enable-libwebp --enable-libopus --enable-libvorbis --enable-libtheora --enable-libvpx --enable-libx264 --enable-libx265 --extra-cflags=' -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/twolame-0.3.13/libtwolame -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/lame-3.100/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libaom-v1.0.0/usr/local/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/openjpeg-2.3.0/src/lib/openjp2 -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libogg-1.3.3/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/opus-1.3/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/include -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libtheora-1.1.1/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvpx-1.8.0/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x264-snapshot-20190117-2245-stable/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/source -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/. -I/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/source ' --extra-cxxflags=-D__STDC_CONSTANT_MACROS --pkg-config=true --extra-libs='-Wl,--start-group -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/twolame-0.3.13/libtwolame/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/twolame-0.3.13/libtwolame/.libs/libtwolame.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/lame-3.100/libmp3lame/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/lame-3.100/libmp3lame/.libs/libmp3lame.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/lame-3.100/mpglib/.libs/libmpgdecoder.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libaom-v1.0.0/usr/local/lib /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libaom-v1.0.0/usr/local/lib/libaom.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/lib /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/lib/libwebp.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/lib/libwebpdecoder.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/lib/libwebpdemux.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libwebp-1.0.2/usr/local/lib/libwebpmux.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/openjpeg-2.3.0/bin /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/openjpeg-2.3.0/bin/libopenjp2.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/opus-1.3/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/opus-1.3/.libs/libopus.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libogg-1.3.3/lib/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libogg-1.3.3/src/.libs/libogg.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/lib/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/lib/.libs/libvorbis.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/lib/.libs/libvorbisenc.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvorbis-1.3.6/lib/.libs/libvorbisfile.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libtheora-1.1.1/lib/.libs /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libtheora-1.1.1/lib/.libs/libtheora.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libtheora-1.1.1/lib/.libs/libtheoradec.a /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libtheora-1.1.1/lib/.libs/libtheoraenc.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvpx-1.8.0/ /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/libvpx-1.8.0/libvpx.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x264-snapshot-20190117-2245-stable/ /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x264-snapshot-20190117-2245-stable/libx264.a -L/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/ /dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/thirdparty/../thirdparty/x265_3.0/libx265.a -Wl,--end-group -L/usr/X11R7/lib -lm -lstdc++ -pthread -lOpenCL -ldav1d -lva -lva-x11 -lva-drm -ldl' --enable-opencl --enable-libdav1d --extra-ldflags=' -lva -lva-x11 -lva-drm -ldl'
  libavutil 56. 27.100 / 56. 27.100
  libavcodec 58. 52.101 / 58. 52.101
  libavformat 58. 27.103 / 58. 27.103
  libavdevice 58. 7.100 / 58. 7.100
  libavfilter 7. 53.100 / 7. 53.100
  libswscale 5. 4.101 / 5. 4.101
  libswresample 3. 4.100 / 3. 4.100
  libpostproc 55. 4.100 / 55. 4.100
[libdav1d @ 0xb3d3000] libdav1d 0.3.0
Input #0, matroska,webm, from '/mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm':
  Metadata:
    encoder : libwebm-0.2.1.0
  Duration: 00:02:24.12, start: 0.000000, bitrate: 3166 kb/s
    Stream #0:0(eng): Video: av1 (Main), yuv420p(tv), 1280x720, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
[libdav1d @ 0xb3d3b00] libdav1d 0.3.0
Stream mapping:
  Stream #0:0 -> #0:0 (av1 (libdav1d) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    encoder : Lavf58.27.103
    Stream #0:0(eng): Video: wrapped_avframe, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
    Metadata:
      encoder : Lavc58.52.101 wrapped_avframe
[matroska,webm @ 0xb3d0c80] Element at 0x36687cb ending at 0x3668d02 exceeds containing master element ending at 0x36687c5
frame= 3604 fps= 66 q=-0.0 Lsize=N/A time=00:02:24.16 bitrate=N/A speed=2.65x
video:1394kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
bench: utime=87.672s stime=2.283s rtime=54.503s
bench: maxrss=107208kB
----------------

SPEED libdav1d 0.3.0 = 2.65 realtime

But i still have no idea how to convince Cinelerra-GG to use libdav1d :/
Andrew-R

Andrew-R

2019-05-14 18:41

reporter   ~0001526

yeah, Cinelerra-GG apparently use libaom-av1 for decoding, and quite generic version (today's compile - Cin-GG git + ffmpeg.git)

root@slax:/dev/shm/tmp/cinelerra-goodguy-20190514/cinelerra-5.1/bin# ./cin
Cinelerra Infinity - built: May 14 2019 20:53:37
git://git.cinelerra-gg.org/goodguy/cinelerra.git
(c) 2006-2018 Heroine Virtual Ltd. by Adam Williams
(c) 2007-2018 cin5 derivative by W.P. Morrow aka goodguy
Cinelerra is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions. There is absolutely no warranty for Cinelerra.

[libaom-av1 @ 0xd8cd300] v1.0.0
[libaom-av1 @ 0xd8cd300] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[AVIOContext @ 0xd87be00] Statistics: 759514 bytes read, 0 seeks
[libaom-av1 @ 0xd8cd300] v1.0.0
[libaom-av1 @ 0xd8cd300] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[libaom-av1 @ 0xd85d1c0] v1.0.0
[libaom-av1 @ 0xd85d1c0] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[AVIOContext @ 0xd873a80] Statistics: 759514 bytes read, 0 seeks
[libaom-av1 @ 0xd8efd40] v1.0.0
[libaom-av1 @ 0xd8efd40] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[libaom-av1 @ 0xe2e07040] v1.0.0
[libaom-av1 @ 0xe2e07040] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[AVIOContext @ 0xd97c640] Statistics: 759514 bytes read, 0 seeks
[libaom-av1 @ 0xd974480] v1.0.0
[libaom-av1 @ 0xd974480] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
[libaom-av1 @ 0xd845a00] v1.0.0
[libaom-av1 @ 0xd845a00] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
[libaom-av1 @ 0xe2e079c0] v1.0.0
[libaom-av1 @ 0xe2e079c0] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
[libaom-av1 @ 0xe2e60dc0] v1.0.0
[libaom-av1 @ 0xe2e60dc0] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
[AVIOContext @ 0xe2e843c0] Statistics: 2840690 bytes read, 4 seeks
[AVIOContext @ 0xe2e058c0] Statistics: 759514 bytes read, 0 seeks
[libaom-av1 @ 0xec206e40] v1.0.0
[libaom-av1 @ 0xec206e40] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
FFMPEG::open_decoder: some stream times estimated: /mnt/sdb1/Stream2_AV1_720p_3.2mbps.webm
[libaom-av1 @ 0xec2605c0] v1.0.0
[libaom-av1 @ 0xec2605c0] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic
[libaom-av1 @ 0xec260940] v1.0.0
[libaom-av1 @ 0xec260940] cmake aom-master -G "Unix Makefiles" -DAOM_TARGET_CPU=generic

after adding .opts file with this content:
video_codec=libdav1d
loglevel=verbose

at the same directory where media file is.

So, i still don't know how to force specific codec :/

Yet, reading Features5.pdf gave me idea about adding special environment variables instead of hacking makefiles!

export EXTRA_LIBS=" -lOpenCL -ldav1d"
export FFMPEG_EXTRA_CFG=" --enable-opencl --enable-libdav1d"
setarch i686 ./configure --with-git-ffmpeg=https://git.ffmpeg.org/ffmpeg.git --with-single-user

and after make and make install I have my new Cinelerra ...

Issue History

Date Modified Username Field Change
2019-05-14 04:24 Andrew-R New Issue
2019-05-14 18:41 Andrew-R Note Added: 0001526
2019-05-14 18:59 Andrew-R Note Added: 0001527
2019-05-15 04:02 PhyllisSmith Note Added: 0001531
2019-05-15 04:02 PhyllisSmith Assigned To => goodguy
2019-05-15 04:02 PhyllisSmith Status new => assigned
2019-05-15 10:34 Andrew-R Note Added: 0001533
2019-05-15 11:08 Andrew-R Note Added: 0001534
2019-05-15 20:15 Andrew-R Note Added: 0001544