DAR ffmpeg encode fix, x264/x265 upgrade, match output size, ffmpeg view preloads
authorGood Guy <good1.2guy@gmail.com>
Thu, 27 Apr 2017 21:09:48 +0000 (15:09 -0600)
committerGood Guy <good1.2guy@gmail.com>
Thu, 27 Apr 2017 21:09:48 +0000 (15:09 -0600)
22 files changed:
cinelerra-5.1/cinelerra/bdcreate.C
cinelerra-5.1/cinelerra/dvdcreate.C
cinelerra-5.1/cinelerra/edl.C
cinelerra-5.1/cinelerra/edl.h
cinelerra-5.1/cinelerra/ffmpeg.C
cinelerra-5.1/cinelerra/fileffmpeg.C
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/setformat.C
cinelerra-5.1/cinelerra/ydiff.C
cinelerra-5.1/configure.ac
cinelerra-5.1/ffmpeg/video/h264.f4v
cinelerra-5.1/ffmpeg/video/h264.mp4
cinelerra-5.1/ffmpeg/video/h265-12bit.mp4
cinelerra-5.1/ffmpeg/video/h265-hi.mp4
cinelerra-5.1/ffmpeg/video/h265-lo.mp4
cinelerra-5.1/ffmpeg/video/h265-med.mp4
cinelerra-5.1/ffmpeg/video/h265.mp4
cinelerra-5.1/thirdparty/downloads.txt
cinelerra-5.1/thirdparty/src/x264-snapshot-20170416-2245-stable.tar.xz [deleted file]
cinelerra-5.1/thirdparty/src/x264-snapshot-20170426-2245.tar.xz [new file with mode: 0644]
cinelerra-5.1/thirdparty/src/x265_2.3.tar.xz [deleted file]
cinelerra-5.1/thirdparty/src/x265_2.4.tar.xz [new file with mode: 0644]

