LINUX.ORG.RU

Ffmpeg


49

0

Всего сообщений: 2

lorsource 2007-2023

Полное видео тут.

gource --fullscreen --disable-input --hide mouse --multi-sampling --output-framerate 30 --seconds-per-day 0.05 --filename-time 2 --max-files 0 --bloom-multiplier 0.8 --highlight-dirs --highlight-users --file-extension-fallback --path . --auto-skip-seconds .01 --background-colour 000000 --key --stop-at-end --title "History of https://github.com/maxcom/lorsource" --output-ppm-stream - | ffmpeg -y -r 30 -f image2pipe -vcodec ppm -i - -vcodec libx265 -preset medium -crf 12 -bf 0 -minrate:v 5M -maxrate:v 300M -bufsize:v 800M lorsource2.mkv

Всех с новым кодом!

>>> Просмотр (1920x1080, 1082 Kb)

 , , gource,

dataman
()

Cinelerra-GG and av1

Вот, сделал небольшой хак к Cin-GG, теперь она воспроизводит 1280x720 AV1 видео на полной скорости. (вкомпилял ffmpeg.gt + libdav1d 0.3.0)

Хак - https://www.cinelerra-gg.org/bugtracker/view.php?id=214

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;

Компилять:

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 

Также видны разные фильтры от FFmpeg'а. Комплексные графы там не сделать, но просто как эффект к треку - должно сработать. (я пробовал scale_vaapi, но он что-то не заработал. Впрочем, они и с нормальным ffmpeg не работал .. завёл баг на месу)

>>> Просмотр (1440x900, 631 Kb)

 

Andrew-R
()