index 76892b71bd47f8c4d7410c82a18727945bc3e7d4..14b978c103d2c062203303b0424975994cbb1ba2 100644 (file)
@@ -263,6 +263,7 @@ int CreateBD_Thread::create_bd_jobs(ArrayList<BatchRenderJob*> *jobs, const char
 
        double new_samplerate = session->sample_rate;
        double new_framerate = session->frame_rate;
+       edl->retrack();
        edl->rechannel();
        edl->resample(old_samplerate, new_samplerate, TRACK_AUDIO);
        edl->resample(old_framerate, new_framerate, TRACK_VIDEO);
index 055b4ca57421254a3d7ec1158afc8f7e1983b3d5..6a870a72d980e036b6bffae8ae2b6afa1559b391 100644 (file)
@@ -262,6 +262,7 @@ int CreateDVD_Thread::create_dvd_jobs(ArrayList<BatchRenderJob*> *jobs, const ch
 
        double new_samplerate = session->sample_rate;
        double new_framerate = session->frame_rate;
+       edl->retrack();
        edl->rechannel();
        edl->resample(old_samplerate, new_samplerate, TRACK_AUDIO);
        edl->resample(old_framerate, new_framerate, TRACK_VIDEO);
index 41ee55b4fddd716757ef560dc68fc29cc13f61bc..cf1d0968ae738b0105be07b122b1697e59f36e90 100644 (file)
@@ -38,6 +38,7 @@
 #include "interlacemodes.h"
 #include "labels.h"
 #include "localsession.h"
+#include "maskautos.h"
 #include "mutex.h"
 #include "nestededls.h"
 #include "panauto.h"
@@ -669,6 +670,26 @@ int EDL::copy(double start,
        return 0;
 }
 
+void EDL::retrack()
+{
+       int min_w = session->output_w, min_h = session->output_h;
+       for( Track *track=tracks->first; track!=0; track=track->next ) {
+               if( track->data_type != TRACK_VIDEO ) continue;
+               int w = min_w, h = min_h;
+               for( Edit *current=track->edits->first; current!=0; current=NEXT ) {
+                       Indexable* indexable = current->get_source();
+                       if( !indexable ) continue;
+                       int edit_w = indexable->get_w(), edit_h = indexable->get_h();
+                       if( w < edit_w ) w = edit_w;
+                       if( h < edit_h ) h = edit_h;
+               }
+               if( track->track_w == w && track->track_h == h ) continue;
+               ((MaskAutos*)track->automation->autos[AUTOMATION_MASK])->
+                       translate_masks( (w - track->track_w) / 2, (h - track->track_h) / 2);
+               track->track_w = w;  track->track_h = h;
+       }
+}
+
 void EDL::rechannel()
 {
        for(Track *current = tracks->first; current; current = NEXT)
index dbafb41e42e348c5ba639277a1df9431d8e0d0be..0000e3f730a90164614ceb59b91b677e29b3e613 100644 (file)
@@ -97,6 +97,8 @@ public:
 // Convert position to frames if cursor alignment is enabled
        double align_to_frame(double position, int round);
 
+// increase track w/h to at least session w/h
+       void retrack();
 // Scale all sample values since everything is locked to audio
        void rechannel();
        void resample(double old_rate, double new_rate, int data_type);
index 70ccc272f1d16156a6634c43741f63ab1e7bfb4d..968cb05145108d164ae7fab31ad954432e4f614a 100644 (file)
@@ -549,7 +549,7 @@ int FFStream::seek(int64_t no, double rate)
                }
        }
        if( ret < 0 ) {
-//printf("** seek fail %ld, %ld\n", pos, tstmp);
+printf("** seek fail %ld, %ld\n", pos, tstmp);
                seeked = need_packet = 0;
                st_eof(flushed=1);
                return -1;
@@ -1214,7 +1214,7 @@ AVRational FFMPEG::to_sample_aspect_ratio(Asset *asset)
 {
 #if 1
        double display_aspect = asset->width / (double)asset->height;
-       double sample_aspect = asset->aspect_ratio / display_aspect;
+       double sample_aspect = display_aspect / asset->aspect_ratio;
        int width = 1000000, height = width * sample_aspect + 0.5;
        float w, h;
        MWindow::create_aspect_ratio(w, h, width, height);
index d4f89e6c47795c4fef2feab4f7b6efb46ae25d3d..5542c97587ab7f976e2c57fc38db699917811969 100644 (file)
@@ -1064,6 +1064,9 @@ void FFOptions::initialize(FFOptionsWindow *win, int kind)
                        if( dupl ) continue;
                        FFOptions_Opt *fopt = new FFOptions_Opt(this, opt, opt->name);
                        append(fopt);
+                       AVDictionaryEntry *elem = av_dict_get(win->dialog->ff_opts,
+                                       opt->name, 0, AV_DICT_IGNORE_SUFFIX);
+                       if( elem && elem->value ) fopt->set(elem->value);
                        char val[BCTEXTLEN], *vp = fopt->get(val, sizeof(val));
                        fopt->item_value->update(vp);
                }
index 577f229ef5f1216236cda2bcb40e6c79e95f685f..478c845c2279d08ea4ec29ce9d345297e68113ce 100644 (file)
@@ -3597,6 +3597,7 @@ int MWindow::select_asset(Asset *asset, int vstream, int astream, int delete_tra
                        else if( delete_tracks )
                                edl->tracks->delete_track(track);
                }
+               edl->retrack();
                edl->resample(old_framerate, session->frame_rate, TRACK_VIDEO);
        }
        if( !result && asset->audio_data && asset->channels > 0 ) {
index 413fa950357b3f029b0c400452cf9f4ee5c41fe0..af83439737b53a6985e93026b4a72f5b3395f297 100644 (file)
@@ -159,6 +159,7 @@ void SetFormatThread::apply_changes()
        mwindow->edl->copy_session(new_settings, 1);
        mwindow->edl->session->output_w = dimension[0];
        mwindow->edl->session->output_h = dimension[1];
+       mwindow->edl->retrack();
        mwindow->edl->rechannel();
        mwindow->edl->resample(old_samplerate, new_samplerate, TRACK_AUDIO);
        mwindow->edl->resample(old_framerate, new_framerate, TRACK_VIDEO);
index 369b199c27aad70fc46d76179132cc4f3f1d966c..8fc5470d81109832865d682c0245989677315f3c 100644 (file)
@@ -113,6 +113,7 @@ gtk_window::gtk_window(int width, int height)
 
 gtk_window::~gtk_window()
 {
+  gdk_flush();
   gtk_widget_destroy(window);
   g_object_unref(pbuf0);
   g_object_unref(img0);
index da5aadec94318d8275513c2902f7714e361be8fb..41b522ff64c940acb839a1a249f6a7e0932967cc 100644 (file)
@@ -294,12 +294,12 @@ PKG_3RD([twolame],[auto],
   [  libtwolame ])
 
 PKG_3RD([x264],[auto],
-  [x264-snapshot-20170416-2245-stable],
+  [x264-snapshot-20170426-2245],
   [ libx264.a ],
   [ . ])
 
 PKG_3RD([x265],[auto],
-  [x265_2.3],
+  [x265_2.4],
   [ libx265.a ],
   [ . source ])
 
index 664351d788e7a22fab65e2c3fca7abb0faea6a73..94d66a89566b12c3bbd5f74c9b4deecc79d54a07 100644 (file)
@@ -2,4 +2,5 @@ f4v libx264
 profile=baseline
 level=3.0
 preset=medium
+keyint_min=25
 x264opts keyint=25:min-keyint=4:qpmin=3:qpmax=33:qp_step=4:merange=8
index c4daad777e7035be2ca1e962ac81ccb4b637af9c..64b05ba004d9d6e36c74892ffa73e20c5e710d3b 100644 (file)
@@ -1 +1,4 @@
 mp4 libx264
+# use framerate for 1 keyframe/sec, needed for seeks
+keyint_min=25
+x264opts keyint=25
index 93c8965c161f4d7401c6e6894bda5b8425eac022..f52813d9291ba92adf5a216169507eb8c486eb35 100644 (file)
@@ -5,5 +5,7 @@ colorspace=bt2020_cl
 color_primaries=bt2020
 color_trc=bt2020_12bit
 pixel_format=yuv422p12
-x265-params=output-depth=12
+# use framerate for 1 keyframe/sec, needed for seeks
+keyint_min=30
+x265-params=output-depth=12:keyint=30
 cin_quality=-1
index d73b1a5ed4429dffad3719743976d169f209b177..9a452fe2687de4eb52dd81843dab8d506728a18d 100644 (file)
@@ -1,3 +1,6 @@
 mp4 libx265
 crf=5
 cin_quality=-1
+# use framerate for 1 keyframe/sec, needed for seeks
+keyint_min=30
+x265-params=keyint=30
index c3d5428867ea0c0938d0cac5d34b18e077d6718a..307dfc3d81d9e4ea123631a0d90ab28f8c7ff26f 100644 (file)
@@ -2,3 +2,6 @@ mp4 libx265
 # lossy but faster
 crf=25
 cin_quality=-1
+# use framerate for 1 keyframe/sec, needed for seeks
+keyint_min=30
+x265-params=keyint=30
index 0408dcb1d58dc72a10a73289f66040325bb97ef6..9f86280053b59c93a9db151e86c88c673d957352 100644 (file)
@@ -2,3 +2,6 @@ mp4 libx265
 # visually lossless
 crf=18
 cin_quality=-1
+# use framerate for 1 keyframe/sec, needed for seeks
+keyint_min=30
+x265-params=keyint=30
index 8174ea34d2192fded16bed5de1bb0084dee3092e..19ee8e334b5b3171f1ccdd044a420dd463e6ef12 100644 (file)
@@ -1,2 +1,5 @@
 mp4 libx265
 cin_quality=-1
+# use framerate for 1 keyframe/sec, needed for seeks
+keyint_min=30
+x265-params=keyint=30
index bd3e0a89558a92da6c3decc04e1408ecf5f8c127..30e167713695b8570a3bc464d4f329ff0eed0397 100644 (file)
@@ -27,7 +27,7 @@ http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
 https://sourceforge.net/projects/lame/files/latest/download?source=directory = 3.99.5
 http://dl.maptools.org/dl/libtiff/libtiff-cvsroot, untar, cd libtiff, cvs init, cd /tmp/x, cvs co -d path/libtiff = 4.0.6
 https://sourceforge.net/projects/libuuid/files/latest/download?source=directory - 1.0.3
-ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20170416-2245-stable.tar.bz2
-https://bitbucket.org/multicoreware/x265/downloads/x265_2.3.tar.gz
+ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20170426-2245-stable.tar.bz2
+https://bitbucket.org/multicoreware/x265/downloads/x265_2.4.tar.gz
 http://ffmpeg.org/releases/ffmpeg-3.3.tar.bz2
 https://chromium.googlesource.com/webm/libvpx/+archive/0c0a05046db1c0b59a7fcc29785a190fdbbe39c2.tar.gz = 1,6,1
diff --git a/cinelerra-5.1/thirdparty/src/x264-snapshot-20170416-2245-stable.tar.xz b/cinelerra-5.1/thirdparty/src/x264-snapshot-20170416-2245-stable.tar.xz
deleted file mode 100644 (file)
index 0ddf716..0000000
Binary files a/cinelerra-5.1/thirdparty/src/x264-snapshot-20170416-2245-stable.tar.xz and /dev/null differ
diff --git a/cinelerra-5.1/thirdparty/src/x264-snapshot-20170426-2245.tar.xz b/cinelerra-5.1/thirdparty/src/x264-snapshot-20170426-2245.tar.xz
new file mode 100644 (file)
index 0000000..d5cfdd8
Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/x264-snapshot-20170426-2245.tar.xz differ
diff --git a/cinelerra-5.1/thirdparty/src/x265_2.3.tar.xz b/cinelerra-5.1/thirdparty/src/x265_2.3.tar.xz
deleted file mode 100644 (file)
index 98e8a23..0000000
Binary files a/cinelerra-5.1/thirdparty/src/x265_2.3.tar.xz and /dev/null differ
diff --git a/cinelerra-5.1/thirdparty/src/x265_2.4.tar.xz b/cinelerra-5.1/thirdparty/src/x265_2.4.tar.xz
new file mode 100644 (file)
index 0000000..79f74c0
Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/x265_2.4.tar.xz differ